Audacity  2.2.0
DeviceManager Class Referencefinal

A singleton that manages the audio devices known to Audacity. More...

#include <DeviceManager.h>

Public Member Functions

void Rescan ()
DeviceSourceMapGetDefaultOutputDevice (int hostIndex)
DeviceSourceMapGetDefaultInputDevice (int hostIndex)
const std::vector
< DeviceSourceMap > & 
GetInputDeviceMaps ()
const std::vector
< DeviceSourceMap > & 
GetOutputDeviceMaps ()

Static Public Member Functions

static DeviceManagerInstance ()
 Gets the singleton instance. More...

Protected Member Functions

 DeviceManager ()
 ~DeviceManager ()
void Init ()
DeviceSourceMapGetDefaultDevice (int hostIndex, int isInput)

Protected Attributes

bool m_inited
std::vector< DeviceSourceMapmInputDeviceSourceMaps
std::vector< DeviceSourceMapmOutputDeviceSourceMaps

Static Protected Attributes

static DeviceManager dm

Detailed Description

A singleton that manages the audio devices known to Audacity.

Constructor & Destructor Documentation

DeviceManager::DeviceManager ( )
DeviceManager::~DeviceManager ( )

Member Function Documentation

DeviceSourceMap * DeviceManager::GetDefaultDevice ( int  hostIndex,
int  isInput 
DeviceSourceMap * DeviceManager::GetDefaultInputDevice ( int  hostIndex)
DeviceSourceMap * DeviceManager::GetDefaultOutputDevice ( int  hostIndex)
void DeviceManager::Init ( )

Does an initial scan. Called by GetInputDeviceMaps and GetOutputDeviceMaps when needed.

References Rescan().

Referenced by GetInputDeviceMaps(), and GetOutputDeviceMaps().

void DeviceManager::Rescan ( )

Gets a NEW list of devices by terminating and restarting portaudio Assumes that DeviceManager is only used on the main thread.

References AddSources(), gAudacityProjects, gAudioIO, AudioIO::IsBusy(), AudioIO::IsMonitoring(), m_inited, mInputDeviceSourceMaps, mOutputDeviceSourceMaps, DeviceToolBar::RefillCombos(), and AudioIO::StopStream().

Referenced by Init(), and AudacityProject::OnRescanDevices().

Member Data Documentation

DeviceManager DeviceManager::dm

Referenced by Instance().

bool DeviceManager::m_inited
std::vector<DeviceSourceMap> DeviceManager::mInputDeviceSourceMaps
std::vector<DeviceSourceMap> DeviceManager::mOutputDeviceSourceMaps

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