forked from libgdx/libgdx
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use dummy Audio implementations when audio is disabled in config on i…
…OS and Android
- Loading branch information
Showing
10 changed files
with
150 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/DisabledAndroidAudio.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
package com.badlogic.gdx.backends.android; | ||
|
||
import com.badlogic.gdx.audio.AudioDevice; | ||
import com.badlogic.gdx.audio.AudioRecorder; | ||
import com.badlogic.gdx.audio.Music; | ||
import com.badlogic.gdx.audio.Sound; | ||
import com.badlogic.gdx.files.FileHandle; | ||
import com.badlogic.gdx.utils.GdxRuntimeException; | ||
|
||
public class DisabledAndroidAudio implements AndroidAudio { | ||
|
||
@Override | ||
public void pause () { | ||
} | ||
|
||
@Override | ||
public void resume () { | ||
} | ||
|
||
@Override | ||
public void notifyMusicDisposed (AndroidMusic music) { | ||
} | ||
|
||
@Override | ||
public AudioDevice newAudioDevice (int samplingRate, boolean isMono) { | ||
throw new GdxRuntimeException("Android audio is not enabled by the application config"); | ||
} | ||
|
||
@Override | ||
public AudioRecorder newAudioRecorder (int samplingRate, boolean isMono) { | ||
throw new GdxRuntimeException("Android audio is not enabled by the application config"); | ||
} | ||
|
||
@Override | ||
public Sound newSound (FileHandle fileHandle) { | ||
throw new GdxRuntimeException("Android audio is not enabled by the application config"); | ||
} | ||
|
||
@Override | ||
public Music newMusic (FileHandle file) { | ||
throw new GdxRuntimeException("Android audio is not enabled by the application config"); | ||
} | ||
|
||
@Override | ||
public boolean switchOutputDevice (String deviceIdentifier) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public String[] getAvailableOutputDevices () { | ||
return new String[0]; | ||
} | ||
|
||
@Override | ||
public void dispose () { | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
backends/gdx-backend-robovm/src/com/badlogic/gdx/backends/iosrobovm/DisabledIOSAudio.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
package com.badlogic.gdx.backends.iosrobovm; | ||
|
||
import com.badlogic.gdx.audio.AudioDevice; | ||
import com.badlogic.gdx.audio.AudioRecorder; | ||
import com.badlogic.gdx.audio.Music; | ||
import com.badlogic.gdx.audio.Sound; | ||
import com.badlogic.gdx.files.FileHandle; | ||
import com.badlogic.gdx.utils.GdxRuntimeException; | ||
|
||
public class DisabledIOSAudio implements IOSAudio { | ||
@Override | ||
public void didBecomeActive () { | ||
} | ||
|
||
@Override | ||
public void willEnterForeground () { | ||
} | ||
|
||
@Override | ||
public void willResignActive () { | ||
} | ||
|
||
@Override | ||
public void willTerminate () { | ||
} | ||
|
||
@Override | ||
public AudioDevice newAudioDevice (int samplingRate, boolean isMono) { | ||
throw new GdxRuntimeException("iOS audio is not enabled by the application config"); | ||
} | ||
|
||
@Override | ||
public AudioRecorder newAudioRecorder (int samplingRate, boolean isMono) { | ||
throw new GdxRuntimeException("iOS audio is not enabled by the application config"); | ||
} | ||
|
||
@Override | ||
public Sound newSound (FileHandle fileHandle) { | ||
throw new GdxRuntimeException("iOS audio is not enabled by the application config"); | ||
} | ||
|
||
@Override | ||
public Music newMusic (FileHandle file) { | ||
throw new GdxRuntimeException("iOS audio is not enabled by the application config"); | ||
} | ||
|
||
@Override | ||
public boolean switchOutputDevice (String deviceIdentifier) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public String[] getAvailableOutputDevices () { | ||
return new String[0]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters