Package paulscode.sound

Examples of paulscode.sound.SoundSystem


    /**
    * Sets the listener of sounds
    */
    public void setSoundListenerOrientation()
    {
        SoundSystem sndSystem = null;

        // Use reflection to get the sndManager
        if (sndSystemReflect && _soundManagerSndSystemField == null)
        {
          try
          {
            _soundManagerSndSystemField = SoundManager.class.getDeclaredField("sndSystem");
            System.out.println("VRRender: Reflected sndSystem");
          }
          catch (NoSuchFieldException e) {
            try
            {
              _soundManagerSndSystemField = SoundManager.class.getDeclaredField("b"); //obfuscated name
              System.out.println("VRRender: Reflected obfuscated b");
            }
            catch (NoSuchFieldException e1) {
              System.out.println("VRRender: got sndSystem directly");
              sndSystemReflect = false;
            };
          }
           if (_soundManagerSndSystemField != null)
             _soundManagerSndSystemField.setAccessible(true);
        }
        if(!sndSystemReflect ){
          if( this.mc.sndManager != null )
            sndSystem = this.mc.sndManager.sndSystem;
         
        }
       
       
        if (_soundManagerSndSystemField != null && this.mc.sndManager != null)
        {
      try
          {
        sndSystem = (SoundSystem)_soundManagerSndSystemField.get(this.mc.sndManager);
      }
          catch (IllegalArgumentException e) { }
          catch (IllegalAccessException e) { };
        }

        float PIOVER180 = (float)(Math.PI/180);

        Vec3 up = Vec3.createVectorHelper(0, 1, 0);
        up.rotateAroundZ(-cameraRoll * PIOVER180);
        up.rotateAroundX(-cameraPitch* PIOVER180);
        up.rotateAroundY(-cameraYaw  * PIOVER180);
        if ( sndSystem != null && this.mc.gameSettings.soundVolume != 0.0F)
        {
            sndSystem.setListenerPosition((float)renderOriginX, (float)renderOriginY, (float)renderOriginZ);

            sndSystem.setListenerOrientation(lookX, lookY, lookZ,
                            (float)up.xCoord, (float)up.yCoord, (float)up.zCoord);
        }
        if( mc.mumbleLink != null ) {
          Vec3 forward = Vec3.createVectorHelper(0, 0 , -1);
          forward.rotateAroundZ(-cameraRoll * PIOVER180);
 
View Full Code Here


          */
      } else if (split[0].equalsIgnoreCase("music")) {
         if (split.length < 2) {
            playRandomMusic();
         } else if (split[1].equalsIgnoreCase("next") || split[1].equalsIgnoreCase("skip")) {
            SoundSystem sound = getSoundSystem();
            if (sound != null) {
               if (sound.playing("BgMusic")) {
                  sound.stop("BgMusic");
               }
               if (sound.playing("streaming")) {
                  sound.stop("streaming");
               }
            }
            playRandomMusic();
         } else if (split[1].equalsIgnoreCase("pause")) {
            SoundSystem sound = getSoundSystem();
            if (sound != null) {
               if (sound.playing("BgMusic")) {
                  sound.pause("BgMusic");
               }
               if (sound.playing("streaming")) {
                  sound.pause("streaming");
               }
            }
         } else if (split[1].equalsIgnoreCase("play")) {
            SoundSystem sound = getSoundSystem();
            if (sound != null) {
               if (!sound.playing("BgMusic")) {
                  sound.play("BgMusic");
               }
               if (!sound.playing("BgMusic")) {
                  playRandomMusic();
               }
            } else {
               playRandomMusic();
            }
         } else if (split[1].equalsIgnoreCase("stop")) {
            SoundSystem sound = getSoundSystem();
            if (sound != null) {
               if (sound.playing("BgMusic")) {
                  sound.stop("BgMusic");
               }
               if (sound.playing("streaming")) {
                  sound.stop("streaming");
               }
            }
         } else {
            try {
               int volume = Integer.parseInt(split[1]);
View Full Code Here

            options.saveOptions();
            SoundSystemConfig.addLibrary(paulscode.sound.libraries.LibraryLWJGLOpenAL.class);
            SoundSystemConfig.setCodec("ogg", paulscode.sound.codecs.CodecJOrbis.class);
            SoundSystemConfig.setCodec("mus", net.minecraft.src.CodecMus.class);
            SoundSystemConfig.setCodec("wav", paulscode.sound.codecs.CodecWav.class);
            sndSystem = new SoundSystem();
            options.soundVolume = f;
            options.musicVolume = f1;
            options.saveOptions();
        }
        catch (Throwable throwable)
View Full Code Here

TOP

Related Classes of paulscode.sound.SoundSystem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.