Class KeepAliveDeviceRerouter
java.lang.Object
de.pottgames.tuningfork.router.KeepAliveDeviceRerouter
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, AudioDeviceRerouter
A simple rerouter that connects to the default device when the connection to the current device is lost.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()voidGets 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).
-
Constructor Details
-
KeepAliveDeviceRerouter
public KeepAliveDeviceRerouter()
-
-
Method Details
-
setup
Description copied from interface:AudioDeviceRerouterThis method is called beforerun.- Specified by:
setupin interfaceAudioDeviceRerouter- Parameters:
device- the OpenAL device handledesiredDeviceSpecifier- the device specifier that was specified inAudioDeviceConfig.setDeviceSpecifier(String)attributes- the context attributes
-
updateDesiredDevice
Description copied from interface:AudioDeviceRerouterThis method gets called when the user changes the device at runtime viaAudioDevice.switchToDevice(String).- Specified by:
updateDesiredDevicein interfaceAudioDeviceRerouter- Parameters:
desiredDeviceSpecifier- the device name
-
updateContextAttributes
Description copied from interface:AudioDeviceRerouterThis method gets called whenever the OpenAL context attributes change.- Specified by:
updateContextAttributesin interfaceAudioDeviceRerouter- Parameters:
attributes- the context attributes
-
start
public void start()Description copied from interface:AudioDeviceRerouterGets called right aftersetupand should start a background thread which is then responsible for rerouting.- Specified by:
startin interfaceAudioDeviceRerouter
-
onDisconnect
public void onDisconnect()Description copied from interface:AudioDeviceRerouterGets called when a disconnect to the audio device is detected.- Specified by:
onDisconnectin interfaceAudioDeviceRerouter
-
dispose
public void dispose()- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-