annotate src/portaudio/bindings/cpp/include/portaudiocpp/StreamParameters.hxx @ 105:c83a7e2af39c

Ranlib
author Chris Cannam <cannam@all-day-breakfast.com>
date Mon, 25 Mar 2013 16:28:19 +0000
parents 8a15ff55d9af
children
rev   line source
cannam@89 1 #ifndef INCLUDED_PORTAUDIO_STREAMPARAMETERS_HXX
cannam@89 2 #define INCLUDED_PORTAUDIO_STREAMPARAMETERS_HXX
cannam@89 3
cannam@89 4 // ---------------------------------------------------------------------------------------
cannam@89 5
cannam@89 6 #include "portaudio.h"
cannam@89 7
cannam@89 8 #include "portaudiocpp/DirectionSpecificStreamParameters.hxx"
cannam@89 9
cannam@89 10 // ---------------------------------------------------------------------------------------
cannam@89 11
cannam@89 12 // Declaration(s):
cannam@89 13 namespace portaudio
cannam@89 14 {
cannam@89 15
cannam@89 16 //////
cannam@89 17 /// @brief The entire set of parameters needed to configure and open
cannam@89 18 /// a Stream.
cannam@89 19 ///
cannam@89 20 /// It contains parameters of input, output and shared parameters.
cannam@89 21 /// Using the isSupported() method, the StreamParameters can be
cannam@89 22 /// checked if opening a Stream using this StreamParameters would
cannam@89 23 /// succeed or not. Accessors are provided to higher-level parameters
cannam@89 24 /// aswell as the lower-level parameters which are mainly intended for
cannam@89 25 /// internal use.
cannam@89 26 //////
cannam@89 27 class StreamParameters
cannam@89 28 {
cannam@89 29 public:
cannam@89 30 StreamParameters();
cannam@89 31 StreamParameters(const DirectionSpecificStreamParameters &inputParameters,
cannam@89 32 const DirectionSpecificStreamParameters &outputParameters, double sampleRate,
cannam@89 33 unsigned long framesPerBuffer, PaStreamFlags flags);
cannam@89 34
cannam@89 35 // Set up for direction-specific:
cannam@89 36 void setInputParameters(const DirectionSpecificStreamParameters &parameters);
cannam@89 37 void setOutputParameters(const DirectionSpecificStreamParameters &parameters);
cannam@89 38
cannam@89 39 // Set up for common parameters:
cannam@89 40 void setSampleRate(double sampleRate);
cannam@89 41 void setFramesPerBuffer(unsigned long framesPerBuffer);
cannam@89 42 void setFlag(PaStreamFlags flag);
cannam@89 43 void unsetFlag(PaStreamFlags flag);
cannam@89 44 void clearFlags();
cannam@89 45
cannam@89 46 // Validation:
cannam@89 47 bool isSupported() const;
cannam@89 48
cannam@89 49 // Accessors (direction-specific):
cannam@89 50 DirectionSpecificStreamParameters &inputParameters();
cannam@89 51 const DirectionSpecificStreamParameters &inputParameters() const;
cannam@89 52 DirectionSpecificStreamParameters &outputParameters();
cannam@89 53 const DirectionSpecificStreamParameters &outputParameters() const;
cannam@89 54
cannam@89 55 // Accessors (common):
cannam@89 56 double sampleRate() const;
cannam@89 57 unsigned long framesPerBuffer() const;
cannam@89 58 PaStreamFlags flags() const;
cannam@89 59 bool isFlagSet(PaStreamFlags flag) const;
cannam@89 60
cannam@89 61 private:
cannam@89 62 // Half-duplex specific parameters:
cannam@89 63 DirectionSpecificStreamParameters inputParameters_;
cannam@89 64 DirectionSpecificStreamParameters outputParameters_;
cannam@89 65
cannam@89 66 // Common parameters:
cannam@89 67 double sampleRate_;
cannam@89 68 unsigned long framesPerBuffer_;
cannam@89 69 PaStreamFlags flags_;
cannam@89 70 };
cannam@89 71
cannam@89 72
cannam@89 73 } // namespace portaudio
cannam@89 74
cannam@89 75 // ---------------------------------------------------------------------------------------
cannam@89 76
cannam@89 77 #endif // INCLUDED_PORTAUDIO_STREAMPARAMETERS_HXX