An AudioDeviceFactory class is responsible for creating a specific AudioDevice implementation. A factory implementation can be as simple or complex as desired and may support just one implementation or may return several implementations depending upon the execution environment.

When implementing a factory that provides an AudioDevice that uses class that may not be present, the factory should dynamically link to any specific implementation classes required to instantiate or test the audio implementation. This is so that the application as a whole can run without these classes being present. The audio device implementation, however, will usually statically link to the classes required. (See the JavaSound deivce and factory for an example of this.)

Пример #1
0
 /// <summary> Registers an <code>AudioDeviceFactory</code> instance
 /// with this registry.
 /// </summary>
 public virtual void  addFactory(AudioDeviceFactory factory)
 {
     SupportClass.PutElement(factories, factory.GetType(), factory);
 }
Пример #2
0
 public virtual void removeFactory(AudioDeviceFactory factory)
 {
     SupportClass.HashtableRemove(factories, factory.GetType());
 }
Пример #3
0
 public virtual void  removeFactory(AudioDeviceFactory factory)
 {
     SupportClass.HashtableRemove(factories, factory.GetType());
 }
Пример #4
0
 /// <summary> Registers an <code>AudioDeviceFactory</code> instance
 /// with this registry. 
 /// </summary>
 public virtual void addFactory(AudioDeviceFactory factory)
 {
     SupportClass.PutElement(factories, factory.GetType(), factory);
 }