Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
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.
 

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()

static 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.

◆ getAvailableDeviceNames()

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

Returns a list of available devices.

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

◆ getDefaultDeviceFactory()

static 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()

static 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()

static 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.

◆ openDefaultDevice()

static 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()

static 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.

◆ registerDevice()

static 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()

static 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: