001package jmri.jmrit.audio; 002 003import java.beans.*; 004import java.util.SortedSet; 005 006import jmri.*; 007 008/** 009 * The default AudioSourceManager. 010 * @author Daniel Bergqvist (C) 2023 011 */ 012public class DefaultAudioSourceManager implements AudioSourceManager { 013 014 private final AudioManager manager = 015 InstanceManager.getDefault(AudioManager.class); 016 017 018 /** {@inheritDoc} */ 019 @Override 020 public Audio provideAudio(String name) throws AudioException { 021 return manager.provideAudio(name); 022 } 023 024 /** {@inheritDoc} */ 025 @Override 026 public Audio getAudio(String name) { 027 return manager.getAudio(name); 028 } 029 030 /** {@inheritDoc} */ 031 @Override 032 public Audio getBySystemName(String systemName) { 033 return manager.getBySystemName(systemName); 034 } 035 036 /** {@inheritDoc} */ 037 @Override 038 public Audio getByUserName(String userName) { 039 return manager.getByUserName(userName); 040 } 041 042 /** {@inheritDoc} */ 043 @Override 044 public Audio newAudio(String systemName, String userName) throws AudioException { 045 return manager.newAudio(systemName, userName); 046 } 047 048 /** {@inheritDoc} */ 049 @Override 050 public AudioFactory getActiveAudioFactory() { 051 return manager.getActiveAudioFactory(); 052 } 053 054 /** {@inheritDoc} */ 055 @Override 056 public SortedSet<Audio> getNamedBeanSet(char subType) { 057 return manager.getNamedBeanSet(subType); 058 } 059 060 /** {@inheritDoc} */ 061 @Override 062 public void init() { 063 manager.init(); 064 } 065 066 /** {@inheritDoc} */ 067 @Override 068 public void cleanup() { 069 manager.cleanup(); 070 } 071 072 /** {@inheritDoc} */ 073 @Override 074 public boolean isInitialised() { 075 return manager.isInitialised(); 076 } 077 078 /** {@inheritDoc} */ 079 @Override 080 public SystemConnectionMemo getMemo() { 081 return manager.getMemo(); 082 } 083 084 /** {@inheritDoc} */ 085 @Override 086 public String getSystemPrefix() { 087 return manager.getSystemPrefix(); 088 } 089 090 /** {@inheritDoc} */ 091 @Override 092 public char typeLetter() { 093 return manager.typeLetter(); 094 } 095 096 /** {@inheritDoc} */ 097 @Override 098 public Class<Audio> getNamedBeanClass() { 099 return manager.getNamedBeanClass(); 100 } 101 102 /** {@inheritDoc} */ 103 @Override 104 public void dispose() { 105 manager.dispose(); 106 } 107 108 /** {@inheritDoc} */ 109 @Override 110 public int getObjectCount() { 111 return manager.getNamedBeanSet(Audio.SOURCE).size(); 112// return manager.getObjectCount(); 113 } 114 115 /** 116 * {@inheritDoc} 117 * <P> 118 * Note that this method only returns audio sources. 119 */ 120 @Override 121 public SortedSet<Audio> getNamedBeanSet() { 122 return manager.getNamedBeanSet(Audio.SOURCE); 123 } 124 125 /** {@inheritDoc} */ 126 @Override 127 public Audio getNamedBean(String name) { 128 return manager.getNamedBean(name); 129 } 130 131 /** {@inheritDoc} */ 132 @Override 133 public void deleteBean(Audio n, String property) throws PropertyVetoException { 134 manager.deleteBean(n, property); 135 } 136 137 /** {@inheritDoc} */ 138 @Override 139 public void register(Audio n) { 140 manager.register(n); 141 } 142 143 /** {@inheritDoc} */ 144 @Override 145 public void deregister(Audio n) { 146 manager.deregister(n); 147 } 148 149 /** {@inheritDoc} */ 150 @Override 151 public int getXMLOrder() { 152 return manager.getXMLOrder(); 153 } 154 155 /** {@inheritDoc} */ 156 @Override 157 public String getBeanTypeHandled(boolean plural) { 158 return manager.getBeanTypeHandled(plural); 159 } 160 161 /** {@inheritDoc} */ 162 @Override 163 public void addDataListener(ManagerDataListener<Audio> e) { 164 manager.addDataListener(e); 165 } 166 167 /** {@inheritDoc} */ 168 @Override 169 public void removeDataListener(ManagerDataListener<Audio> e) { 170 manager.removeDataListener(e); 171 } 172 173 /** {@inheritDoc} */ 174 @Override 175 public void setPropertyChangesSilenced(String propertyName, boolean silenced) { 176 manager.setPropertyChangesSilenced(propertyName, silenced); 177 } 178 179 /** {@inheritDoc} */ 180 @Override 181 public void addPropertyChangeListener(PropertyChangeListener listener) { 182 manager.addPropertyChangeListener(listener); 183 } 184 185 /** {@inheritDoc} */ 186 @Override 187 public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { 188 manager.addPropertyChangeListener(propertyName, listener); 189 } 190 191 /** {@inheritDoc} */ 192 @Override 193 public PropertyChangeListener[] getPropertyChangeListeners() { 194 return manager.getPropertyChangeListeners(); 195 } 196 197 /** {@inheritDoc} */ 198 @Override 199 public PropertyChangeListener[] getPropertyChangeListeners(String propertyName) { 200 return manager.getPropertyChangeListeners(propertyName); 201 } 202 203 /** {@inheritDoc} */ 204 @Override 205 public void removePropertyChangeListener(PropertyChangeListener listener) { 206 manager.removePropertyChangeListener(listener); 207 } 208 209 /** {@inheritDoc} */ 210 @Override 211 public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { 212 manager.removePropertyChangeListener(propertyName, listener); 213 } 214 215 /** {@inheritDoc} */ 216 @Override 217 public void addVetoableChangeListener(VetoableChangeListener listener) { 218 manager.addVetoableChangeListener(listener); 219 } 220 221 /** {@inheritDoc} */ 222 @Override 223 public void addVetoableChangeListener(String propertyName, VetoableChangeListener listener) { 224 manager.addVetoableChangeListener(propertyName, listener); 225 } 226 227 /** {@inheritDoc} */ 228 @Override 229 public VetoableChangeListener[] getVetoableChangeListeners() { 230 return manager.getVetoableChangeListeners(); 231 } 232 233 /** {@inheritDoc} */ 234 @Override 235 public VetoableChangeListener[] getVetoableChangeListeners(String propertyName) { 236 return manager.getVetoableChangeListeners(propertyName); 237 } 238 239 /** {@inheritDoc} */ 240 @Override 241 public void removeVetoableChangeListener(VetoableChangeListener listener) { 242 manager.removeVetoableChangeListener(listener); 243 } 244 245 /** {@inheritDoc} */ 246 @Override 247 public void removeVetoableChangeListener(String propertyName, VetoableChangeListener listener) { 248 manager.removeVetoableChangeListener(propertyName, listener); 249 } 250 251}