Cinder  0.9.1
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
cinder::audio::Device Class Reference

#include <Device.h>

Inherits enable_shared_from_this< Device >, and cinder::Noncopyable.

Classes

struct  Format
 

Public Member Functions

virtual ~Device ()
 
const std::string & getName ()
 
const std::string & getKey ()
 
size_t getNumInputChannels ()
 
size_t getNumOutputChannels ()
 
size_t getSampleRate ()
 
size_t getFramesPerBlock ()
 
void updateFormat (const Format &format)
 
signals::Signal< void()> & getSignalParamsWillChange ()
 
signals::Signal< void()> & getSignalParamsDidChange ()
 

Static Public Member Functions

static DeviceRef getDefaultOutput ()
 
static DeviceRef getDefaultInput ()
 
static DeviceRef findDeviceByName (const std::string &name)
 
static DeviceRef findDeviceByKey (const std::string &key)
 
static const std::vector< DeviceRef > & getDevices ()
 
static std::vector< DeviceRefgetOutputDevices ()
 
static std::vector< DeviceRefgetInputDevices ()
 
static std::string printDevicesToString ()
 

Friends

class DeviceManager
 

Detailed Description

Object representing a hardware audio device. There is only ever one device per hardware device reported by the system, for both input and output.

Constructor & Destructor Documentation

virtual cinder::audio::Device::~Device ( )
virtual

Member Function Documentation

DeviceRef cinder::audio::Device::getDefaultOutput ( )
static

Returns a reference to the default output Device on your system.

DeviceRef cinder::audio::Device::getDefaultInput ( )
static

Returns a reference to the default input Device on your system.

DeviceRef cinder::audio::Device::findDeviceByName ( const std::string &  name)
static

Finds and returns a reference to the first Device named name.

DeviceRef cinder::audio::Device::findDeviceByKey ( const std::string &  key)
static

Finds and returns a reference to the unique Device located by key, an platform-specific defined identifier.

const vector< DeviceRef > & cinder::audio::Device::getDevices ( )
static

Returns a vector of all Device's.

vector< DeviceRef > cinder::audio::Device::getOutputDevices ( )
static

Returns a vector of all output Device's.

vector< DeviceRef > cinder::audio::Device::getInputDevices ( )
static

Returns a vector of all input Device's.

const string & cinder::audio::Device::getName ( )

Returns the name of this Device, which is a human readable string reported by the system.

const string & cinder::audio::Device::getKey ( )

Returns the key of this Device, which is a unique platform-specific defined identifier.

size_t cinder::audio::Device::getNumInputChannels ( )

Returns the number of input channels this Device supports.

size_t cinder::audio::Device::getNumOutputChannels ( )

Returns the number of output channels this Device supports.

size_t cinder::audio::Device::getSampleRate ( )

Returns the current samplerate.

size_t cinder::audio::Device::getFramesPerBlock ( )

Returns the current frames per block.

void cinder::audio::Device::updateFormat ( const Format format)

Configures the format properties of this Device. This effects the hardware on your system.

Note
Update is asynchronous on some platforms (mac desktop).
signals::Signal<void()>& cinder::audio::Device::getSignalParamsWillChange ( )

Returns a signal that notifies connected slots before the format of this Device will change. This can occur from a call to updateFormat() or by the system.

signals::Signal<void()>& cinder::audio::Device::getSignalParamsDidChange ( )

Returns a signal that notifies connected slots after the format of this Device has changed. This can occur from a call to updateFormat() or by the system.

string cinder::audio::Device::printDevicesToString ( )
static

Returns a string representation of all devices for debugging purposes.

Friends And Related Function Documentation

friend class DeviceManager
friend

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