Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members

portaudio::StreamParameters Class Reference

#include <StreamParameters.hxx>

Collaboration diagram for portaudio::StreamParameters:

Collaboration graph
[legend]
List of all members.

Detailed Description

The entire set of parameters needed to configure and open a Stream.

It contains parameters of input, output and shared parameters. Using the isSupported() method, the StreamParameters can be checked if opening a Stream using this StreamParameters would succeed or not. Accessors are provided to higher-level parameters aswell as the lower-level parameters which are mainly intended for internal use.


Public Member Functions

 StreamParameters ()
 StreamParameters (const DirectionSpecificStreamParameters &inputParameters, const DirectionSpecificStreamParameters &outputParameters, double sampleRate, unsigned long framesPerBuffer, PaStreamFlags flags)
void setInputParameters (const DirectionSpecificStreamParameters &parameters)
void setOutputParameters (const DirectionSpecificStreamParameters &parameters)
void setSampleRate (double sampleRate)
void setFramesPerBuffer (unsigned long framesPerBuffer)
void setFlag (PaStreamFlags flag)
void unsetFlag (PaStreamFlags flag)
void clearFlags ()
bool isSupported () const
DirectionSpecificStreamParametersinputParameters ()
const DirectionSpecificStreamParametersinputParameters () const
DirectionSpecificStreamParametersoutputParameters ()
const DirectionSpecificStreamParametersoutputParameters () const
double sampleRate () const
unsigned long framesPerBuffer () const
PaStreamFlags flags () const
bool isFlagSet (PaStreamFlags flag) const

Private Attributes

DirectionSpecificStreamParameters inputParameters_
DirectionSpecificStreamParameters outputParameters_
double sampleRate_
unsigned long framesPerBuffer_
PaStreamFlags flags_


Constructor & Destructor Documentation

portaudio::StreamParameters::StreamParameters  ) 
 

Default constructor; does nothing.

portaudio::StreamParameters::StreamParameters const DirectionSpecificStreamParameters inputParameters,
const DirectionSpecificStreamParameters outputParameters,
double  sampleRate,
unsigned long  framesPerBuffer,
PaStreamFlags  flags
 

Sets up the all parameters needed to open either a half-duplex or full-duplex Stream.

Parameters:
inputParameters The parameters for the input direction of the to-be opened Stream or DirectionSpecificStreamParameters::null() for an output-only Stream.
outputParameters The parameters for the output direction of the to-be opened Stream or DirectionSpecificStreamParameters::null() for an input-only Stream.
sampleRate The to-be opened Stream's sample rate in Hz.
framesPerBuffer The number of frames per buffer for a CallbackStream, or the preferred buffer granularity for a BlockingStream.
flags The flags for the to-be opened Stream; default paNoFlag.


Member Function Documentation

void portaudio::StreamParameters::setInputParameters const DirectionSpecificStreamParameters parameters  ) 
 

void portaudio::StreamParameters::setOutputParameters const DirectionSpecificStreamParameters parameters  ) 
 

void portaudio::StreamParameters::setSampleRate double  sampleRate  ) 
 

Sets the requested sample rate. If this sample rate isn't supported by the hardware, the Stream will fail to open. The real-life sample rate used might differ slightly due to imperfections in the sound card hardware; use Stream::sampleRate() to retreive the best known estimate for this value.

void portaudio::StreamParameters::setFramesPerBuffer unsigned long  framesPerBuffer  ) 
 

Either the number of frames per buffer for a CallbackStream, or the preferred buffer granularity for a BlockingStream. See PortAudio documentation.

void portaudio::StreamParameters::setFlag PaStreamFlags  flag  ) 
 

Sets the specified flag or does nothing when the flag is already set. Doesn't `unset' any previously existing flags (use clearFlags() for that).

void portaudio::StreamParameters::unsetFlag PaStreamFlags  flag  ) 
 

Unsets the specified flag or does nothing if the flag isn't set. Doesn't affect any other flags.

void portaudio::StreamParameters::clearFlags  ) 
 

Clears or `unsets' all set flags.

bool portaudio::StreamParameters::isSupported  )  const
 

DirectionSpecificStreamParameters & portaudio::StreamParameters::inputParameters  ) 
 

const DirectionSpecificStreamParameters & portaudio::StreamParameters::inputParameters  )  const
 

DirectionSpecificStreamParameters & portaudio::StreamParameters::outputParameters  ) 
 

const DirectionSpecificStreamParameters & portaudio::StreamParameters::outputParameters  )  const
 

double portaudio::StreamParameters::sampleRate  )  const
 

unsigned long portaudio::StreamParameters::framesPerBuffer  )  const
 

PaStreamFlags portaudio::StreamParameters::flags  )  const
 

Returns all currently set flags as a binary combined integer value (PaStreamFlags). Use isFlagSet() to avoid dealing with the bitmasks.

bool portaudio::StreamParameters::isFlagSet PaStreamFlags  flag  )  const
 

Returns true if the specified flag is currently set or false if it isn't.


Member Data Documentation

DirectionSpecificStreamParameters portaudio::StreamParameters::inputParameters_ [private]
 

DirectionSpecificStreamParameters portaudio::StreamParameters::outputParameters_ [private]
 

double portaudio::StreamParameters::sampleRate_ [private]
 

unsigned long portaudio::StreamParameters::framesPerBuffer_ [private]
 

PaStreamFlags portaudio::StreamParameters::flags_ [private]
 


The documentation for this class was generated from the following files:
Generated on Fri Apr 2 20:22:53 2004 for PortAudioCpp by doxygen 1.3.6