|
Async
1.5.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. More... | |
| bool | registerCreator (const std::string &name, CreatorFunc creator) |
| Register a new audio device type. More... | |
| AudioDevice * | create (const std::string &name, const std::string &dev_name) |
| Create a new instance of the specified audio device type. More... | |
| std::string | validDevTypes (void) const |
| List valid device types. More... | |
Static Public Member Functions | |
| static AudioDeviceFactory & | instance (void) |
| Get the factory singleton instance. More... | |
Protected Member Functions | |
| AudioDeviceFactory (void) | |
| Default constuctor. More... | |
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.
| 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.
| 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.