Interface AudioDeviceRerouter
- All Superinterfaces:
com.badlogic.gdx.utils.Disposable
- All Known Implementing Classes:
KeepAliveDeviceRerouter, SmartDeviceRerouter
public interface AudioDeviceRerouter
extends com.badlogic.gdx.utils.Disposable
A device rerouter is responsible for routing the audio to another audio device when the connection to the current device is lost. May also be used to keep
track of the default audio device of the OS and switch to it when a new default device is reported by the OS.
-
Method Summary
Modifier and TypeMethodDescriptionvoidGets called when a disconnect to the audio device is detected.voidsetup(long device, String desiredDeviceSpecifier, ContextAttributes attributes) This method is called beforerun.voidstart()Gets called right aftersetupand should start a background thread which is then responsible for rerouting.voidupdateContextAttributes(ContextAttributes attributes) This method gets called whenever the OpenAL context attributes change.voidupdateDesiredDevice(String desiredDeviceSpecifier) This method gets called when the user changes the device at runtime viaAudioDevice.switchToDevice(String).Methods inherited from interface com.badlogic.gdx.utils.Disposable
dispose
-
Method Details
-
setup
This method is called beforerun.- Parameters:
device- the OpenAL device handledesiredDeviceSpecifier- the device specifier that was specified inAudioDeviceConfig.setDeviceSpecifier(String)attributes- the context attributes
-
updateDesiredDevice
This method gets called when the user changes the device at runtime viaAudioDevice.switchToDevice(String).- Parameters:
desiredDeviceSpecifier- the device name
-
updateContextAttributes
This method gets called whenever the OpenAL context attributes change.- Parameters:
attributes- the context attributes
-
start
void start()Gets called right aftersetupand should start a background thread which is then responsible for rerouting. -
onDisconnect
void onDisconnect()Gets called when a disconnect to the audio device is detected.
-