Class AbstractAudioFactory

  • All Implemented Interfaces:
    AudioFactory
    Direct Known Subclasses:
    JavaSoundAudioFactory, JoalAudioFactory, NullAudioFactory

    public abstract class AbstractAudioFactory
    extends java.lang.Object
    implements AudioFactory
    Abstract implementation of the AudioFactory class.

    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.

    • Method Detail

      • init

        public boolean init()
        Description copied from interface: AudioFactory
        Perform any implementation specific initialisation routines.
        Specified by:
        init in interface AudioFactory
        Returns:
        true, if initialisation successful
      • audioCommandQueue

        public boolean audioCommandQueue​(AudioCommand queueAudioCommand)
        Description copied from interface: AudioFactory
        Queues a new AudioCommand for subsequent execution.

        If newAudioCommand is null the current queue is executed and cleaned.

        Specified by:
        audioCommandQueue in interface AudioFactory
        Parameters:
        queueAudioCommand - AudioCommand to queue or null to execute queue
        Returns:
        true, if further commands exist; false, if empty
      • setDistanceAttenuated

        public void setDistanceAttenuated​(boolean attenuated)
        Description copied from interface: AudioFactory
        Set if this AudioFactory should attenuate sources based on their distance from the listener.

        Default = true

        Specified by:
        setDistanceAttenuated in interface AudioFactory
        Parameters:
        attenuated - true if distance attenuation to be used