|
Async 1.7.0
|
A factory class for audio devices. More...
#include <AsyncAudioDeviceFactory.h>
Public Types | |
| typedef AudioDevice *(* | CreatorFunc) (const std::string &dev_designator) |
Public Member Functions | |
| ~AudioDeviceFactory (void) | |
| Destructor. | |
| bool | registerCreator (const std::string &name, CreatorFunc creator) |
| Register a new audio device type. | |
| AudioDevice * | create (const std::string &name, const std::string &dev_name) |
| Create a new instance of the specified audio device type. | |
| std::string | validDevTypes (void) const |
| List valid device types. | |
Static Public Member Functions | |
| static AudioDeviceFactory & | instance (void) |
| Get the factory singleton instance. | |
Protected Member Functions | |
| AudioDeviceFactory (void) | |
| Default constuctor. | |
A factory class for audio devices.
This class is a factory class for creating audio devices. Use the REGISTER_AUDIO_DEVICE_TYPE macro to register a new audio device type. New audio device instances are created using the create method.
Definition at line 128 of file AsyncAudioDeviceFactory.h.
| typedef AudioDevice *(* Async::AudioDeviceFactory::CreatorFunc) (const std::string &dev_designator) |
Definition at line 131 of file AsyncAudioDeviceFactory.h.
| Async::AudioDeviceFactory::~AudioDeviceFactory | ( | void | ) |
Destructor.
|
protected |
Default constuctor.
References AudioDeviceFactory().
Referenced by AudioDeviceFactory(), and instance().
| AudioDevice * Async::AudioDeviceFactory::create | ( | const std::string & | name, |
| const std::string & | dev_name ) |
Create a new instance of the specified audio device type.
| name | The audio device type (e.g. alsa, oss etc) |
| dev_name | The audio device name (e.g. plughw:0, /dev/dsp etc) |
|
inlinestatic |
Get the factory singleton instance.
Definition at line 137 of file AsyncAudioDeviceFactory.h.
References AudioDeviceFactory().
| bool Async::AudioDeviceFactory::registerCreator | ( | const std::string & | name, |
| CreatorFunc | creator ) |
Register a new audio device type.
| name | The name of the audio device type (e.g. alsa, oss etc) |
| creator | A function that create the AudioDevice object |
| std::string Async::AudioDeviceFactory::validDevTypes | ( | void | ) | const |
List valid device types.