jmri.jmrit.audio
Interface AudioFactory

All Known Implementing Classes:
AbstractAudioFactory, JavaSoundAudioFactory, JoalAudioFactory, NullAudioFactory

public interface AudioFactory

An AudioFactory is responsible for the initialisation of specific audio system implementations, creation of audio system specific Audio objects and any necessary clean-up operations required by a specific audio system implementation.

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:


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.

Author:
Matthew Harris copyright (c) 2009

Method Summary
 boolean audioCommandQueue(AudioCommand newAudioCommand)
          Queues a new AudioCommand for subsequent execution.
 void cleanup()
          Perform any implementation specific clean-up operations.
 AudioBuffer createNewBuffer(String systemName, String userName)
          Provide a specific new AudioBuffer object.
 AudioListener createNewListener(String systemName, String userName)
          Provide a specific new AudioListener object.
 AudioSource createNewSource(String systemName, String userName)
          Provide a specific new AudioSource object.
 AudioListener getActiveAudioListener()
          Return the currently active Listener object
 Thread getCommandThread()
          Return the currently active Command thread
 boolean init()
          Perform any implementation specific initialisation routines.
 boolean isDistanceAttenuated()
          Determines if this AudioFactory attenuates sources based on their distance from the Listener
 void setDistanceAttenuated(boolean attenuated)
          Sets if this AudioFactory should attenuate sources based on their distance from the listener Default = true
 

Method Detail

init

boolean init()
Perform any implementation specific initialisation routines.

Returns:
true, if initialisation successful

cleanup

void cleanup()
Perform any implementation specific clean-up operations.


createNewBuffer

AudioBuffer createNewBuffer(String systemName,
                            String userName)
Provide a specific new AudioBuffer object.

Parameters:
systemName - for this object instance
userName - for this object instance
Returns:
a new specific AudioBuffer

createNewListener

AudioListener createNewListener(String systemName,
                                String userName)
Provide a specific new AudioListener object.

Parameters:
systemName - for this object instance
userName - for this object instance
Returns:
a new specific AudioListener

getActiveAudioListener

AudioListener getActiveAudioListener()
Return the currently active Listener object

Returns:
active AudioListener

createNewSource

AudioSource createNewSource(String systemName,
                            String userName)
Provide a specific new AudioSource object.

Parameters:
systemName - for this object instance
userName - for this object instance
Returns:
a new specific AudioSource

audioCommandQueue

boolean audioCommandQueue(AudioCommand newAudioCommand)
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

Thread getCommandThread()
Return the currently active Command thread

Returns:
active CommandThread

setDistanceAttenuated

void setDistanceAttenuated(boolean attenuated)
Sets 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()
Determines if this AudioFactory attenuates sources based on their distance from the Listener

Returns:
true if distance attenuation used


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads