Class DefaultAudioManager

All Implemented Interfaces:
PropertyChangeListener, VetoableChangeListener, EventListener, AudioManager, PropertyChangeFirer, PropertyChangeProvider, SilenceablePropertyChangeProvider, VetoableChangeFirer, VetoableChangeProvider, Manager<Audio>

Provide the concrete implementation for the Internal Audio Manager.
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.

  • Field Details

  • Constructor Details

  • Method Details

    • getXMLOrder

      public int getXMLOrder()
      Description copied from interface: Manager
      Determine the order that types should be written when storing panel files. Uses one of the constants defined in this class.

      Yes, that's an overly-centralized methodology, but it works for now.

      Returns:
      write order for this Manager; larger is later.
    • createNewAudio

      protected Audio createNewAudio(@Nonnull String systemName, String userName) throws AudioException
      Description copied from class: AbstractAudioManager
      Internal method to invoke the factory, after all the logic for returning an existing Audio has been invoked.
      Specified by:
      createNewAudio in class AbstractAudioManager
      Parameters:
      systemName - Audio object system name (for example IAS1, IAB4)
      userName - Audio object user name
      Returns:
      never null
      Throws:
      AudioException - if error occurs during creation
    • getNamedBeanSet

      @Nonnull public SortedSet<Audio> getNamedBeanSet(char subType)
      Get the specified Audio sub-type NamedBeans.
      Parameters:
      subType - sub-type to retrieve
      Returns:
      Unmodifiable access to a SortedSet of NamedBeans for the specified Audio sub-type .
    • init

      public void init()
      Initialise the manager and make connections.
    • isInitialised

      public boolean isInitialised()
      Determine if this AudioManager is initialised
      Returns:
      true if initialised
    • deregister

      public void deregister(@Nonnull Audio s)
      Description copied from class: AbstractManager
      Forget a NamedBean Object created outside the manager.

      The non-system-specific RouteManager uses this method.

      Specified by:
      deregister in interface Manager<Audio>
      Overrides:
      deregister in class AbstractManager<Audio>
      Parameters:
      s - the bean
    • cleanup

      public void cleanup()
      Description copied from interface: AudioManager
      Perform any clean-up operations
    • dispose

      public void dispose()
      Description copied from class: AbstractManager
      Free resources when no longer used. Specifically, remove all references to and from this object, so it can be garbage-collected.
      Specified by:
      dispose in interface Manager<Audio>
      Overrides:
      dispose in class AbstractManager<Audio>
    • getActiveAudioFactory

      Description copied from interface: AudioManager
      Returns the currently active AudioFactory object.

      An Audio factory is responsible for the creation of implementation specific audio objects.

      Returns:
      current active AudioFactory object