00001 #ifndef INCLUDED_PORTAUDIO_STREAMPARAMETERS_HXX 00002 #define INCLUDED_PORTAUDIO_STREAMPARAMETERS_HXX 00003 00004 // --------------------------------------------------------------------------------------- 00005 00006 #include "pa_common/portaudio.h" 00007 00008 #include "portaudiocpp/DirectionSpecificStreamParameters.hxx" 00009 00010 // --------------------------------------------------------------------------------------- 00011 00012 // Declaration(s): 00013 namespace portaudio 00014 { 00015 00027 class StreamParameters 00028 { 00029 public: 00030 StreamParameters(); 00031 StreamParameters(const DirectionSpecificStreamParameters &inputParameters, 00032 const DirectionSpecificStreamParameters &outputParameters, double sampleRate, 00033 unsigned long framesPerBuffer, PaStreamFlags flags); 00034 00035 // Set up for direction-specific: 00036 void setInputParameters(const DirectionSpecificStreamParameters ¶meters); 00037 void setOutputParameters(const DirectionSpecificStreamParameters ¶meters); 00038 00039 // Set up for common parameters: 00040 void setSampleRate(double sampleRate); 00041 void setFramesPerBuffer(unsigned long framesPerBuffer); 00042 void setFlag(PaStreamFlags flag); 00043 void unsetFlag(PaStreamFlags flag); 00044 void clearFlags(); 00045 00046 // Validation: 00047 bool isSupported() const; 00048 00049 // Accessors (direction-specific): 00050 DirectionSpecificStreamParameters &inputParameters(); 00051 const DirectionSpecificStreamParameters &inputParameters() const; 00052 DirectionSpecificStreamParameters &outputParameters(); 00053 const DirectionSpecificStreamParameters &outputParameters() const; 00054 00055 // Accessors (common): 00056 double sampleRate() const; 00057 unsigned long framesPerBuffer() const; 00058 PaStreamFlags flags() const; 00059 bool isFlagSet(PaStreamFlags flag) const; 00060 00061 private: 00062 // Half-duplex specific parameters: 00063 DirectionSpecificStreamParameters inputParameters_; 00064 DirectionSpecificStreamParameters outputParameters_; 00065 00066 // Common parameters: 00067 double sampleRate_; 00068 unsigned long framesPerBuffer_; 00069 PaStreamFlags flags_; 00070 }; 00071 00072 00073 } // namespace portaudio 00074 00075 // --------------------------------------------------------------------------------------- 00076 00077 #endif // INCLUDED_PORTAUDIO_STREAMPARAMETERS_HXX