annotate src/portaudio_20161030/bindings/cpp/include/portaudiocpp/StreamParameters.hxx @ 81:7029a4916348

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