All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Resonant::AudioLoopPortAudio Class Reference

PortAudio backend for DSPNetwork. More...

#include <Resonant/AudioLoopPortAudio.hpp>

Inheritance diagram for Resonant::AudioLoopPortAudio:
Resonant::AudioLoop

Public Member Functions

 AudioLoopPortAudio (DSPNetwork &dsp, const std::shared_ptr< ModuleOutCollect > &collect)
 Creates a new audio IO object.
 
virtual bool isRunning () const
 Check if the audio IO is operational.
 
virtual std::size_t outChannels () const
 Returns the number of output channels in the current setup. More...
 
virtual bool start (int samplerate, int channels)
 Start the AudioLoop. More...
 
virtual bool stop ()
 Stop the audio processing.
 
virtual ~AudioLoopPortAudio ()
 Deletes an audio IO object.
 

Static Public Member Functions

static void setDevicesFile (const QString &xmlFilename)
 Set the global resonand devices configuration XML file, look for example resonant-devices.xml for more information. More...
 

Detailed Description

PortAudio backend for DSPNetwork.

Member Function Documentation

virtual std::size_t Resonant::AudioLoopPortAudio::outChannels ( ) const
virtual

Returns the number of output channels in the current setup.

This number reflects the numer of channels that the current sound card has. It is quite typical for sound cards to advertise more channels they actually have. This may be caused by a sound-card manufacturer using the same chips in two sounds cards, with a one card having 10 DACs, while the other might have only 4 (case with M-Audio delta 44 vs 1010).

Returns
Number of channels

Implements Resonant::AudioLoop.

static void Resonant::AudioLoopPortAudio::setDevicesFile ( const QString &  xmlFilename)
static

Set the global resonand devices configuration XML file, look for example resonant-devices.xml for more information.

Parameters
xmlFilenameFilename to the configuration that will be used with all new AudioLoops
virtual bool Resonant::AudioLoopPortAudio::start ( int  samplerate,
int  channels 
)
virtual

Start the AudioLoop.

In practice this spans a new thread that is managed by the PortAudio (or rather, the operating system audio engine).

Parameters
samplerateDesired samplerate, 44100 is safe choice
channelsNumber of channels to open
Returns
False on error

Implements Resonant::AudioLoop.