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

Forwards PortAudio source (microphone, line-input or other capture source) to the DSPNetwork. More...

#include <Resonant/PortAudioSource.hpp>

Public Types

enum  OpenResult {
  SUCCESS, PA_INIT_ERROR, PA_DEVICE_NOT_FOUND, NO_INPUT_CHANNELS,
  PA_OPEN_ERROR, PA_START_ERROR
}
 

Public Member Functions

void close ()
 Synchronously closes the input source.
 
ModuleBufferPlayerPtr module () const
 
OpenResult open (const QString &deviceName, QString *errorMessage)
 Synchronously opens an input source. More...
 
QList< SourceInfosources (QString *errorMessage)
 
 ~PortAudioSource ()
 Calls close if the player wasn't closed already.
 

Detailed Description

Forwards PortAudio source (microphone, line-input or other capture source) to the DSPNetwork.

PortAudio will most likely spawn a new thread when using this class. First open the source, and then add module() to DSPNetwork manually.

Member Enumeration Documentation

Enumerator
SUCCESS 

Device was opened successfully.

PA_INIT_ERROR 

Pa_Initialize failed.

PA_DEVICE_NOT_FOUND 

Failed to find PortAudio device with the given name.

NO_INPUT_CHANNELS 

There are no input channels on the device.

PA_OPEN_ERROR 

Failed to open PA stream.

PA_START_ERROR 

Failed to start PA stream.

Member Function Documentation

OpenResult Resonant::PortAudioSource::open ( const QString &  deviceName,
QString *  errorMessage 
)

Synchronously opens an input source.

Parameters
deviceNamefull name matching the PortAudio device name (use ListPortAudioDevices to list them all), or just ALSA name like "hw:2,0" in the same format how PortAudio prints it.
errorMessage[out]Error message