Audaspace 1.10.0
A high level audio library.
Loading...
Searching...
No Matches
DeviceManager Class Reference

This class manages all device plugins and maintains a device if asked to do so. More...

#include <DeviceManager.h>

Static Public Member Functions

static void registerDevice (const std::string &name, std::shared_ptr< IDeviceFactory > factory)
 Registers a device factory.
static std::shared_ptr< IDeviceFactorygetDeviceFactory (const std::string &name)
 Returns the factory for a specific device.
static std::shared_ptr< IDeviceFactorygetDefaultDeviceFactory ()
 Returns the default device based on the priorities of the registered factories.
static void setDevice (std::shared_ptr< IDevice > device)
 Sets a device that should be handled by the manager.
static void openDevice (const std::string &name)
 Opens a device which will then be handled by the manager.
static void openDefaultDevice ()
 Opens the default device which will then be handled by the manager.
static void releaseDevice ()
 Releases the currently handled device.
static std::shared_ptr< IDevicegetDevice ()
 Returns the currently handled device.
static std::shared_ptr< I3DDeviceget3DDevice ()
 Returns the currently handled 3D device.
static std::vector< std::string > getAvailableDeviceNames ()
 Returns a list of available devices.
static std::vector< std::string > getAvailableCaptureDeviceNames ()
 Returns a list of available capture devices.
static std::shared_ptr< ICaptureDeviceFactorygetCaptureDeviceFactory (const std::string &name)
 Returns the factory for a specific capture device.
static void registerCaptureDevice (const std::string &name, std::shared_ptr< ICaptureDeviceFactory > factory)
 Registers a capture device factory.
static std::shared_ptr< IReaderopenCaptureDevice (const std::string &name, Specs specs, int buffersize=AUD_DEFAULT_BUFFER_SIZE)
 Opens an input capture reader.

Detailed Description

This class manages all device plugins and maintains a device if asked to do so.

This enables applications to access their output device without having to carry it through the whole application.

Member Function Documentation

◆ get3DDevice()

std::shared_ptr< I3DDevice > DeviceManager::get3DDevice ( )
static

Returns the currently handled 3D device.

Returns
The handled device or nullptr if no device has been registered or the registered device is not an I3DDevice.

◆ getAvailableCaptureDeviceNames()

std::vector< std::string > DeviceManager::getAvailableCaptureDeviceNames ( )
static

Returns a list of available capture devices.

Returns
A list of strings with the names of available capture devices.

◆ getAvailableDeviceNames()

std::vector< std::string > DeviceManager::getAvailableDeviceNames ( )
static

Returns a list of available devices.

Returns
A list of strings with the names of available devices.

◆ getCaptureDeviceFactory()

std::shared_ptr< ICaptureDeviceFactory > DeviceManager::getCaptureDeviceFactory ( const std::string & name)
static

Returns the factory for a specific capture device.

Parameters
nameThe representative name of the capture device.
Returns
The factory if it was found, or nullptr otherwise.

◆ getDefaultDeviceFactory()

std::shared_ptr< IDeviceFactory > DeviceManager::getDefaultDeviceFactory ( )
static

Returns the default device based on the priorities of the registered factories.

Returns
The default device or nullptr if no factory has been registered.

◆ getDevice()

std::shared_ptr< IDevice > DeviceManager::getDevice ( )
static

Returns the currently handled device.

Returns
The handled device or nullptr if no device has been registered.

◆ getDeviceFactory()

std::shared_ptr< IDeviceFactory > DeviceManager::getDeviceFactory ( const std::string & name)
static

Returns the factory for a specific device.

Parameters
nameThe representative name of the device.
Returns
The factory if it was found, or nullptr otherwise.

◆ openCaptureDevice()

std::shared_ptr< IReader > DeviceManager::openCaptureDevice ( const std::string & name,
Specs specs,
int buffersize = AUD_DEFAULT_BUFFER_SIZE )
static

Opens an input capture reader.

Parameters
nameThe capture device name.
specsThe desired specification.
buffersizeThe capture buffer size in samples.

◆ openDefaultDevice()

void DeviceManager::openDefaultDevice ( )
static

Opens the default device which will then be handled by the manager.

The device to open is selected based on the priority of the registered factories. If a device is currently being handled it will be released.

◆ openDevice()

void DeviceManager::openDevice ( const std::string & name)
static

Opens a device which will then be handled by the manager.

If a device is currently being handled it will be released.

Parameters
nameThe representative name of the device.

◆ registerCaptureDevice()

void DeviceManager::registerCaptureDevice ( const std::string & name,
std::shared_ptr< ICaptureDeviceFactory > factory )
static

Registers a capture device factory.

Parameters
nameA representative name for the capture device.
factoryThe factory that creates the capture reader.

◆ registerDevice()

void DeviceManager::registerDevice ( const std::string & name,
std::shared_ptr< IDeviceFactory > factory )
static

Registers a device factory.

This method is mostly used by plugin developers to add their device implementation for general use by the library end users.

Parameters
nameA representative name for the device.
factoryThe factory that creates the device.

◆ setDevice()

void DeviceManager::setDevice ( std::shared_ptr< IDevice > device)
static

Sets a device that should be handled by the manager.

If a device is currently being handled it will be released.

Parameters
deviceThe device the manager should take care of.

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