Interface Audio
- All Superinterfaces:
Comparable<NamedBean>,NamedBean,PropertyChangeProvider
- All Known Subinterfaces:
AudioBuffer,AudioListener,AudioSource
- All Known Implementing Classes:
AbstractAudio,AbstractAudioBuffer,AbstractAudioListener,AbstractAudioSource,JavaSoundAudioBuffer,JavaSoundAudioListener,JavaSoundAudioSource,JoalAudioBuffer,JoalAudioListener,JoalAudioSource,NullAudioBuffer,NullAudioListener,NullAudioSource
The AbstractAudio class contains a basic implementation of the state and messaging code, and forms a useful start for a system-specific implementation. Specific implementations will convert to and from the hardware commands.
The states and names are Java Bean parameters, so that listeners can be registered to be notified of any changes.
Each Audio object has a two names. The "user" name is entirely free form, and
can be used for any purpose. The "system" name is provided by the
system-specific implementations, and provides a unique mapping to the layout
control system and address within that system.
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefinition of Audio object orientation at vector codestatic final charDefinition of AudioBuffer NamedBean sub-type codestatic final intCommand to bind Buffer to Sourcestatic final intCommand to fade in and start playback of this Sourcestatic final intCommand to fade out and stop playback of this Sourcestatic final intCommand to initialise AudioFactorystatic final intCommand to load the soundstatic final intCommand to pause playback of this Source and retain the positionstatic final intCommand to pause or resume this Source from the current positionstatic final intCommand to play this Source from the beginningstatic final intCommand to start or stop this Source from the beginningstatic final intCommand to queue Buffer to Sourcestatic final intCommand to reset the position of this Sourcestatic final intCommand to resume playback of this Source from the current positionstatic final intCommand to rewind this Source to the beginningstatic final intCommand to stop playing this Source and rewind to the startstatic final intCommand to unqueue used Buffers from Sourcestatic final doubleNumber of decimal places for float values to be stored instatic final intFade state of Source when fading instatic final intFade state of Source when not fadingstatic final intFade state of Source when fading outstatic final charDefinition of AudioListener NamedBean sub-type codestatic final floatMaximum distance for Audio objectsstatic final charDefinition of AudioSource NamedBean sub-type codestatic final intState code for an AudioBuffer when emptystatic final intDefault state for any newly created Audio objectstatic final intState code for an AudioBuffer when loadedstatic final intState code for an AudioListener when movingstatic final intState code for an AudioSource when playingstatic final intState code for an AudioListener when positionedstatic final intState code for an AudioSource when stoppedstatic final intDefinition of Audio object orientation up vector codeFields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWN -
Method Summary
Modifier and TypeMethodDescriptioncharAn Audio object can represent one of a number of subtypes of object.voidstateChanged(int oldState) Method used to update the current state of the Audio objectMethods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getBeanType, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getState, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setState, setUserName, toString, updateListenerRef, vetoableChangeMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
SOURCE
Definition of AudioSource NamedBean sub-type code- See Also:
-
BUFFER
Definition of AudioBuffer NamedBean sub-type code- See Also:
-
LISTENER
Definition of AudioListener NamedBean sub-type code- See Also:
-
AT
Definition of Audio object orientation at vector code- See Also:
-
UP
Definition of Audio object orientation up vector code- See Also:
-
STATE_INITIAL
Default state for any newly created Audio object- See Also:
-
STATE_STOPPED
State code for an AudioSource when stopped- See Also:
-
STATE_PLAYING
State code for an AudioSource when playing- See Also:
-
STATE_EMPTY
State code for an AudioBuffer when empty- See Also:
-
STATE_LOADED
State code for an AudioBuffer when loaded- See Also:
-
STATE_POSITIONED
State code for an AudioListener when positioned- See Also:
-
STATE_MOVING
State code for an AudioListener when moving- See Also:
-
CMD_INIT_FACTORY
Command to initialise AudioFactory- See Also:
-
CMD_LOAD_SOUND
Command to load the sound- See Also:
-
CMD_BIND_BUFFER
Command to bind Buffer to Source- See Also:
-
CMD_QUEUE_BUFFERS
Command to queue Buffer to Source- See Also:
-
CMD_UNQUEUE_BUFFERS
Command to unqueue used Buffers from Source- See Also:
-
CMD_PLAY
Command to play this Source from the beginning- See Also:
-
CMD_STOP
Command to stop playing this Source and rewind to the start- See Also:
-
CMD_PLAY_TOGGLE
Command to start or stop this Source from the beginning- See Also:
-
CMD_PAUSE
Command to pause playback of this Source and retain the position- See Also:
-
CMD_RESUME
Command to resume playback of this Source from the current position- See Also:
-
CMD_PAUSE_TOGGLE
Command to pause or resume this Source from the current position- See Also:
-
CMD_REWIND
Command to rewind this Source to the beginning- See Also:
-
CMD_FADE_IN
Command to fade in and start playback of this Source- See Also:
-
CMD_FADE_OUT
Command to fade out and stop playback of this Source- See Also:
-
CMD_RESET_POSITION
Command to reset the position of this Source- See Also:
-
FADE_NONE
Fade state of Source when not fading- See Also:
-
FADE_OUT
Fade state of Source when fading out- See Also:
-
FADE_IN
Fade state of Source when fading in- See Also:
-
MAX_DISTANCE
Maximum distance for Audio objects- See Also:
-
DECIMAL_PLACES
Number of decimal places for float values to be stored in- See Also:
-
-
Method Details
-
getSubType
char getSubType()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:
- B = Buffer
- L = Listener
- S = Source
- Returns:
- subType char
-
stateChanged
Method used to update the current state of the Audio object- Parameters:
oldState- the former state
-