annotate src/portaudio_20140130/bindings/cpp/include/portaudiocpp/StreamParameters.hxx @ 124:e3d5853d5918

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