|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AudioManager
Locate an Audio object representing some specific audio information.
Audo objects are obtained from an AudioManager, which in turn is generally located from the InstanceManager. A typical call sequence might be:
Audio audio = InstanceManager.audioManagerInstance().provideAudio("myAudio");
Each Audio has 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, if any, and provides a unique mapping to the layout control system (e.g. LocoNet, NCE, etc) and address within that system. Note that most (all?) layout systems don't have anything corresponding to this, in which case the "Internal" Audio objects are still available with names like IAS23.
Much of the book-keeping is implemented in the AbstractAudioManager class, which can form the basis for a system-specific implementation.
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.
| Field Summary | |
|---|---|
static int |
MAX_BUFFERS
Define the maximum number of AudioBuffer objects that can be created |
static int |
MAX_LISTENERS
Define the maximum number of AudioListener objects that can be created |
static int |
MAX_SOURCES
Define the maximum number of AudioSource objects that can be created |
| Method Summary | |
|---|---|
void |
cleanUp()
Perform any clean-up operations |
AudioFactory |
getActiveAudioFactory()
Returns the currently active AudioFactory object. |
Audio |
getAudio(String name)
Locate via user name, then system name if needed. |
Audio |
getBySystemName(String systemName)
Locate an instance based on a system name. |
Audio |
getByUserName(String userName)
Locate an instance based on a user name. |
List<String> |
getSystemNameList()
Get a list of all Audio objects' system names. |
List<String> |
getSystemNameList(int subType)
Get a list of specified Audio sub-type objects' system names. |
void |
init()
Perform any initialisation operations |
Audio |
newAudio(String systemName,
String userName)
Return an instance with the specified system and user names. |
Audio |
provideAudio(String name)
Locate via user name, then system name if needed. |
| Methods inherited from interface jmri.Manager |
|---|
addPropertyChangeListener, deregister, dispose, getSystemNameArray, makeSystemName, register, removePropertyChangeListener, systemLetter, typeLetter |
| Field Detail |
|---|
static final int MAX_LISTENERS
static final int MAX_SOURCES
static final int MAX_BUFFERS
| Method Detail |
|---|
Audio provideAudio(String name)
throws AudioException
name -
AudioException - if error occurs during creationAudio getAudio(String name)
name -
Audio getBySystemName(String systemName)
systemName - Audio object system name (e.g. IAS1, IAB4)
Audio getByUserName(String userName)
userName - Audio object user name
Audio newAudio(String systemName,
String userName)
throws AudioException
This will always return a valid object reference; a new object will be created if necessary. In that case:
systemName - Audio object system name (e.g. IAS1, IAB4)userName - Audio object user name
AudioException - if error occurs during creationAudioFactory getActiveAudioFactory()
An Audio factory is responsible for the creation of implementation specific audio objects.
List<String> getSystemNameList()
getSystemNameList in interface ManagerList<String> getSystemNameList(int subType)
subType - sub-type to retrieve
void init()
void cleanUp()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||