annotate src/portaudio_20161030/bindings/cpp/include/portaudiocpp/Stream.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_STREAM_HXX
cannam@140 2 #define INCLUDED_PORTAUDIO_STREAM_HXX
cannam@140 3
cannam@140 4 #include "portaudio.h"
cannam@140 5
cannam@140 6 // ---------------------------------------------------------------------------------------
cannam@140 7
cannam@140 8 // Forward declaration(s):
cannam@140 9 namespace portaudio
cannam@140 10 {
cannam@140 11 class StreamParameters;
cannam@140 12 }
cannam@140 13
cannam@140 14 // ---------------------------------------------------------------------------------------
cannam@140 15
cannam@140 16 // Declaration(s):
cannam@140 17 namespace portaudio
cannam@140 18 {
cannam@140 19
cannam@140 20
cannam@140 21 //////
cannam@140 22 /// @brief A Stream represents an active or inactive input and/or output data
cannam@140 23 /// stream in the System.
cannam@140 24 ///
cannam@140 25 /// Concrete Stream classes should ensure themselves being in a closed state at
cannam@140 26 /// destruction (i.e. by calling their own close() method in their deconstructor).
cannam@140 27 /// Following good C++ programming practices, care must be taken to ensure no
cannam@140 28 /// exceptions are thrown by the deconstructor of these classes. As a consequence,
cannam@140 29 /// clients need to explicitly call close() to ensure the stream closed successfully.
cannam@140 30 ///
cannam@140 31 /// The Stream object can be used to manipulate the Stream's state. Also, time-constant
cannam@140 32 /// and time-varying information about the Stream can be retreived.
cannam@140 33 //////
cannam@140 34 class Stream
cannam@140 35 {
cannam@140 36 public:
cannam@140 37 // Opening/closing:
cannam@140 38 virtual ~Stream();
cannam@140 39
cannam@140 40 virtual void close();
cannam@140 41 bool isOpen() const;
cannam@140 42
cannam@140 43 // Additional set up:
cannam@140 44 void setStreamFinishedCallback(PaStreamFinishedCallback *callback);
cannam@140 45
cannam@140 46 // State management:
cannam@140 47 void start();
cannam@140 48 void stop();
cannam@140 49 void abort();
cannam@140 50
cannam@140 51 bool isStopped() const;
cannam@140 52 bool isActive() const;
cannam@140 53
cannam@140 54 // Stream info (time-constant, but might become time-variant soon):
cannam@140 55 PaTime inputLatency() const;
cannam@140 56 PaTime outputLatency() const;
cannam@140 57 double sampleRate() const;
cannam@140 58
cannam@140 59 // Stream info (time-varying):
cannam@140 60 PaTime time() const;
cannam@140 61
cannam@140 62 // Accessors for PortAudio PaStream, useful for interfacing
cannam@140 63 // with PortAudio add-ons (such as PortMixer) for instance:
cannam@140 64 const PaStream *paStream() const;
cannam@140 65 PaStream *paStream();
cannam@140 66
cannam@140 67 protected:
cannam@140 68 Stream(); // abstract class
cannam@140 69
cannam@140 70 PaStream *stream_;
cannam@140 71
cannam@140 72 private:
cannam@140 73 Stream(const Stream &); // non-copyable
cannam@140 74 Stream &operator=(const Stream &); // non-copyable
cannam@140 75 };
cannam@140 76
cannam@140 77
cannam@140 78 } // namespace portaudio
cannam@140 79
cannam@140 80
cannam@140 81 #endif // INCLUDED_PORTAUDIO_STREAM_HXX
cannam@140 82