Interface AudioFactory
- All Known Implementing Classes:
AbstractAudioFactory,JavaSoundAudioFactory,JoalAudioFactory,NullAudioFactory
Each factory varies in its capabilities with regard the faithfulness of the audio rendering model (such as spatial positioning approximation), number of concurrent sounds (polyphony), hardware required, etc.
Current implemented audio systems include:
- JOAL
- JavaSound
- Null (a catch-all which doesn't actually play any sounds)
This file is part of JMRI.
JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaudioCommandQueue(AudioCommand newAudioCommand) Queues a new AudioCommand for subsequent execution.voidcleanup()Perform any implementation specific clean-up operations.createNewBuffer(String systemName, String userName) Provide a specific new AudioBuffer object.createNewListener(String systemName, String userName) Provide a specific new AudioListener object.createNewSource(String systemName, String userName) Provide a specific new AudioSource object.Get the currently active Listener object.Get the currently active Command thread.booleaninit()Perform any implementation specific initialisation routines.booleanDetermine if this AudioFactory attenuates sources based on their distance from the Listener.booleanDetermine if this AudioFactory is initialisedvoidsetDistanceAttenuated(boolean attenuated) Set if this AudioFactory should attenuate sources based on their distance from the listener.
-
Method Details
-
init
boolean init()Perform any implementation specific initialisation routines.- Returns:
- true, if initialisation successful
-
cleanup
void cleanup()Perform any implementation specific clean-up operations. -
isInitialised
boolean isInitialised()Determine if this AudioFactory is initialised- Returns:
- true if initialised
-
createNewBuffer
Provide a specific new AudioBuffer object.- Parameters:
systemName- for this object instanceuserName- for this object instance- Returns:
- a new specific AudioBuffer
-
createNewListener
Provide a specific new AudioListener object.- Parameters:
systemName- for this object instanceuserName- for this object instance- Returns:
- a new specific AudioListener
-
getActiveAudioListener
Get the currently active Listener object.- Returns:
- active AudioListener
-
createNewSource
Provide a specific new AudioSource object.- Parameters:
systemName- for this object instanceuserName- for this object instance- Returns:
- a new specific AudioSource
-
audioCommandQueue
Queues a new AudioCommand for subsequent execution.If newAudioCommand is null the current queue is executed and cleaned.
- Parameters:
newAudioCommand- AudioCommand to queue or null to execute queue- Returns:
- true, if further commands exist; false, if empty
-
getCommandThread
Get the currently active Command thread.- Returns:
- active CommandThread
-
setDistanceAttenuated
Set if this AudioFactory should attenuate sources based on their distance from the listener.Default = true
- Parameters:
attenuated- true if distance attenuation to be used
-
isDistanceAttenuated
boolean isDistanceAttenuated()Determine if this AudioFactory attenuates sources based on their distance from the Listener.- Returns:
- true if distance attenuation used
-