00001 #ifndef INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX 00002 #define INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX 00003 00004 // --------------------------------------------------------------------------------------- 00005 00006 #include <cstddef> 00007 00008 #include "pa_common/portaudio.h" 00009 00010 #include "portaudiocpp/System.hxx" 00011 #include "portaudiocpp/SampleDataFormat.hxx" 00012 00013 // --------------------------------------------------------------------------------------- 00014 00015 // Forward declaration(s): 00016 namespace portaudio 00017 { 00018 class Device; 00019 } 00020 00021 // --------------------------------------------------------------------------------------- 00022 00023 // Declaration(s): 00024 namespace portaudio 00025 { 00026 00032 class DirectionSpecificStreamParameters 00033 { 00034 public: 00035 static DirectionSpecificStreamParameters null(); 00036 00037 DirectionSpecificStreamParameters(); 00038 DirectionSpecificStreamParameters(const Device &device, int numChannels, SampleDataFormat format, 00039 bool interleaved, PaTime suggestedLatency, void *hostApiSpecificStreamInfo); 00040 00041 // Set up methods: 00042 void setDevice(const Device &device); 00043 void setNumChannels(int numChannels); 00044 00045 void setSampleFormat(SampleDataFormat format, bool interleaved = true); 00046 void setHostApiSpecificSampleFormat(PaSampleFormat format, bool interleaved = true); 00047 00048 void setSuggestedLatency(PaTime latency); 00049 00050 void setHostApiSpecificStreamInfo(void *streamInfo); 00051 00052 // Accessor methods: 00053 PaStreamParameters *paStreamParameters(); 00054 const PaStreamParameters *paStreamParameters() const; 00055 00056 Device &device() const; 00057 int numChannels() const; 00058 00059 SampleDataFormat sampleFormat() const; 00060 bool isSampleFormatInterleaved() const; 00061 bool isSampleFormatHostApiSpecific() const; 00062 PaSampleFormat hostApiSpecificSampleFormat() const; 00063 00064 PaTime suggestedLatency() const; 00065 00066 void *hostApiSpecificStreamInfo() const; 00067 00068 private: 00069 PaStreamParameters paStreamParameters_; 00070 }; 00071 00072 00073 } // namespace portaudio 00074 00075 // --------------------------------------------------------------------------------------- 00076 00077 #endif // INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX