OSDN Git Service

fixed issue 1089, added Sound#setPriority method, it's just a hint, works only on...
authorMario Zechner <contact@badlogicgames.com>
Tue, 23 Oct 2012 21:13:45 +0000 (23:13 +0200)
committerMario Zechner <contact@badlogicgames.com>
Tue, 23 Oct 2012 21:13:45 +0000 (23:13 +0200)
backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidSound.java
backends/gdx-backend-iosmonotouch/src/com/badlogic/gdx/backends/ios/IOSSound.java
backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtSound.java
backends/gdx-openal/src/com/badlogic/gdx/backends/openal/OpenALSound.java
gdx/src/com/badlogic/gdx/audio/Sound.java
tests/gdx-tests-lwjgl/src/com/badlogic/gdx/tests/lwjgl/LwjglDebugStarter.java

index 2f0eef2..aa9c231 100644 (file)
@@ -133,4 +133,9 @@ final class AndroidSound implements Sound {
                streamIds.add(streamId);\r
                return streamId;\r
        }\r
+\r
+       @Override\r
+       public void setPriority (long soundId, int priority) {\r
+               soundPool.setPriority((int)soundId, priority);\r
+       }\r
 }\r
index 2ced0a2..31f6ed3 100644 (file)
@@ -279,5 +279,10 @@ public class IOSSound implements Sound {
                        players[(int)soundId].set_Pan(pan);\r
                        players[(int)soundId].set_Volume(volume);\r
                }
+       }\r
+\r
+       @Override\r
+       public void setPriority (long soundId, int priority) {\r
+               // FIXME\r
        }
 }
\ No newline at end of file
index c69b7bd..6a57f72 100644 (file)
@@ -98,4 +98,9 @@ public class GwtSound implements Sound {
        public long loop (float volume, float pitch, float pan) {\r
                return loop(volume);\r
        }\r
+\r
+       @Override\r
+       public void setPriority (long soundId, int priority) {\r
+               // FIXME\r
+       }\r
 }\r
index 6b400bc..166a77d 100644 (file)
@@ -145,4 +145,9 @@ public class OpenALSound implements Sound {
        public float duration () {\r
                return duration;\r
        }\r
+\r
+       @Override\r
+       public void setPriority (long soundId, int priority) {\r
+               // TODO Auto-generated method stub\r
+       }\r
 }\r
index 7be12c7..b8c3d5d 100644 (file)
@@ -104,4 +104,13 @@ public interface Sound extends Disposable {
         * @param pan panning in the range -1 (full right) to 1 (full left). 0 is center position.\r
         * @param volume the volume in the range [0,1]. */\r
        public void setPan (long soundId, float pan, float volume);\r
+       \r
+       /**\r
+        * Sets the priority of a sound currently being played back. Higher priority sounds will be considered last\r
+        * if the maximum number of concurrently playing sounds is exceeded. This is only a \r
+        * hint and might not be honored by a backend implementation.\r
+        * @param soundId the sound id as returned by {@link #play()} or {@link #loop()} and their overloaded equivalents.\r
+        * @param priority the priority (0 == lowest)\r
+        */\r
+       public void setPriority(long soundId, int priority);\r
 }\r
index d7e2045..7d8c37b 100644 (file)
@@ -36,11 +36,12 @@ public class LwjglDebugStarter {
 \r
                GdxTest test = new BulletTest();\r
                LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();\r
-               config.width = 640;\r
-               config.height = 640;\r
+               config.width = 800;\r
+               config.height = 600;\r
                config.useGL20 = test.needsGL20();\r
                config.vSyncEnabled = true;\r
                config.resizable = true;\r
+               config.fullscreen = true;\r
                new LwjglApplication(test, config);\r
        }\r
 }\r