diff options
author | Sven Gothel <[email protected]> | 2013-08-25 02:47:49 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-08-25 02:47:49 +0200 |
commit | 8cdbfb676ea31c6719e6f6e8ae7a44e060a5987f (patch) | |
tree | 1808877f76e87d4c67d0ff23657b39af823c072b /src/test/com/jogamp | |
parent | 517371b2c200783890e2f6a173748cf65d3c8c91 (diff) |
GLMediaPlayer/AudioSink: Add set[Audio]Volume(float v)/get[Audio]Volume() allowing to change the audio volume.
Diffstat (limited to 'src/test/com/jogamp')
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java | 9 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java index 7fa55f861..7647421a0 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java @@ -150,6 +150,15 @@ public class MovieCube implements GLEventListener { } mPlayer.setPlaySpeed(playSpeed); } break; + case KeyEvent.VK_M: { + float audioVolume = mPlayer.getAudioVolume(); + if( audioVolume > 0.5f ) { + audioVolume = 0f; + } else { + audioVolume = 1f; + } + mPlayer.setAudioVolume(audioVolume); + } break; } if( 0 != pts1 ) { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java index 672500b1b..f0a11820e 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java @@ -213,6 +213,15 @@ public class MovieSimple implements GLEventListener { } mPlayer.setPlaySpeed(playSpeed); } break; + case KeyEvent.VK_M: { + float audioVolume = mPlayer.getAudioVolume(); + if( audioVolume > 0.5f ) { + audioVolume = 0f; + } else { + audioVolume = 1f; + } + mPlayer.setAudioVolume(audioVolume); + } break; } if( 0 != pts1 ) { |