Package jmri.jmrit.audio
Class AbstractAudioFactory
java.lang.Object
jmri.jmrit.audio.AbstractAudioFactory
- All Implemented Interfaces:
AudioFactory
- Direct Known Subclasses:
JavaSoundAudioFactory,JoalAudioFactory,NullAudioFactory
Abstract implementation of the AudioFactory class.
This file is part of JMRI.
All code shared amongst the concrete AudioFactory classes is defined here.
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaudioCommandQueue(AudioCommand queueAudioCommand) Queues a new AudioCommand for subsequent execution.voidcleanup()Perform any implementation specific clean-up operations.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.voidsetDistanceAttenuated(boolean attenuated) Set if this AudioFactory should attenuate sources based on their distance from the listener.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.jmrit.audio.AudioFactory
createNewBuffer, createNewListener, createNewSource, getActiveAudioListener, isInitialised
-
Constructor Details
-
AbstractAudioFactory
public AbstractAudioFactory()
-
-
Method Details
-
init
Description copied from interface:AudioFactoryPerform any implementation specific initialisation routines.- Specified by:
initin interfaceAudioFactory- Returns:
- true, if initialisation successful
-
cleanup
Description copied from interface:AudioFactoryPerform any implementation specific clean-up operations.- Specified by:
cleanupin interfaceAudioFactory
-
audioCommandQueue
Description copied from interface:AudioFactoryQueues a new AudioCommand for subsequent execution.If newAudioCommand is null the current queue is executed and cleaned.
- Specified by:
audioCommandQueuein interfaceAudioFactory- Parameters:
queueAudioCommand- AudioCommand to queue or null to execute queue- Returns:
- true, if further commands exist; false, if empty
-
getCommandThread
Description copied from interface:AudioFactoryGet the currently active Command thread.- Specified by:
getCommandThreadin interfaceAudioFactory- Returns:
- active CommandThread
-
setDistanceAttenuated
Description copied from interface:AudioFactorySet if this AudioFactory should attenuate sources based on their distance from the listener.Default = true
- Specified by:
setDistanceAttenuatedin interfaceAudioFactory- Parameters:
attenuated- true if distance attenuation to be used
-
isDistanceAttenuated
Description copied from interface:AudioFactoryDetermine if this AudioFactory attenuates sources based on their distance from the Listener.- Specified by:
isDistanceAttenuatedin interfaceAudioFactory- Returns:
- true if distance attenuation used
-