annotate src/portaudio_20140130/bindings/cpp/include/portaudiocpp/StreamParameters.hxx @ 39:7ddb4fc30dac

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