Async 1.8.0
Async::AudioDeviceFactory Class Reference

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.
 
AudioDevicecreate (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 AudioDeviceFactoryinstance (void)
 Get the factory singleton instance.
 

Protected Member Functions

 AudioDeviceFactory (void)
 Default constuctor.
 

Detailed Description

A factory class for audio devices.

Author
Tobias Blomberg / SM0SVX
Date
2009-12-26

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.

Member Typedef Documentation

◆ CreatorFunc

AudioDevice *(*) Async::AudioDeviceFactory::CreatorFunc(const std::string &dev_designator)

Definition at line 131 of file AsyncAudioDeviceFactory.h.

Constructor & Destructor Documentation

◆ ~AudioDeviceFactory()

Async::AudioDeviceFactory::~AudioDeviceFactory ( void )

Destructor.

◆ AudioDeviceFactory()

Async::AudioDeviceFactory::AudioDeviceFactory ( void )
protected

Default constuctor.

Member Function Documentation

◆ create()

AudioDevice * Async::AudioDeviceFactory::create ( const std::string & name,
const std::string & dev_name )

Create a new instance of the specified audio device type.

Parameters
nameThe audio device type (e.g. alsa, oss etc)
dev_nameThe audio device name (e.g. plughw:0, /dev/dsp etc)
Returns
Returns an AudioDevice object

◆ instance()

static AudioDeviceFactory & Async::AudioDeviceFactory::instance ( void )
inlinestatic

Get the factory singleton instance.

Returns
Returns the factory instance

Definition at line 137 of file AsyncAudioDeviceFactory.h.

◆ registerCreator()

bool Async::AudioDeviceFactory::registerCreator ( const std::string & name,
CreatorFunc creator )

Register a new audio device type.

Parameters
nameThe name of the audio device type (e.g. alsa, oss etc)
creatorA function that create the AudioDevice object
Returns
Return true on success or else false

◆ validDevTypes()

std::string Async::AudioDeviceFactory::validDevTypes ( void ) const

List valid device types.

Returns
Returns a space separated list of valid device type names

The documentation for this class was generated from the following file: