annotate src/portaudio_20161030/bindings/cpp/include/portaudiocpp/StreamParameters.hxx @ 169:223a55898ab9 tip default

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