summaryrefslogtreecommitdiff
path: root/portaudio/bindings/cpp/include/portaudiocpp/DirectionSpecificStreamParameters.hxx
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-08-25 14:54:53 -0500
committersanine <sanine.not@pm.me>2022-08-25 14:54:53 -0500
commit37c97e345d12f95dde44e1d1a4c2f2aadd4615bc (patch)
treee1bb25bc855883062bdd7847ff2c04290f71c840 /portaudio/bindings/cpp/include/portaudiocpp/DirectionSpecificStreamParameters.hxx
parent5634c7b04da619669f2f29f6798c03982be05180 (diff)
add initial structure
Diffstat (limited to 'portaudio/bindings/cpp/include/portaudiocpp/DirectionSpecificStreamParameters.hxx')
-rw-r--r--portaudio/bindings/cpp/include/portaudiocpp/DirectionSpecificStreamParameters.hxx77
1 files changed, 77 insertions, 0 deletions
diff --git a/portaudio/bindings/cpp/include/portaudiocpp/DirectionSpecificStreamParameters.hxx b/portaudio/bindings/cpp/include/portaudiocpp/DirectionSpecificStreamParameters.hxx
new file mode 100644
index 0000000..bc24742
--- /dev/null
+++ b/portaudio/bindings/cpp/include/portaudiocpp/DirectionSpecificStreamParameters.hxx
@@ -0,0 +1,77 @@
+#ifndef INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX
+#define INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX
+
+// ---------------------------------------------------------------------------------------
+
+#include <cstddef>
+
+#include "portaudio.h"
+
+#include "portaudiocpp/System.hxx"
+#include "portaudiocpp/SampleDataFormat.hxx"
+
+// ---------------------------------------------------------------------------------------
+
+// Forward declaration(s):
+namespace portaudio
+{
+ class Device;
+}
+
+// ---------------------------------------------------------------------------------------
+
+// Declaration(s):
+namespace portaudio
+{
+
+ //////
+ /// @brief All parameters for one direction (either in or out) of a Stream. Together with
+ /// parameters common to both directions, two DirectionSpecificStreamParameters can make up
+ /// a StreamParameters object which contains all parameters for a Stream.
+ //////
+ class DirectionSpecificStreamParameters
+ {
+ public:
+ static DirectionSpecificStreamParameters null();
+
+ DirectionSpecificStreamParameters();
+ DirectionSpecificStreamParameters(const Device &device, int numChannels, SampleDataFormat format,
+ bool interleaved, PaTime suggestedLatency, void *hostApiSpecificStreamInfo);
+
+ // Set up methods:
+ void setDevice(const Device &device);
+ void setNumChannels(int numChannels);
+
+ void setSampleFormat(SampleDataFormat format, bool interleaved = true);
+ void setHostApiSpecificSampleFormat(PaSampleFormat format, bool interleaved = true);
+
+ void setSuggestedLatency(PaTime latency);
+
+ void setHostApiSpecificStreamInfo(void *streamInfo);
+
+ // Accessor methods:
+ PaStreamParameters *paStreamParameters();
+ const PaStreamParameters *paStreamParameters() const;
+
+ Device &device() const;
+ int numChannels() const;
+
+ SampleDataFormat sampleFormat() const;
+ bool isSampleFormatInterleaved() const;
+ bool isSampleFormatHostApiSpecific() const;
+ PaSampleFormat hostApiSpecificSampleFormat() const;
+
+ PaTime suggestedLatency() const;
+
+ void *hostApiSpecificStreamInfo() const;
+
+ private:
+ PaStreamParameters paStreamParameters_;
+ };
+
+
+} // namespace portaudio
+
+// ---------------------------------------------------------------------------------------
+
+#endif // INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX