jmri.jmrit.audio
Class NullAudioSource

java.lang.Object
  extended by jmri.implementation.AbstractNamedBean
      extended by jmri.implementation.AbstractAudio
          extended by jmri.jmrit.audio.AbstractAudioSource
              extended by jmri.jmrit.audio.NullAudioSource
All Implemented Interfaces:
Serializable, Audio, AudioSource, NamedBean

public class NullAudioSource
extends AbstractAudioSource

Null audio system implementation of the Audio Source sub-class.

For now, no system-specific implementations are forseen - this will remain internal-only


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
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jmri.jmrit.audio.AbstractAudioSource
AbstractAudioSource.AudioSourceFadeThread, AbstractAudioSource.AudioSourceMoveThread
 
Field Summary
 
Fields inherited from class jmri.implementation.AbstractNamedBean
mSystemName, mUserName
 
Fields inherited from interface jmri.jmrit.audio.AudioSource
LOOP_CONTINUOUS, LOOP_NONE
 
Fields inherited from interface jmri.Audio
AT, BUFFER, CMD_BIND_BUFFER, CMD_FADE_IN, CMD_FADE_OUT, CMD_INIT_FACTORY, CMD_LOAD_SOUND, CMD_PAUSE, CMD_PAUSE_TOGGLE, CMD_PLAY, CMD_PLAY_TOGGLE, CMD_RESET_POSITION, CMD_RESUME, CMD_REWIND, CMD_STOP, DECIMAL_PLACES, FADE_IN, FADE_NONE, FADE_OUT, LISTENER, MAX_DISTANCE, SOURCE, STATE_EMPTY, STATE_INITIAL, STATE_LOADED, STATE_MOVING, STATE_PLAYING, STATE_POSITIONED, STATE_STOPPED, UP
 
Fields inherited from interface jmri.NamedBean
INCONSISTENT, UNKNOWN
 
Constructor Summary
NullAudioSource(String systemName)
          Constructor for new NullAudioSource with system name
NullAudioSource(String systemName, String userName)
          Constructor for new NullAudioSource with system name and user name
 
Method Summary
protected  void calculateGain()
          Method to calculate the gain of this AudioSource based on distance from listener and fade levels
protected  void changePosition(Vector3f pos)
          Method to change the current position of this source
protected  void cleanUp()
          Abstract method that concrete classes will implement to perform necessary cleanup routines.
protected  void doFadeIn()
          Fade in then play this AudioSource
protected  void doFadeOut()
          Fade out then stop this AudioSource
protected  void doPause()
          Stop playing the clip but retain the current position
protected  void doPlay()
          Play the clip from the beginning.
protected  void doResume()
          Play the clip from the current position
protected  void doRewind()
          Rewind clip to the beginning
protected  void doStop()
          Stop playing the clip and rewind to the beginning
 
Methods inherited from class jmri.jmrit.audio.AbstractAudioSource
calculateCurrentPosition, calculateFades, calculateLoops, doResetCurrentPosition, doTogglePause, doTogglePlay, fadeIn, fadeOut, getAssignedBuffer, getAssignedBufferName, getCurrentPosition, getDopplerFactor, getFadeGain, getFadeIn, getFadeOut, getFading, getGain, getMaximumDistance, getMaxLoops, getMinLoops, getNumLoops, getPitch, getPosition, getReferenceDistance, getRollOffFactor, getSubType, getVelocity, isBound, isLooped, isPositionRelative, pause, play, resetCurrentPosition, resume, rewind, setAssignedBuffer, setAssignedBuffer, setBound, setDopplerFactor, setFadeIn, setFadeOut, setGain, setLooped, setMaximumDistance, setMaxLoops, setMinLoops, setPitch, setPosition, setPosition, setPosition, setPositionRelative, setReferenceDistance, setRollOffFactor, setVelocity, stateChanged, stop, togglePause, togglePlay, toString
 
Methods inherited from class jmri.implementation.AbstractAudio
getState, roundDecimal, roundDecimal, setState
 
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, getComment, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyKeys, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setUserName, updateListenerRef
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, dispose, getComment, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyKeys, getState, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setState, setUserName, updateListenerRef
 

Constructor Detail

NullAudioSource

public NullAudioSource(String systemName)
Constructor for new NullAudioSource with system name

Parameters:
systemName - AudioSource object system name (e.g. IAS1)

NullAudioSource

public NullAudioSource(String systemName,
                       String userName)
Constructor for new NullAudioSource with system name and user name

Parameters:
systemName - AudioSource object system name (e.g. IAS1)
userName - AudioSource object user name
Method Detail

changePosition

protected void changePosition(Vector3f pos)
Description copied from class: AbstractAudioSource
Method to change the current position of this source

Specified by:
changePosition in class AbstractAudioSource
Parameters:
pos - new position

doPlay

protected void doPlay()
Description copied from class: AbstractAudioSource
Play the clip from the beginning. If looped, start looping

Specified by:
doPlay in class AbstractAudioSource

doStop

protected void doStop()
Description copied from class: AbstractAudioSource
Stop playing the clip and rewind to the beginning

Specified by:
doStop in class AbstractAudioSource

doPause

protected void doPause()
Description copied from class: AbstractAudioSource
Stop playing the clip but retain the current position

Specified by:
doPause in class AbstractAudioSource

doResume

protected void doResume()
Description copied from class: AbstractAudioSource
Play the clip from the current position

Specified by:
doResume in class AbstractAudioSource

doRewind

protected void doRewind()
Description copied from class: AbstractAudioSource
Rewind clip to the beginning

Specified by:
doRewind in class AbstractAudioSource

doFadeIn

protected void doFadeIn()
Description copied from class: AbstractAudioSource
Fade in then play this AudioSource

Specified by:
doFadeIn in class AbstractAudioSource

doFadeOut

protected void doFadeOut()
Description copied from class: AbstractAudioSource
Fade out then stop this AudioSource

Specified by:
doFadeOut in class AbstractAudioSource

cleanUp

protected void cleanUp()
Description copied from class: AbstractAudio
Abstract method that concrete classes will implement to perform necessary cleanup routines.

Specified by:
cleanUp in class AbstractAudio

calculateGain

protected void calculateGain()
Description copied from class: AbstractAudioSource
Method to calculate the gain of this AudioSource based on distance from listener and fade levels

Specified by:
calculateGain in class AbstractAudioSource


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