jmri.jmrit.audio
Class AbstractAudioBuffer

Show UML class diagram
java.lang.Object
  extended by jmri.implementation.AbstractNamedBean
      extended by jmri.implementation.AbstractAudio
          extended by jmri.jmrit.audio.AbstractAudioBuffer
All Implemented Interfaces:
Serializable, Audio, AudioBuffer, NamedBean
Direct Known Subclasses:
JavaSoundAudioBuffer, JoalAudioBuffer, NullAudioBuffer

public abstract class AbstractAudioBuffer
extends AbstractAudio
implements AudioBuffer

Base implementation of the AudioBuffer class.

Specific implementations will extend this base class.


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.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface jmri.jmrit.audio.AudioBuffer
FORMAT_16BIT_5DOT1, FORMAT_16BIT_6DOT1, FORMAT_16BIT_7DOT1, FORMAT_16BIT_MONO, FORMAT_16BIT_QUAD, FORMAT_16BIT_STEREO, FORMAT_8BIT_5DOT1, FORMAT_8BIT_6DOT1, FORMAT_8BIT_7DOT1, FORMAT_8BIT_MONO, FORMAT_8BIT_QUAD, FORMAT_8BIT_STEREO, FORMAT_UNKNOWN
 
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
AbstractAudioBuffer(String systemName)
          Abstract constructor for new AudioBuffer with system name
AbstractAudioBuffer(String systemName, String userName)
          Abstract constructor for new AudioBuffer with system name and user name
 
Method Summary
 long getEndLoopPoint()
          Retrieves the end loop point of the sound sample stored in this buffer Applies only to sub-types: Buffer
 long getStartLoopPoint()
          Retrieves the start loop point of the sound sample stored in this buffer Applies only to sub-types: Buffer
 char getSubType()
          An Audio object can represent one of a number of subtypes of object.
 String getURL()
          Return the url of the sound sample Applies only to sub-types: Buffer
 void setEndLoopPoint(long endLoopPoint)
          Sets the end loop point of the sound sample stored in this buffer Applies only to sub-types: Buffer
 void setStartLoopPoint(long startLoopPoint)
          Sets the start loop point of the sound sample stored in this buffer Applies only to sub-types: Buffer
 void setURL(String url)
          Sets the url of the sound sample Applies only to sub-types: Buffer
 void stateChanged(int oldState)
          Method used to update the current state of the Audio object
 
Methods inherited from class jmri.implementation.AbstractAudio
getState, roundDecimal, roundDecimal, setState, toString
 
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, dispose, getComment, getDisplayName, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyKeys, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setUserName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jmri.jmrit.audio.AudioBuffer
getFormat
 
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, dispose, getComment, getDisplayName, getNumPropertyChangeListeners, getProperty, getPropertyKeys, getState, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setState, setUserName
 

Constructor Detail

AbstractAudioBuffer

public AbstractAudioBuffer(String systemName)
Abstract constructor for new AudioBuffer with system name

Parameters:
systemName - AudioBuffer object system name (e.g. IAB4)

AbstractAudioBuffer

public AbstractAudioBuffer(String systemName,
                           String userName)
Abstract constructor for new AudioBuffer with system name and user name

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

getSubType

public char getSubType()
Description copied from interface: Audio
An Audio object can represent one of a number of subtypes of object.

This method enables us to determine which of those subtypes this particular instance is and be able to process accordingly.

Current supported subtypes are:

Specified by:
getSubType in interface Audio
Returns:
subType char

getURL

public String getURL()
Description copied from interface: AudioBuffer
Return the url of the sound sample

Applies only to sub-types:

Specified by:
getURL in interface AudioBuffer
Returns:
url

setURL

public void setURL(String url)
Description copied from interface: AudioBuffer
Sets the url of the sound sample

Applies only to sub-types:

Specified by:
setURL in interface AudioBuffer

setStartLoopPoint

public void setStartLoopPoint(long startLoopPoint)
Description copied from interface: AudioBuffer
Sets the start loop point of the sound sample stored in this buffer

Applies only to sub-types:

Specified by:
setStartLoopPoint in interface AudioBuffer
Parameters:
startLoopPoint - position of start loop point in samples

getStartLoopPoint

public long getStartLoopPoint()
Description copied from interface: AudioBuffer
Retrieves the start loop point of the sound sample stored in this buffer

Applies only to sub-types:

Specified by:
getStartLoopPoint in interface AudioBuffer
Returns:
position of start loop point in samples

setEndLoopPoint

public void setEndLoopPoint(long endLoopPoint)
Description copied from interface: AudioBuffer
Sets the end loop point of the sound sample stored in this buffer

Applies only to sub-types:

Specified by:
setEndLoopPoint in interface AudioBuffer
Parameters:
endLoopPoint - position of end loop point in samples

getEndLoopPoint

public long getEndLoopPoint()
Description copied from interface: AudioBuffer
Retrieves the end loop point of the sound sample stored in this buffer

Applies only to sub-types:

Specified by:
getEndLoopPoint in interface AudioBuffer
Returns:
position of end loop point in samples

stateChanged

public void stateChanged(int oldState)
Description copied from interface: Audio
Method used to update the current state of the Audio object

Specified by:
stateChanged in interface Audio


Copyright © 1997 - 2010 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