namespace portaudio
{
- // Forward declaration(s):
- class Device;
-
- // Declaration(s):
- //////
- /// @brief Adapts the given Device to an ASIO specific extension.
- ///
- /// Deleting the AsioDeviceAdapter does not affect the underlaying
- /// Device.
- //////
- class AsioDeviceAdapter
- {
- public:
- AsioDeviceAdapter(Device &device);
-
- Device &device();
-
- long minBufferSize() const;
- long maxBufferSize() const;
- long preferredBufferSize() const;
- long granularity() const;
-
- void showControlPanel(void *systemSpecific);
-
- const char *inputChannelName(int channelIndex) const;\r
- const char *outputChannelName(int channelIndex) const;
-
- private:
- Device *device_;
-
- long minBufferSize_;
- long maxBufferSize_;
- long preferredBufferSize_;
- long granularity_;
- };
+ // Forward declaration(s):
+ class Device;
+
+ // Declaration(s):
+ //////
+ /// @brief Adapts the given Device to an ASIO specific extension.
+ ///
+ /// Deleting the AsioDeviceAdapter does not affect the underlaying
+ /// Device.
+ //////
+ class AsioDeviceAdapter
+ {
+ public:
+ AsioDeviceAdapter(Device &device);
+
+ Device &device();
+
+ long minBufferSize() const;
+ long maxBufferSize() const;
+ long preferredBufferSize() const;
+ long granularity() const;
+
+ void showControlPanel(void *systemSpecific);
+
+ const char *inputChannelName(int channelIndex) const;\r
+ const char *outputChannelName(int channelIndex) const;
+
+ private:
+ Device *device_;
+
+ long minBufferSize_;
+ long maxBufferSize_;
+ long preferredBufferSize_;
+ long granularity_;
+ };
}
#endif // INCLUDED_PORTAUDIO_ASIODEVICEADAPTER_HXX
{\r
\r
\r
- //////\r
- /// @brief A RAII idiom class to ensure automatic clean-up when an exception is \r
- /// raised.\r
- ///\r
- /// A simple helper class which uses the 'Resource Acquisition is Initialization' \r
- /// idiom (RAII). Use this class to initialize/terminate the System rather than \r
- /// using System directly. AutoSystem must be created on stack and must be valid \r
- /// throughout the time you wish to use PortAudioCpp. Your 'main' function might be \r
- /// a good place for it.\r
- ///\r
- /// To avoid having to type portaudio::System::instance().xyz() all the time, it's usually \r
- /// a good idea to make a reference to the System which can be accessed directly.\r
- /// @verbatim\r
- /// portaudio::AutoSys autoSys;\r
- /// portaudio::System &sys = portaudio::System::instance();\r
- /// @endverbatim\r
- //////\r
- class AutoSystem\r
- {\r
- public:\r
- AutoSystem(bool initialize = true)\r
- {\r
- if (initialize)\r
- System::initialize();\r
- }\r
-\r
- ~AutoSystem()\r
- {\r
- if (System::exists())\r
- System::terminate();\r
- }\r
-\r
- void initialize()\r
- {\r
- System::initialize();\r
- }\r
-\r
- void terminate()\r
- {\r
- System::terminate();\r
- }\r
- };\r
+ //////\r
+ /// @brief A RAII idiom class to ensure automatic clean-up when an exception is\r
+ /// raised.\r
+ ///\r
+ /// A simple helper class which uses the 'Resource Acquisition is Initialization'\r
+ /// idiom (RAII). Use this class to initialize/terminate the System rather than\r
+ /// using System directly. AutoSystem must be created on stack and must be valid\r
+ /// throughout the time you wish to use PortAudioCpp. Your 'main' function might be\r
+ /// a good place for it.\r
+ ///\r
+ /// To avoid having to type portaudio::System::instance().xyz() all the time, it's usually\r
+ /// a good idea to make a reference to the System which can be accessed directly.\r
+ /// @verbatim\r
+ /// portaudio::AutoSys autoSys;\r
+ /// portaudio::System &sys = portaudio::System::instance();\r
+ /// @endverbatim\r
+ //////\r
+ class AutoSystem\r
+ {\r
+ public:\r
+ AutoSystem(bool initialize = true)\r
+ {\r
+ if (initialize)\r
+ System::initialize();\r
+ }\r
+\r
+ ~AutoSystem()\r
+ {\r
+ if (System::exists())\r
+ System::terminate();\r
+ }\r
+\r
+ void initialize()\r
+ {\r
+ System::initialize();\r
+ }\r
+\r
+ void terminate()\r
+ {\r
+ System::terminate();\r
+ }\r
+ };\r
\r
\r
} // namespace portaudio\r
\r
\r
\r
- //////\r
- /// @brief Stream class for blocking read/write-style input and output.\r
- //////\r
- class BlockingStream : public Stream\r
- {\r
- public:\r
- BlockingStream();\r
- BlockingStream(const StreamParameters ¶meters);\r
- ~BlockingStream();\r
-\r
- void open(const StreamParameters ¶meters);\r
-\r
- void read(void *buffer, unsigned long numFrames);\r
- void write(const void *buffer, unsigned long numFrames);\r
-\r
- signed long availableReadSize() const;\r
- signed long availableWriteSize() const;\r
-\r
- private:\r
- BlockingStream(const BlockingStream &); // non-copyable\r
- BlockingStream &operator=(const BlockingStream &); // non-copyable\r
- };\r
+ //////\r
+ /// @brief Stream class for blocking read/write-style input and output.\r
+ //////\r
+ class BlockingStream : public Stream\r
+ {\r
+ public:\r
+ BlockingStream();\r
+ BlockingStream(const StreamParameters ¶meters);\r
+ ~BlockingStream();\r
+\r
+ void open(const StreamParameters ¶meters);\r
+\r
+ void read(void *buffer, unsigned long numFrames);\r
+ void write(const void *buffer, unsigned long numFrames);\r
+\r
+ signed long availableReadSize() const;\r
+ signed long availableWriteSize() const;\r
+\r
+ private:\r
+ BlockingStream(const BlockingStream &); // non-copyable\r
+ BlockingStream &operator=(const BlockingStream &); // non-copyable\r
+ };\r
\r
\r
\r
// Forward declaration(s)\r
namespace portaudio\r
{\r
- class StreamParameters;\r
+ class StreamParameters;\r
}\r
\r
// ---------------------------------------------------------------------------------------\r
// Declaration(s):\r
namespace portaudio\r
{\r
- // -----------------------------------------------------------------------------------\r
-\r
- //////\r
- /// @brief Callback stream using a free function with C linkage. It's important that the function \r
- /// the passed function pointer points to is declared ``extern "C"''.\r
- //////\r
- class CFunCallbackStream : public CallbackStream\r
- {\r
- public:\r
- CFunCallbackStream();\r
- CFunCallbackStream(const StreamParameters ¶meters, PaStreamCallback *funPtr, void *userData);\r
- ~CFunCallbackStream();\r
- \r
- void open(const StreamParameters ¶meters, PaStreamCallback *funPtr, void *userData);\r
-\r
- private:\r
- CFunCallbackStream(const CFunCallbackStream &); // non-copyable\r
- CFunCallbackStream &operator=(const CFunCallbackStream &); // non-copyable\r
- };\r
-\r
- // -----------------------------------------------------------------------------------\r
+ // -----------------------------------------------------------------------------------\r
+\r
+ //////\r
+ /// @brief Callback stream using a free function with C linkage. It's important that the function\r
+ /// the passed function pointer points to is declared ``extern "C"''.\r
+ //////\r
+ class CFunCallbackStream : public CallbackStream\r
+ {\r
+ public:\r
+ CFunCallbackStream();\r
+ CFunCallbackStream(const StreamParameters ¶meters, PaStreamCallback *funPtr, void *userData);\r
+ ~CFunCallbackStream();\r
+\r
+ void open(const StreamParameters ¶meters, PaStreamCallback *funPtr, void *userData);\r
+\r
+ private:\r
+ CFunCallbackStream(const CFunCallbackStream &); // non-copyable\r
+ CFunCallbackStream &operator=(const CFunCallbackStream &); // non-copyable\r
+ };\r
+\r
+ // -----------------------------------------------------------------------------------\r
} // portaudio\r
\r
// ---------------------------------------------------------------------------------------\r
\r
namespace portaudio\r
{\r
- // -----------------------------------------------------------------------------------\r
-\r
- //////\r
- /// @brief Interface for an object that's callable as a PortAudioCpp callback object (ie that implements the \r
- /// paCallbackFun method).\r
- //////\r
- class CallbackInterface\r
- {\r
- public:\r
- virtual ~CallbackInterface() {}\r
-\r
- virtual int paCallbackFun(const void *inputBuffer, void *outputBuffer, unsigned long numFrames, \r
- const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags) = 0;\r
- };\r
-\r
- // -----------------------------------------------------------------------------------\r
-\r
- namespace impl\r
- {\r
- extern "C"\r
- {\r
- int callbackInterfaceToPaCallbackAdapter(const void *inputBuffer, void *outputBuffer, unsigned long numFrames, \r
- const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, \r
- void *userData);\r
- } // extern "C"\r
- }\r
-\r
- // -----------------------------------------------------------------------------------\r
+ // -----------------------------------------------------------------------------------\r
+\r
+ //////\r
+ /// @brief Interface for an object that's callable as a PortAudioCpp callback object (ie that implements the\r
+ /// paCallbackFun method).\r
+ //////\r
+ class CallbackInterface\r
+ {\r
+ public:\r
+ virtual ~CallbackInterface() {}\r
+\r
+ virtual int paCallbackFun(const void *inputBuffer, void *outputBuffer, unsigned long numFrames,\r
+ const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags) = 0;\r
+ };\r
+\r
+ // -----------------------------------------------------------------------------------\r
+\r
+ namespace impl\r
+ {\r
+ extern "C"\r
+ {\r
+ int callbackInterfaceToPaCallbackAdapter(const void *inputBuffer, void *outputBuffer, unsigned long numFrames,\r
+ const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags,\r
+ void *userData);\r
+ } // extern "C"\r
+ }\r
+\r
+ // -----------------------------------------------------------------------------------\r
\r
} // namespace portaudio\r
\r
{\r
\r
\r
- //////\r
- /// @brief Base class for all Streams which use a callback-based mechanism.\r
- //////\r
- class CallbackStream : public Stream\r
- {\r
- protected:\r
- CallbackStream();\r
- virtual ~CallbackStream();\r
-\r
- public:\r
- // stream info (time-varying)\r
- double cpuLoad() const;\r
-\r
- private:\r
- CallbackStream(const CallbackStream &); // non-copyable\r
- CallbackStream &operator=(const CallbackStream &); // non-copyable\r
- };\r
+ //////\r
+ /// @brief Base class for all Streams which use a callback-based mechanism.\r
+ //////\r
+ class CallbackStream : public Stream\r
+ {\r
+ protected:\r
+ CallbackStream();\r
+ virtual ~CallbackStream();\r
+\r
+ public:\r
+ // stream info (time-varying)\r
+ double cpuLoad() const;\r
+\r
+ private:\r
+ CallbackStream(const CallbackStream &); // non-copyable\r
+ CallbackStream &operator=(const CallbackStream &); // non-copyable\r
+ };\r
\r
\r
} // namespace portaudio\r
// Forward declaration(s):\r
namespace portaudio\r
{\r
- class StreamParameters;\r
+ class StreamParameters;\r
}\r
\r
// ---------------------------------------------------------------------------------------\r
{\r
\r
\r
- namespace impl\r
- {\r
- extern "C"\r
- {\r
- int cppCallbackToPaCallbackAdapter(const void *inputBuffer, void *outputBuffer, unsigned long numFrames, \r
- const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, \r
- void *userData);\r
- } // extern "C"\r
- }\r
-\r
- // -----------------------------------------------------------------------------------\r
-\r
- //////\r
- /// @brief Callback stream using a C++ function (either a free function or a static function) \r
- /// callback.\r
- //////\r
- class FunCallbackStream : public CallbackStream\r
- {\r
- public:\r
- typedef int (*CallbackFunPtr)(const void *inputBuffer, void *outputBuffer, unsigned long numFrames, \r
- const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, \r
- void *userData);\r
-\r
- // -------------------------------------------------------------------------------\r
-\r
- //////\r
- /// @brief Simple structure containing a function pointer to the C++ callback function and a \r
- /// (void) pointer to the user supplied data.\r
- //////\r
- struct CppToCCallbackData\r
- {\r
- CppToCCallbackData();\r
- CppToCCallbackData(CallbackFunPtr funPtr, void *userData);\r
- void init(CallbackFunPtr funPtr, void *userData);\r
-\r
- CallbackFunPtr funPtr;\r
- void *userData;\r
- };\r
-\r
- // -------------------------------------------------------------------------------\r
-\r
- FunCallbackStream();\r
- FunCallbackStream(const StreamParameters ¶meters, CallbackFunPtr funPtr, void *userData);\r
- ~FunCallbackStream();\r
-\r
- void open(const StreamParameters ¶meters, CallbackFunPtr funPtr, void *userData);\r
-\r
- private:\r
- FunCallbackStream(const FunCallbackStream &); // non-copyable\r
- FunCallbackStream &operator=(const FunCallbackStream &); // non-copyable\r
-\r
- CppToCCallbackData adapterData_;\r
-\r
- void open(const StreamParameters ¶meters);\r
- };\r
+ namespace impl\r
+ {\r
+ extern "C"\r
+ {\r
+ int cppCallbackToPaCallbackAdapter(const void *inputBuffer, void *outputBuffer, unsigned long numFrames,\r
+ const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags,\r
+ void *userData);\r
+ } // extern "C"\r
+ }\r
+\r
+ // -----------------------------------------------------------------------------------\r
+\r
+ //////\r
+ /// @brief Callback stream using a C++ function (either a free function or a static function)\r
+ /// callback.\r
+ //////\r
+ class FunCallbackStream : public CallbackStream\r
+ {\r
+ public:\r
+ typedef int (*CallbackFunPtr)(const void *inputBuffer, void *outputBuffer, unsigned long numFrames,\r
+ const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags,\r
+ void *userData);\r
+\r
+ // -------------------------------------------------------------------------------\r
+\r
+ //////\r
+ /// @brief Simple structure containing a function pointer to the C++ callback function and a\r
+ /// (void) pointer to the user supplied data.\r
+ //////\r
+ struct CppToCCallbackData\r
+ {\r
+ CppToCCallbackData();\r
+ CppToCCallbackData(CallbackFunPtr funPtr, void *userData);\r
+ void init(CallbackFunPtr funPtr, void *userData);\r
+\r
+ CallbackFunPtr funPtr;\r
+ void *userData;\r
+ };\r
+\r
+ // -------------------------------------------------------------------------------\r
+\r
+ FunCallbackStream();\r
+ FunCallbackStream(const StreamParameters ¶meters, CallbackFunPtr funPtr, void *userData);\r
+ ~FunCallbackStream();\r
+\r
+ void open(const StreamParameters ¶meters, CallbackFunPtr funPtr, void *userData);\r
+\r
+ private:\r
+ FunCallbackStream(const FunCallbackStream &); // non-copyable\r
+ FunCallbackStream &operator=(const FunCallbackStream &); // non-copyable\r
+\r
+ CppToCCallbackData adapterData_;\r
+\r
+ void open(const StreamParameters ¶meters);\r
+ };\r
\r
\r
} // portaudio\r
// Forward declaration(s):\r
namespace portaudio\r
{\r
- class System;\r
- class HostApi;\r
+ class System;\r
+ class HostApi;\r
}\r
\r
// ---------------------------------------------------------------------------------------\r
namespace portaudio\r
{\r
\r
- //////\r
- /// @brief Class which represents a PortAudio device in the System.\r
- ///\r
- /// A single physical device in the system may have multiple PortAudio \r
- /// Device representations using different HostApi 's though. A Device \r
- /// can be half-duplex or full-duplex. A half-duplex Device can be used \r
- /// to create a half-duplex Stream. A full-duplex Device can be used to \r
- /// create a full-duplex Stream. If supported by the HostApi, two \r
- /// half-duplex Devices can even be used to create a full-duplex Stream.\r
- ///\r
- /// Note that Device objects are very light-weight and can be passed around \r
- /// by-value.\r
- //////\r
- class Device\r
- {\r
- public:\r
- // query info: name, max in channels, max out channels, \r
- // default low/hight input/output latency, default sample rate\r
- PaDeviceIndex index() const;\r
- const char *name() const;\r
- int maxInputChannels() const;\r
- int maxOutputChannels() const;\r
- PaTime defaultLowInputLatency() const;\r
- PaTime defaultHighInputLatency() const;\r
- PaTime defaultLowOutputLatency() const;\r
- PaTime defaultHighOutputLatency() const;\r
- double defaultSampleRate() const;\r
-\r
- bool isInputOnlyDevice() const; // extended\r
- bool isOutputOnlyDevice() const; // extended\r
- bool isFullDuplexDevice() const; // extended\r
- bool isSystemDefaultInputDevice() const; // extended\r
- bool isSystemDefaultOutputDevice() const; // extended\r
- bool isHostApiDefaultInputDevice() const; // extended\r
- bool isHostApiDefaultOutputDevice() const; // extended\r
-\r
- bool operator==(const Device &rhs);\r
- bool operator!=(const Device &rhs);\r
-\r
- // host api reference\r
- HostApi &hostApi();\r
- const HostApi &hostApi() const;\r
-\r
- private:\r
- PaDeviceIndex index_;\r
- const PaDeviceInfo *info_;\r
-\r
- private:\r
- friend class System;\r
- \r
- explicit Device(PaDeviceIndex index);\r
- ~Device();\r
-\r
- Device(const Device &); // non-copyable\r
- Device &operator=(const Device &); // non-copyable\r
- };\r
-\r
- // -----------------------------------------------------------------------------------\r
+ //////\r
+ /// @brief Class which represents a PortAudio device in the System.\r
+ ///\r
+ /// A single physical device in the system may have multiple PortAudio\r
+ /// Device representations using different HostApi 's though. A Device\r
+ /// can be half-duplex or full-duplex. A half-duplex Device can be used\r
+ /// to create a half-duplex Stream. A full-duplex Device can be used to\r
+ /// create a full-duplex Stream. If supported by the HostApi, two\r
+ /// half-duplex Devices can even be used to create a full-duplex Stream.\r
+ ///\r
+ /// Note that Device objects are very light-weight and can be passed around\r
+ /// by-value.\r
+ //////\r
+ class Device\r
+ {\r
+ public:\r
+ // query info: name, max in channels, max out channels,\r
+ // default low/hight input/output latency, default sample rate\r
+ PaDeviceIndex index() const;\r
+ const char *name() const;\r
+ int maxInputChannels() const;\r
+ int maxOutputChannels() const;\r
+ PaTime defaultLowInputLatency() const;\r
+ PaTime defaultHighInputLatency() const;\r
+ PaTime defaultLowOutputLatency() const;\r
+ PaTime defaultHighOutputLatency() const;\r
+ double defaultSampleRate() const;\r
+\r
+ bool isInputOnlyDevice() const; // extended\r
+ bool isOutputOnlyDevice() const; // extended\r
+ bool isFullDuplexDevice() const; // extended\r
+ bool isSystemDefaultInputDevice() const; // extended\r
+ bool isSystemDefaultOutputDevice() const; // extended\r
+ bool isHostApiDefaultInputDevice() const; // extended\r
+ bool isHostApiDefaultOutputDevice() const; // extended\r
+\r
+ bool operator==(const Device &rhs);\r
+ bool operator!=(const Device &rhs);\r
+\r
+ // host api reference\r
+ HostApi &hostApi();\r
+ const HostApi &hostApi() const;\r
+\r
+ private:\r
+ PaDeviceIndex index_;\r
+ const PaDeviceInfo *info_;\r
+\r
+ private:\r
+ friend class System;\r
+\r
+ explicit Device(PaDeviceIndex index);\r
+ ~Device();\r
+\r
+ Device(const Device &); // non-copyable\r
+ Device &operator=(const Device &); // non-copyable\r
+ };\r
+\r
+ // -----------------------------------------------------------------------------------\r
\r
} // namespace portaudio\r
\r
// Forward declaration(s):\r
namespace portaudio\r
{\r
- class Device;\r
+ class Device;\r
}\r
\r
// ---------------------------------------------------------------------------------------\r
namespace portaudio\r
{\r
\r
- //////\r
- /// @brief All parameters for one direction (either in or out) of a Stream. Together with \r
- /// parameters common to both directions, two DirectionSpecificStreamParameters can make up \r
- /// a StreamParameters object which contains all parameters for a Stream.\r
- //////\r
- class DirectionSpecificStreamParameters\r
- {\r
- public:\r
- static DirectionSpecificStreamParameters null();\r
+ //////\r
+ /// @brief All parameters for one direction (either in or out) of a Stream. Together with\r
+ /// parameters common to both directions, two DirectionSpecificStreamParameters can make up\r
+ /// a StreamParameters object which contains all parameters for a Stream.\r
+ //////\r
+ class DirectionSpecificStreamParameters\r
+ {\r
+ public:\r
+ static DirectionSpecificStreamParameters null();\r
\r
- DirectionSpecificStreamParameters();\r
- DirectionSpecificStreamParameters(const Device &device, int numChannels, SampleDataFormat format, \r
- bool interleaved, PaTime suggestedLatency, void *hostApiSpecificStreamInfo);\r
+ DirectionSpecificStreamParameters();\r
+ DirectionSpecificStreamParameters(const Device &device, int numChannels, SampleDataFormat format,\r
+ bool interleaved, PaTime suggestedLatency, void *hostApiSpecificStreamInfo);\r
\r
- // Set up methods:\r
- void setDevice(const Device &device);\r
- void setNumChannels(int numChannels);\r
+ // Set up methods:\r
+ void setDevice(const Device &device);\r
+ void setNumChannels(int numChannels);\r
\r
- void setSampleFormat(SampleDataFormat format, bool interleaved = true);\r
- void setHostApiSpecificSampleFormat(PaSampleFormat format, bool interleaved = true);\r
+ void setSampleFormat(SampleDataFormat format, bool interleaved = true);\r
+ void setHostApiSpecificSampleFormat(PaSampleFormat format, bool interleaved = true);\r
\r
- void setSuggestedLatency(PaTime latency);\r
+ void setSuggestedLatency(PaTime latency);\r
\r
- void setHostApiSpecificStreamInfo(void *streamInfo);\r
+ void setHostApiSpecificStreamInfo(void *streamInfo);\r
\r
- // Accessor methods:\r
- PaStreamParameters *paStreamParameters();\r
- const PaStreamParameters *paStreamParameters() const;\r
+ // Accessor methods:\r
+ PaStreamParameters *paStreamParameters();\r
+ const PaStreamParameters *paStreamParameters() const;\r
\r
- Device &device() const;\r
- int numChannels() const;\r
+ Device &device() const;\r
+ int numChannels() const;\r
\r
- SampleDataFormat sampleFormat() const;\r
- bool isSampleFormatInterleaved() const;\r
- bool isSampleFormatHostApiSpecific() const;\r
- PaSampleFormat hostApiSpecificSampleFormat() const;\r
+ SampleDataFormat sampleFormat() const;\r
+ bool isSampleFormatInterleaved() const;\r
+ bool isSampleFormatHostApiSpecific() const;\r
+ PaSampleFormat hostApiSpecificSampleFormat() const;\r
\r
- PaTime suggestedLatency() const;\r
+ PaTime suggestedLatency() const;\r
\r
- void *hostApiSpecificStreamInfo() const;\r
- \r
- private:\r
- PaStreamParameters paStreamParameters_;\r
- };\r
+ void *hostApiSpecificStreamInfo() const;\r
+\r
+ private:\r
+ PaStreamParameters paStreamParameters_;\r
+ };\r
\r
\r
} // namespace portaudio\r
namespace portaudio\r
{\r
\r
- //////\r
- /// @brief Base class for all exceptions PortAudioCpp can throw.\r
- ///\r
- /// Class is derived from std::exception.\r
- //////\r
- class Exception : public std::exception\r
- {\r
- public:\r
- virtual ~Exception() throw() {}\r
-\r
- virtual const char *what() const throw() = 0;\r
- };\r
- \r
- // -----------------------------------------------------------------------------------\r
-\r
- //////\r
- /// @brief Wrapper for PortAudio error codes to C++ exceptions.\r
- ///\r
- /// It wraps up PortAudio's error handling mechanism using \r
- /// C++ exceptions and is derived from std::exception for \r
- /// easy exception handling and to ease integration with \r
- /// other code.\r
- ///\r
- /// To know what exceptions each function may throw, look up \r
- /// the errors that can occure in the PortAudio documentation \r
- /// for the equivalent functions.\r
- ///\r
- /// Some functions are likely to throw an exception (such as \r
- /// Stream::open(), etc) and these should always be called in \r
- /// try{} catch{} blocks and the thrown exceptions should be \r
- /// handled properly (ie. the application shouldn't just abort, \r
- /// but merely display a warning dialog to the user or something).\r
- /// However nearly all functions in PortAudioCpp are capable \r
- /// of throwing exceptions. When a function like Stream::isStopped() \r
- /// throws an exception, it's such an exceptional state that it's \r
- /// not likely that it can be recovered. PaExceptions such as these \r
- /// can ``safely'' be left to be handled by some outer catch-all-like \r
- /// mechanism for unrecoverable errors.\r
- //////\r
- class PaException : public Exception\r
- {\r
- public:\r
- explicit PaException(PaError error);\r
-\r
- const char *what() const throw();\r
-\r
- PaError paError() const;\r
- const char *paErrorText() const;\r
-\r
- bool isHostApiError() const; // extended\r
- long lastHostApiError() const;\r
- const char *lastHostApiErrorText() const;\r
-\r
- bool operator==(const PaException &rhs) const;\r
- bool operator!=(const PaException &rhs) const;\r
-\r
- private:\r
- PaError error_;\r
- };\r
-\r
- // -----------------------------------------------------------------------------------\r
-\r
- //////\r
- /// @brief Exceptions specific to PortAudioCpp (ie. exceptions which do not have an \r
- /// equivalent PortAudio error code).\r
- //////\r
- class PaCppException : public Exception\r
- {\r
- public:\r
- enum ExceptionSpecifier\r
- {\r
- UNABLE_TO_ADAPT_DEVICE\r
- };\r
-\r
- PaCppException(ExceptionSpecifier specifier);\r
-\r
- const char *what() const throw();\r
-\r
- ExceptionSpecifier specifier() const;\r
-\r
- bool operator==(const PaCppException &rhs) const;\r
- bool operator!=(const PaCppException &rhs) const;\r
-\r
- private:\r
- ExceptionSpecifier specifier_;\r
- };\r
+ //////\r
+ /// @brief Base class for all exceptions PortAudioCpp can throw.\r
+ ///\r
+ /// Class is derived from std::exception.\r
+ //////\r
+ class Exception : public std::exception\r
+ {\r
+ public:\r
+ virtual ~Exception() throw() {}\r
+\r
+ virtual const char *what() const throw() = 0;\r
+ };\r
+\r
+ // -----------------------------------------------------------------------------------\r
+\r
+ //////\r
+ /// @brief Wrapper for PortAudio error codes to C++ exceptions.\r
+ ///\r
+ /// It wraps up PortAudio's error handling mechanism using\r
+ /// C++ exceptions and is derived from std::exception for\r
+ /// easy exception handling and to ease integration with\r
+ /// other code.\r
+ ///\r
+ /// To know what exceptions each function may throw, look up\r
+ /// the errors that can occure in the PortAudio documentation\r
+ /// for the equivalent functions.\r
+ ///\r
+ /// Some functions are likely to throw an exception (such as\r
+ /// Stream::open(), etc) and these should always be called in\r
+ /// try{} catch{} blocks and the thrown exceptions should be\r
+ /// handled properly (ie. the application shouldn't just abort,\r
+ /// but merely display a warning dialog to the user or something).\r
+ /// However nearly all functions in PortAudioCpp are capable\r
+ /// of throwing exceptions. When a function like Stream::isStopped()\r
+ /// throws an exception, it's such an exceptional state that it's\r
+ /// not likely that it can be recovered. PaExceptions such as these\r
+ /// can ``safely'' be left to be handled by some outer catch-all-like\r
+ /// mechanism for unrecoverable errors.\r
+ //////\r
+ class PaException : public Exception\r
+ {\r
+ public:\r
+ explicit PaException(PaError error);\r
+\r
+ const char *what() const throw();\r
+\r
+ PaError paError() const;\r
+ const char *paErrorText() const;\r
+\r
+ bool isHostApiError() const; // extended\r
+ long lastHostApiError() const;\r
+ const char *lastHostApiErrorText() const;\r
+\r
+ bool operator==(const PaException &rhs) const;\r
+ bool operator!=(const PaException &rhs) const;\r
+\r
+ private:\r
+ PaError error_;\r
+ };\r
+\r
+ // -----------------------------------------------------------------------------------\r
+\r
+ //////\r
+ /// @brief Exceptions specific to PortAudioCpp (ie. exceptions which do not have an\r
+ /// equivalent PortAudio error code).\r
+ //////\r
+ class PaCppException : public Exception\r
+ {\r
+ public:\r
+ enum ExceptionSpecifier\r
+ {\r
+ UNABLE_TO_ADAPT_DEVICE\r
+ };\r
+\r
+ PaCppException(ExceptionSpecifier specifier);\r
+\r
+ const char *what() const throw();\r
+\r
+ ExceptionSpecifier specifier() const;\r
+\r
+ bool operator==(const PaCppException &rhs) const;\r
+ bool operator!=(const PaCppException &rhs) const;\r
+\r
+ private:\r
+ ExceptionSpecifier specifier_;\r
+ };\r
\r
\r
} // namespace portaudio\r
// Forward declaration(s):\r
namespace portaudio\r
{\r
- class Device;\r
+ class Device;\r
}\r
\r
// ---------------------------------------------------------------------------------------\r
{\r
\r
\r
- //////\r
- /// @brief HostApi represents a host API (usually type of driver) in the System.\r
- ///\r
- /// A single System can support multiple HostApi's each one typically having \r
- /// a set of Devices using that HostApi (usually driver type). All Devices in \r
- /// the HostApi can be enumerated and the default input/output Device for this \r
- /// HostApi can be retreived.\r
- //////\r
- class HostApi\r
- {\r
- public:\r
- typedef System::DeviceIterator DeviceIterator;\r
-\r
- // query info: id, name, numDevices\r
- PaHostApiTypeId typeId() const;\r
- PaHostApiIndex index() const;\r
- const char *name() const;\r
- int deviceCount() const;\r
-\r
- // iterate devices\r
- DeviceIterator devicesBegin();\r
- DeviceIterator devicesEnd();\r
-\r
- // default devices\r
- Device &defaultInputDevice() const;\r
- Device &defaultOutputDevice() const;\r
-\r
- // comparison operators\r
- bool operator==(const HostApi &rhs) const;\r
- bool operator!=(const HostApi &rhs) const;\r
-\r
- private:\r
- const PaHostApiInfo *info_;\r
- Device **devices_;\r
-\r
- private:\r
- friend class System;\r
-\r
- explicit HostApi(PaHostApiIndex index);\r
- ~HostApi();\r
-\r
- HostApi(const HostApi &); // non-copyable\r
- HostApi &operator=(const HostApi &); // non-copyable\r
- };\r
+ //////\r
+ /// @brief HostApi represents a host API (usually type of driver) in the System.\r
+ ///\r
+ /// A single System can support multiple HostApi's each one typically having\r
+ /// a set of Devices using that HostApi (usually driver type). All Devices in\r
+ /// the HostApi can be enumerated and the default input/output Device for this\r
+ /// HostApi can be retreived.\r
+ //////\r
+ class HostApi\r
+ {\r
+ public:\r
+ typedef System::DeviceIterator DeviceIterator;\r
+\r
+ // query info: id, name, numDevices\r
+ PaHostApiTypeId typeId() const;\r
+ PaHostApiIndex index() const;\r
+ const char *name() const;\r
+ int deviceCount() const;\r
+\r
+ // iterate devices\r
+ DeviceIterator devicesBegin();\r
+ DeviceIterator devicesEnd();\r
+\r
+ // default devices\r
+ Device &defaultInputDevice() const;\r
+ Device &defaultOutputDevice() const;\r
+\r
+ // comparison operators\r
+ bool operator==(const HostApi &rhs) const;\r
+ bool operator!=(const HostApi &rhs) const;\r
+\r
+ private:\r
+ const PaHostApiInfo *info_;\r
+ Device **devices_;\r
+\r
+ private:\r
+ friend class System;\r
+\r
+ explicit HostApi(PaHostApiIndex index);\r
+ ~HostApi();\r
+\r
+ HostApi(const HostApi &); // non-copyable\r
+ HostApi &operator=(const HostApi &); // non-copyable\r
+ };\r
\r
\r
}\r
// Forward declaration(s)\r
namespace portaudio\r
{\r
- class StreamParameters;\r
- class CallbackInterface;\r
+ class StreamParameters;\r
+ class CallbackInterface;\r
}\r
\r
// ---------------------------------------------------------------------------------------\r
{\r
\r
\r
- //////\r
- /// @brief Callback stream using an instance of an object that's derived from the CallbackInterface \r
- /// interface.\r
- //////\r
- class InterfaceCallbackStream : public CallbackStream\r
- {\r
- public:\r
- InterfaceCallbackStream();\r
- InterfaceCallbackStream(const StreamParameters ¶meters, CallbackInterface &instance);\r
- ~InterfaceCallbackStream();\r
- \r
- void open(const StreamParameters ¶meters, CallbackInterface &instance);\r
-\r
- private:\r
- InterfaceCallbackStream(const InterfaceCallbackStream &); // non-copyable\r
- InterfaceCallbackStream &operator=(const InterfaceCallbackStream &); // non-copyable\r
- };\r
+ //////\r
+ /// @brief Callback stream using an instance of an object that's derived from the CallbackInterface\r
+ /// interface.\r
+ //////\r
+ class InterfaceCallbackStream : public CallbackStream\r
+ {\r
+ public:\r
+ InterfaceCallbackStream();\r
+ InterfaceCallbackStream(const StreamParameters ¶meters, CallbackInterface &instance);\r
+ ~InterfaceCallbackStream();\r
+\r
+ void open(const StreamParameters ¶meters, CallbackInterface &instance);\r
+\r
+ private:\r
+ InterfaceCallbackStream(const InterfaceCallbackStream &); // non-copyable\r
+ InterfaceCallbackStream &operator=(const InterfaceCallbackStream &); // non-copyable\r
+ };\r
\r
\r
} // portaudio\r
{\r
\r
\r
- //////\r
- /// @brief Callback stream using a class's member function as a callback. Template argument T is the type of the \r
- /// class of which a member function is going to be used.\r
- ///\r
- /// Example usage:\r
- /// @verbatim MemFunCallback<MyClass> stream = MemFunCallbackStream(parameters, *this, &MyClass::myCallbackFunction); @endverbatim\r
- //////\r
- template<typename T>\r
- class MemFunCallbackStream : public CallbackStream\r
- {\r
- public:\r
- typedef int (T::*CallbackFunPtr)(const void *, void *, unsigned long, const PaStreamCallbackTimeInfo *, \r
- PaStreamCallbackFlags);\r
-\r
- // -------------------------------------------------------------------------------\r
-\r
- MemFunCallbackStream()\r
- {\r
- }\r
-\r
- MemFunCallbackStream(const StreamParameters ¶meters, T &instance, CallbackFunPtr memFun) : adapter_(instance, memFun)\r
- {\r
- open(parameters);\r
- }\r
-\r
- ~MemFunCallbackStream()\r
- {\r
- close();\r
- }\r
-\r
- void open(const StreamParameters ¶meters, T &instance, CallbackFunPtr memFun)\r
- {\r
- // XXX: need to check if already open?\r
-\r
- adapter_.init(instance, memFun);\r
- open(parameters);\r
- }\r
-\r
- private:\r
- MemFunCallbackStream(const MemFunCallbackStream &); // non-copyable\r
- MemFunCallbackStream &operator=(const MemFunCallbackStream &); // non-copyable\r
-\r
- //////\r
- /// @brief Inner class which adapts a member function callback to a CallbackInterface compliant \r
- /// class (so it can be adapted using the paCallbackAdapter function).\r
- //////\r
- class MemFunToCallbackInterfaceAdapter : public CallbackInterface\r
- {\r
- public:\r
- MemFunToCallbackInterfaceAdapter() {}\r
- MemFunToCallbackInterfaceAdapter(T &instance, CallbackFunPtr memFun) : instance_(&instance), memFun_(memFun) {}\r
-\r
- void init(T &instance, CallbackFunPtr memFun)\r
- {\r
- instance_ = &instance;\r
- memFun_ = memFun;\r
- }\r
-\r
- int paCallbackFun(const void *inputBuffer, void *outputBuffer, unsigned long numFrames, \r
- const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags)\r
- {\r
- return (instance_->*memFun_)(inputBuffer, outputBuffer, numFrames, timeInfo, statusFlags);\r
- }\r
-\r
- private:\r
- T *instance_;\r
- CallbackFunPtr memFun_;\r
- };\r
-\r
- MemFunToCallbackInterfaceAdapter adapter_;\r
-\r
- void open(const StreamParameters ¶meters)\r
- {\r
- PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(), \r
- parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), &impl::callbackInterfaceToPaCallbackAdapter, \r
- static_cast<void *>(&adapter_));\r
-\r
- if (err != paNoError)\r
- throw PaException(err);\r
- }\r
- };\r
+ //////\r
+ /// @brief Callback stream using a class's member function as a callback. Template argument T is the type of the\r
+ /// class of which a member function is going to be used.\r
+ ///\r
+ /// Example usage:\r
+ /// @verbatim MemFunCallback<MyClass> stream = MemFunCallbackStream(parameters, *this, &MyClass::myCallbackFunction); @endverbatim\r
+ //////\r
+ template<typename T>\r
+ class MemFunCallbackStream : public CallbackStream\r
+ {\r
+ public:\r
+ typedef int (T::*CallbackFunPtr)(const void *, void *, unsigned long, const PaStreamCallbackTimeInfo *,\r
+ PaStreamCallbackFlags);\r
+\r
+ // -------------------------------------------------------------------------------\r
+\r
+ MemFunCallbackStream()\r
+ {\r
+ }\r
+\r
+ MemFunCallbackStream(const StreamParameters ¶meters, T &instance, CallbackFunPtr memFun) : adapter_(instance, memFun)\r
+ {\r
+ open(parameters);\r
+ }\r
+\r
+ ~MemFunCallbackStream()\r
+ {\r
+ close();\r
+ }\r
+\r
+ void open(const StreamParameters ¶meters, T &instance, CallbackFunPtr memFun)\r
+ {\r
+ // XXX: need to check if already open?\r
+\r
+ adapter_.init(instance, memFun);\r
+ open(parameters);\r
+ }\r
+\r
+ private:\r
+ MemFunCallbackStream(const MemFunCallbackStream &); // non-copyable\r
+ MemFunCallbackStream &operator=(const MemFunCallbackStream &); // non-copyable\r
+\r
+ //////\r
+ /// @brief Inner class which adapts a member function callback to a CallbackInterface compliant\r
+ /// class (so it can be adapted using the paCallbackAdapter function).\r
+ //////\r
+ class MemFunToCallbackInterfaceAdapter : public CallbackInterface\r
+ {\r
+ public:\r
+ MemFunToCallbackInterfaceAdapter() {}\r
+ MemFunToCallbackInterfaceAdapter(T &instance, CallbackFunPtr memFun) : instance_(&instance), memFun_(memFun) {}\r
+\r
+ void init(T &instance, CallbackFunPtr memFun)\r
+ {\r
+ instance_ = &instance;\r
+ memFun_ = memFun;\r
+ }\r
+\r
+ int paCallbackFun(const void *inputBuffer, void *outputBuffer, unsigned long numFrames,\r
+ const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags)\r
+ {\r
+ return (instance_->*memFun_)(inputBuffer, outputBuffer, numFrames, timeInfo, statusFlags);\r
+ }\r
+\r
+ private:\r
+ T *instance_;\r
+ CallbackFunPtr memFun_;\r
+ };\r
+\r
+ MemFunToCallbackInterfaceAdapter adapter_;\r
+\r
+ void open(const StreamParameters ¶meters)\r
+ {\r
+ PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(),\r
+ parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), &impl::callbackInterfaceToPaCallbackAdapter,\r
+ static_cast<void *>(&adapter_));\r
+\r
+ if (err != paNoError)\r
+ throw PaException(err);\r
+ }\r
+ };\r
\r
\r
} // portaudio\r
//////\r
/// @mainpage PortAudioCpp\r
///\r
-/// <h1>PortAudioCpp - A Native C++ Binding of PortAudio V19</h1>\r
+/// <h1>PortAudioCpp - A Native C++ Binding of PortAudio V19</h1>\r
/// <h2>PortAudio</h2>\r
/// <p>\r
-/// PortAudio is a portable and mature C API for accessing audio hardware. It offers both callback-based and blocking \r
-/// style input and output, deals with sample data format conversions, dithering and much more. There are a large number \r
-/// of implementations available for various platforms including Windows MME, Windows DirectX, Windows and MacOS (Classic) \r
-/// ASIO, MacOS Classic SoundManager, MacOS X CoreAudio, OSS (Linux), Linux ALSA, JACK (MacOS X and Linux) and SGI Irix \r
-/// AL. Note that, currently not all of these implementations are equally complete or up-to-date (as PortAudio V19 is \r
-/// still in development). Because PortAudio has a C API, it can easily be called from a variety of other programming \r
+/// PortAudio is a portable and mature C API for accessing audio hardware. It offers both callback-based and blocking\r
+/// style input and output, deals with sample data format conversions, dithering and much more. There are a large number\r
+/// of implementations available for various platforms including Windows MME, Windows DirectX, Windows and MacOS (Classic)\r
+/// ASIO, MacOS Classic SoundManager, MacOS X CoreAudio, OSS (Linux), Linux ALSA, JACK (MacOS X and Linux) and SGI Irix\r
+/// AL. Note that, currently not all of these implementations are equally complete or up-to-date (as PortAudio V19 is\r
+/// still in development). Because PortAudio has a C API, it can easily be called from a variety of other programming\r
/// languages.\r
/// </p>\r
/// <h2>PortAudioCpp</h2>\r
/// <p>\r
-/// Although, it is possible to use PortAudio's C API from within a C++ program, this is usually a little awkward \r
-/// as procedural and object-oriented paradigms need to be mixed. PortAudioCpp aims to resolve this by encapsulating \r
-/// PortAudio's C API to form an equivalent object-oriented C++ API. It provides a more natural integration of PortAudio \r
-/// into C++ programs as well as a more structured interface. PortAudio's concepts were preserved as much as possible and \r
+/// Although, it is possible to use PortAudio's C API from within a C++ program, this is usually a little awkward\r
+/// as procedural and object-oriented paradigms need to be mixed. PortAudioCpp aims to resolve this by encapsulating\r
+/// PortAudio's C API to form an equivalent object-oriented C++ API. It provides a more natural integration of PortAudio\r
+/// into C++ programs as well as a more structured interface. PortAudio's concepts were preserved as much as possible and\r
/// no additional features were added except for some `convenience methods'.\r
/// </p>\r
/// <p>\r
/// <ul>\r
/// <li>Structured object model.</li>\r
/// <li>C++ exception handling instead of C-style error return codes.</li>\r
-/// <li>Handling of callbacks using free functions (C and C++), static functions, member functions or instances of classes \r
+/// <li>Handling of callbacks using free functions (C and C++), static functions, member functions or instances of classes\r
/// derived from a given interface.</li>\r
/// <li>STL compliant iterators to host APIs and devices.</li>\r
/// <li>Some additional convenience functions to more easily set up and use PortAudio.</li>\r
/// </ul>\r
/// </p>\r
/// <p>\r
-/// PortAudioCpp requires a recent version of the PortAudio V19 source code. This can be obtained from CVS or as a snapshot \r
-/// from the website. The examples also require the ASIO 2 SDK which can be obtained from the Steinberg website. Alternatively, the \r
+/// PortAudioCpp requires a recent version of the PortAudio V19 source code. This can be obtained from CVS or as a snapshot\r
+/// from the website. The examples also require the ASIO 2 SDK which can be obtained from the Steinberg website. Alternatively, the\r
/// examples can easily be modified to compile without needing ASIO.\r
/// </p>\r
/// <p>\r
/// Other platforms should be easily supported as PortAudioCpp is platform-independent and (reasonably) C++ standard compliant.\r
/// </p>\r
/// <p>\r
-/// This documentation mainly provides information specific to PortAudioCpp. For a more complete explaination of all of the \r
+/// This documentation mainly provides information specific to PortAudioCpp. For a more complete explaination of all of the\r
/// concepts used, please consult the PortAudio documentation.\r
/// </p>\r
/// <p>\r
-/// PortAudioCpp was developed by Merlijn Blaauw with many great suggestions and help from Ross Bencina. Ludwig Schwardt provided \r
-/// GNU/Linux build files and checked G++ compatibility. PortAudioCpp may be used under the same licensing, conditions and \r
+/// PortAudioCpp was developed by Merlijn Blaauw with many great suggestions and help from Ross Bencina. Ludwig Schwardt provided\r
+/// GNU/Linux build files and checked G++ compatibility. PortAudioCpp may be used under the same licensing, conditions and\r
/// warranty as PortAudio. See <a href="http://www.portaudio.com/license.html">the PortAudio license</a> for more details.\r
/// </p>\r
/// <h2>Links</h2>\r
//////\r
/// @namespace portaudio\r
///\r
-/// To avoid name collision, everything in PortAudioCpp is in the portaudio \r
-/// namespace. If this name is too long it's usually pretty safe to use an \r
+/// To avoid name collision, everything in PortAudioCpp is in the portaudio\r
+/// namespace. If this name is too long it's usually pretty safe to use an\r
/// alias like ``namespace pa = portaudio;''.\r
//////\r
\r
{\r
\r
\r
- //////\r
- /// @brief PortAudio sample data formats.\r
- ///\r
- /// Small helper enum to wrap the PortAudio defines.\r
- //////\r
- enum SampleDataFormat\r
- {\r
- INVALID_FORMAT = 0,\r
- FLOAT32 = paFloat32,\r
- INT32 = paInt32,\r
- INT24 = paInt24,\r
- INT16 = paInt16,\r
- INT8 = paInt8,\r
- UINT8 = paUInt8\r
- };\r
+ //////\r
+ /// @brief PortAudio sample data formats.\r
+ ///\r
+ /// Small helper enum to wrap the PortAudio defines.\r
+ //////\r
+ enum SampleDataFormat\r
+ {\r
+ INVALID_FORMAT = 0,\r
+ FLOAT32 = paFloat32,\r
+ INT32 = paInt32,\r
+ INT24 = paInt24,\r
+ INT16 = paInt16,\r
+ INT8 = paInt8,\r
+ UINT8 = paUInt8\r
+ };\r
\r
\r
} // namespace portaudio\r
// Forward declaration(s):\r
namespace portaudio\r
{\r
- class StreamParameters;\r
+ class StreamParameters;\r
}\r
\r
// ---------------------------------------------------------------------------------------\r
{\r
\r
\r
- //////\r
- /// @brief A Stream represents an active or inactive input and/or output data \r
- /// stream in the System.\r
- /// \r
- /// Concrete Stream classes should ensure themselves being in a closed state at \r
- /// destruction (i.e. by calling their own close() method in their deconstructor). \r
- /// Following good C++ programming practices, care must be taken to ensure no \r
- /// exceptions are thrown by the deconstructor of these classes. As a consequence, \r
- /// clients need to explicitly call close() to ensure the stream closed successfully.\r
- ///\r
- /// The Stream object can be used to manipulate the Stream's state. Also, time-constant \r
- /// and time-varying information about the Stream can be retreived.\r
- //////\r
- class Stream\r
- {\r
- public:\r
- // Opening/closing:\r
- virtual ~Stream();\r
-\r
- virtual void close();\r
- bool isOpen() const;\r
-\r
- // Additional set up:\r
- void setStreamFinishedCallback(PaStreamFinishedCallback *callback);\r
-\r
- // State management:\r
- void start();\r
- void stop();\r
- void abort();\r
-\r
- bool isStopped() const;\r
- bool isActive() const;\r
-\r
- // Stream info (time-constant, but might become time-variant soon):\r
- PaTime inputLatency() const;\r
- PaTime outputLatency() const;\r
- double sampleRate() const;\r
-\r
- // Stream info (time-varying):\r
- PaTime time() const;\r
-\r
- // Accessors for PortAudio PaStream, useful for interfacing \r
- // with PortAudio add-ons (such as PortMixer) for instance:\r
- const PaStream *paStream() const;\r
- PaStream *paStream();\r
-\r
- protected:\r
- Stream(); // abstract class\r
-\r
- PaStream *stream_;\r
-\r
- private:\r
- Stream(const Stream &); // non-copyable\r
- Stream &operator=(const Stream &); // non-copyable\r
- };\r
+ //////\r
+ /// @brief A Stream represents an active or inactive input and/or output data\r
+ /// stream in the System.\r
+ ///\r
+ /// Concrete Stream classes should ensure themselves being in a closed state at\r
+ /// destruction (i.e. by calling their own close() method in their deconstructor).\r
+ /// Following good C++ programming practices, care must be taken to ensure no\r
+ /// exceptions are thrown by the deconstructor of these classes. As a consequence,\r
+ /// clients need to explicitly call close() to ensure the stream closed successfully.\r
+ ///\r
+ /// The Stream object can be used to manipulate the Stream's state. Also, time-constant\r
+ /// and time-varying information about the Stream can be retreived.\r
+ //////\r
+ class Stream\r
+ {\r
+ public:\r
+ // Opening/closing:\r
+ virtual ~Stream();\r
+\r
+ virtual void close();\r
+ bool isOpen() const;\r
+\r
+ // Additional set up:\r
+ void setStreamFinishedCallback(PaStreamFinishedCallback *callback);\r
+\r
+ // State management:\r
+ void start();\r
+ void stop();\r
+ void abort();\r
+\r
+ bool isStopped() const;\r
+ bool isActive() const;\r
+\r
+ // Stream info (time-constant, but might become time-variant soon):\r
+ PaTime inputLatency() const;\r
+ PaTime outputLatency() const;\r
+ double sampleRate() const;\r
+\r
+ // Stream info (time-varying):\r
+ PaTime time() const;\r
+\r
+ // Accessors for PortAudio PaStream, useful for interfacing\r
+ // with PortAudio add-ons (such as PortMixer) for instance:\r
+ const PaStream *paStream() const;\r
+ PaStream *paStream();\r
+\r
+ protected:\r
+ Stream(); // abstract class\r
+\r
+ PaStream *stream_;\r
+\r
+ private:\r
+ Stream(const Stream &); // non-copyable\r
+ Stream &operator=(const Stream &); // non-copyable\r
+ };\r
\r
\r
} // namespace portaudio\r
namespace portaudio\r
{\r
\r
- //////\r
- /// @brief The entire set of parameters needed to configure and open \r
- /// a Stream.\r
- ///\r
- /// It contains parameters of input, output and shared parameters. \r
- /// Using the isSupported() method, the StreamParameters can be \r
- /// checked if opening a Stream using this StreamParameters would \r
- /// succeed or not. Accessors are provided to higher-level parameters \r
- /// aswell as the lower-level parameters which are mainly intended for \r
- /// internal use.\r
- //////\r
- class StreamParameters\r
- {\r
- public:\r
- StreamParameters();\r
- StreamParameters(const DirectionSpecificStreamParameters &inputParameters, \r
- const DirectionSpecificStreamParameters &outputParameters, double sampleRate, \r
- unsigned long framesPerBuffer, PaStreamFlags flags);\r
-\r
- // Set up for direction-specific:\r
- void setInputParameters(const DirectionSpecificStreamParameters ¶meters);\r
- void setOutputParameters(const DirectionSpecificStreamParameters ¶meters);\r
-\r
- // Set up for common parameters:\r
- void setSampleRate(double sampleRate);\r
- void setFramesPerBuffer(unsigned long framesPerBuffer);\r
- void setFlag(PaStreamFlags flag);\r
- void unsetFlag(PaStreamFlags flag);\r
- void clearFlags();\r
-\r
- // Validation:\r
- bool isSupported() const;\r
-\r
- // Accessors (direction-specific):\r
- DirectionSpecificStreamParameters &inputParameters();\r
- const DirectionSpecificStreamParameters &inputParameters() const;\r
- DirectionSpecificStreamParameters &outputParameters();\r
- const DirectionSpecificStreamParameters &outputParameters() const;\r
-\r
- // Accessors (common):\r
- double sampleRate() const;\r
- unsigned long framesPerBuffer() const;\r
- PaStreamFlags flags() const;\r
- bool isFlagSet(PaStreamFlags flag) const;\r
-\r
- private:\r
- // Half-duplex specific parameters:\r
- DirectionSpecificStreamParameters inputParameters_;\r
- DirectionSpecificStreamParameters outputParameters_;\r
-\r
- // Common parameters:\r
- double sampleRate_;\r
- unsigned long framesPerBuffer_;\r
- PaStreamFlags flags_;\r
- };\r
+ //////\r
+ /// @brief The entire set of parameters needed to configure and open\r
+ /// a Stream.\r
+ ///\r
+ /// It contains parameters of input, output and shared parameters.\r
+ /// Using the isSupported() method, the StreamParameters can be\r
+ /// checked if opening a Stream using this StreamParameters would\r
+ /// succeed or not. Accessors are provided to higher-level parameters\r
+ /// aswell as the lower-level parameters which are mainly intended for\r
+ /// internal use.\r
+ //////\r
+ class StreamParameters\r
+ {\r
+ public:\r
+ StreamParameters();\r
+ StreamParameters(const DirectionSpecificStreamParameters &inputParameters,\r
+ const DirectionSpecificStreamParameters &outputParameters, double sampleRate,\r
+ unsigned long framesPerBuffer, PaStreamFlags flags);\r
+\r
+ // Set up for direction-specific:\r
+ void setInputParameters(const DirectionSpecificStreamParameters ¶meters);\r
+ void setOutputParameters(const DirectionSpecificStreamParameters ¶meters);\r
+\r
+ // Set up for common parameters:\r
+ void setSampleRate(double sampleRate);\r
+ void setFramesPerBuffer(unsigned long framesPerBuffer);\r
+ void setFlag(PaStreamFlags flag);\r
+ void unsetFlag(PaStreamFlags flag);\r
+ void clearFlags();\r
+\r
+ // Validation:\r
+ bool isSupported() const;\r
+\r
+ // Accessors (direction-specific):\r
+ DirectionSpecificStreamParameters &inputParameters();\r
+ const DirectionSpecificStreamParameters &inputParameters() const;\r
+ DirectionSpecificStreamParameters &outputParameters();\r
+ const DirectionSpecificStreamParameters &outputParameters() const;\r
+\r
+ // Accessors (common):\r
+ double sampleRate() const;\r
+ unsigned long framesPerBuffer() const;\r
+ PaStreamFlags flags() const;\r
+ bool isFlagSet(PaStreamFlags flag) const;\r
+\r
+ private:\r
+ // Half-duplex specific parameters:\r
+ DirectionSpecificStreamParameters inputParameters_;\r
+ DirectionSpecificStreamParameters outputParameters_;\r
+\r
+ // Common parameters:\r
+ double sampleRate_;\r
+ unsigned long framesPerBuffer_;\r
+ PaStreamFlags flags_;\r
+ };\r
\r
\r
} // namespace portaudio\r
// Forward declaration(s):\r
namespace portaudio\r
{\r
- class Device;\r
- class Stream;\r
- class HostApi;\r
+ class Device;\r
+ class Stream;\r
+ class HostApi;\r
}\r
\r
// ---------------------------------------------------------------------------------------\r
{\r
\r
\r
- //////\r
- /// @brief System singleton which represents the PortAudio system.\r
- ///\r
- /// The System is used to initialize/terminate PortAudio and provide \r
- /// a single acccess point to the PortAudio System (instance()).\r
- /// It can be used to iterate through all HostApi 's in the System as \r
- /// well as all devices in the System. It also provides some utility \r
- /// functionality of PortAudio.\r
- ///\r
- /// Terminating the System will also abort and close the open streams. \r
- /// The Stream objects will need to be deallocated by the client though \r
- /// (it's usually a good idea to have them cleaned up automatically).\r
- //////\r
- class System\r
- {\r
- public:\r
- class HostApiIterator; // forward declaration\r
- class DeviceIterator; // forward declaration\r
+ //////\r
+ /// @brief System singleton which represents the PortAudio system.\r
+ ///\r
+ /// The System is used to initialize/terminate PortAudio and provide\r
+ /// a single acccess point to the PortAudio System (instance()).\r
+ /// It can be used to iterate through all HostApi 's in the System as\r
+ /// well as all devices in the System. It also provides some utility\r
+ /// functionality of PortAudio.\r
+ ///\r
+ /// Terminating the System will also abort and close the open streams.\r
+ /// The Stream objects will need to be deallocated by the client though\r
+ /// (it's usually a good idea to have them cleaned up automatically).\r
+ //////\r
+ class System\r
+ {\r
+ public:\r
+ class HostApiIterator; // forward declaration\r
+ class DeviceIterator; // forward declaration\r
\r
- // -------------------------------------------------------------------------------\r
+ // -------------------------------------------------------------------------------\r
\r
- static int version();\r
- static const char *versionText();\r
+ static int version();\r
+ static const char *versionText();\r
\r
- static void initialize();\r
- static void terminate();\r
+ static void initialize();\r
+ static void terminate();\r
\r
- static System &instance();\r
- static bool exists();\r
+ static System &instance();\r
+ static bool exists();\r
\r
- // -------------------------------------------------------------------------------\r
+ // -------------------------------------------------------------------------------\r
\r
- // host apis:\r
- HostApiIterator hostApisBegin();\r
- HostApiIterator hostApisEnd();\r
+ // host apis:\r
+ HostApiIterator hostApisBegin();\r
+ HostApiIterator hostApisEnd();\r
\r
- HostApi &defaultHostApi();\r
+ HostApi &defaultHostApi();\r
\r
- HostApi &hostApiByTypeId(PaHostApiTypeId type);\r
- HostApi &hostApiByIndex(PaHostApiIndex index);\r
+ HostApi &hostApiByTypeId(PaHostApiTypeId type);\r
+ HostApi &hostApiByIndex(PaHostApiIndex index);\r
\r
- int hostApiCount();\r
+ int hostApiCount();\r
\r
- // -------------------------------------------------------------------------------\r
+ // -------------------------------------------------------------------------------\r
\r
- // devices:\r
- DeviceIterator devicesBegin();\r
- DeviceIterator devicesEnd();\r
+ // devices:\r
+ DeviceIterator devicesBegin();\r
+ DeviceIterator devicesEnd();\r
\r
- Device &defaultInputDevice();\r
- Device &defaultOutputDevice();\r
+ Device &defaultInputDevice();\r
+ Device &defaultOutputDevice();\r
\r
- Device &deviceByIndex(PaDeviceIndex index);\r
+ Device &deviceByIndex(PaDeviceIndex index);\r
\r
- int deviceCount();\r
+ int deviceCount();\r
\r
- static Device &nullDevice();\r
+ static Device &nullDevice();\r
\r
- // -------------------------------------------------------------------------------\r
+ // -------------------------------------------------------------------------------\r
\r
- // misc:\r
- void sleep(long msec);\r
- int sizeOfSample(PaSampleFormat format);\r
+ // misc:\r
+ void sleep(long msec);\r
+ int sizeOfSample(PaSampleFormat format);\r
\r
- private:\r
- System();\r
- ~System();\r
+ private:\r
+ System();\r
+ ~System();\r
\r
- static System *instance_;\r
- static int initCount_;\r
+ static System *instance_;\r
+ static int initCount_;\r
\r
- static HostApi **hostApis_;\r
- static Device **devices_;\r
+ static HostApi **hostApis_;\r
+ static Device **devices_;\r
\r
- static Device *nullDevice_;\r
- };\r
+ static Device *nullDevice_;\r
+ };\r
\r
\r
} // namespace portaudio\r
// Forward declaration(s):\r
namespace portaudio\r
{\r
- class Device;\r
- class HostApi;\r
+ class Device;\r
+ class HostApi;\r
}\r
\r
// ---------------------------------------------------------------------------------------\r
namespace portaudio\r
{\r
\r
- \r
- //////\r
- /// @brief Iterator class for iterating through all Devices in a System.\r
- ///\r
- /// Devices will be iterated by iterating all Devices in each \r
- /// HostApi in the System. Compliant with the STL bidirectional \r
- /// iterator concept.\r
- //////\r
- class System::DeviceIterator\r
- {\r
- public:\r
- typedef std::bidirectional_iterator_tag iterator_category;\r
- typedef Device value_type;\r
- typedef ptrdiff_t difference_type;\r
- typedef Device * pointer;\r
- typedef Device & reference;\r
-\r
- Device &operator*() const;\r
- Device *operator->() const;\r
-\r
- DeviceIterator &operator++();\r
- DeviceIterator operator++(int);\r
- DeviceIterator &operator--();\r
- DeviceIterator operator--(int);\r
-\r
- bool operator==(const DeviceIterator &rhs);\r
- bool operator!=(const DeviceIterator &rhs);\r
-\r
- private:\r
- friend class System;\r
- friend class HostApi;\r
- Device **ptr_;\r
- };\r
+\r
+ //////\r
+ /// @brief Iterator class for iterating through all Devices in a System.\r
+ ///\r
+ /// Devices will be iterated by iterating all Devices in each\r
+ /// HostApi in the System. Compliant with the STL bidirectional\r
+ /// iterator concept.\r
+ //////\r
+ class System::DeviceIterator\r
+ {\r
+ public:\r
+ typedef std::bidirectional_iterator_tag iterator_category;\r
+ typedef Device value_type;\r
+ typedef ptrdiff_t difference_type;\r
+ typedef Device * pointer;\r
+ typedef Device & reference;\r
+\r
+ Device &operator*() const;\r
+ Device *operator->() const;\r
+\r
+ DeviceIterator &operator++();\r
+ DeviceIterator operator++(int);\r
+ DeviceIterator &operator--();\r
+ DeviceIterator operator--(int);\r
+\r
+ bool operator==(const DeviceIterator &rhs);\r
+ bool operator!=(const DeviceIterator &rhs);\r
+\r
+ private:\r
+ friend class System;\r
+ friend class HostApi;\r
+ Device **ptr_;\r
+ };\r
\r
\r
} // namespace portaudio\r
// Forward declaration(s):\r
namespace portaudio\r
{\r
- class HostApi;\r
+ class HostApi;\r
}\r
\r
// ---------------------------------------------------------------------------------------\r
{\r
\r
\r
- //////\r
- /// @brief Iterator class for iterating through all HostApis in a System.\r
- ///\r
- /// Compliant with the STL bidirectional iterator concept.\r
- //////\r
- class System::HostApiIterator\r
- {\r
- public:\r
- typedef std::bidirectional_iterator_tag iterator_category;\r
- typedef Device value_type;\r
- typedef ptrdiff_t difference_type;\r
- typedef HostApi * pointer;\r
- typedef HostApi & reference;\r
-\r
- HostApi &operator*() const;\r
- HostApi *operator->() const;\r
-\r
- HostApiIterator &operator++();\r
- HostApiIterator operator++(int);\r
- HostApiIterator &operator--();\r
- HostApiIterator operator--(int);\r
-\r
- bool operator==(const HostApiIterator &rhs);\r
- bool operator!=(const HostApiIterator &rhs);\r
-\r
- private:\r
- friend class System;\r
- HostApi **ptr_;\r
- };\r
+ //////\r
+ /// @brief Iterator class for iterating through all HostApis in a System.\r
+ ///\r
+ /// Compliant with the STL bidirectional iterator concept.\r
+ //////\r
+ class System::HostApiIterator\r
+ {\r
+ public:\r
+ typedef std::bidirectional_iterator_tag iterator_category;\r
+ typedef Device value_type;\r
+ typedef ptrdiff_t difference_type;\r
+ typedef HostApi * pointer;\r
+ typedef HostApi & reference;\r
+\r
+ HostApi &operator*() const;\r
+ HostApi *operator->() const;\r
+\r
+ HostApiIterator &operator++();\r
+ HostApiIterator operator++(int);\r
+ HostApiIterator &operator--();\r
+ HostApiIterator operator--(int);\r
+\r
+ bool operator==(const HostApiIterator &rhs);\r
+ bool operator!=(const HostApiIterator &rhs);\r
+\r
+ private:\r
+ friend class System;\r
+ HostApi **ptr_;\r
+ };\r
\r
\r
} // namespace portaudio\r
--- /dev/null
+# libportaudio.la - a libtool library file
+# Generated by libtool (GNU libtool) 2.4 Debian-2.4-2ubuntu1
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname=''
+
+# Names of this library.
+library_names=''
+
+# The name of the static archive.
+old_library='libportaudio.a'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -lwinmm -lole32 -luuid'
+
+# Names of additional weak libraries provided by this library
+weak_library_names=''
+
+# Version information for libportaudio.
+current=2
+age=0
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=no
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/usr/local/lib'
wxBoxSizer* mainSizer;\r
mainSizer = new wxBoxSizer( wxVERTICAL );\r
\r
- m_panel1 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );\r
+ m_audioInfo = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );\r
+ m_audioInfo->SetMinSize( wxSize( 65,65 ) );\r
+ \r
wxFlexGridSizer* fgSizer1;\r
fgSizer1 = new wxFlexGridSizer( 4, 4, 1, 1 );\r
fgSizer1->AddGrowableCol( 3 );\r
\r
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );\r
\r
- m_staticText1 = new wxStaticText( m_panel1, wxID_ANY, _("Input, Output:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );\r
+ m_staticText1 = new wxStaticText( m_audioInfo, wxID_ANY, _("Input, Output:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );\r
m_staticText1->Wrap( -1 );\r
fgSizer1->Add( m_staticText1, 1, wxALL|wxEXPAND, 5 );\r
\r
- m_comboBox1 = new wxComboBox( m_panel1, wxID_ANY, _("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); \r
- fgSizer1->Add( m_comboBox1, 1, wxALL|wxEXPAND, 5 );\r
+ wxBoxSizer* bSizer2;\r
+ bSizer2 = new wxBoxSizer( wxVERTICAL );\r
+ \r
+ bSizer2->SetMinSize( wxSize( 65,65 ) ); \r
+ m_comboBoxLeft = new wxComboBox( m_audioInfo, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_SIMPLE ); \r
+ m_comboBoxLeft->SetToolTip( _("Input Audio Interface") );\r
+ m_comboBoxLeft->SetMinSize( wxSize( 65,65 ) );\r
+ \r
+ bSizer2->Add( m_comboBoxLeft, 1, wxALL|wxEXPAND, 5 );\r
+ \r
+ \r
+ fgSizer1->Add( bSizer2, 1, wxEXPAND|wxFIXED_MINSIZE, 5 );\r
+ \r
+ wxBoxSizer* bSizer3;\r
+ bSizer3 = new wxBoxSizer( wxVERTICAL );\r
+ \r
+ bSizer3->SetMinSize( wxSize( 65,65 ) ); \r
+ m_comboBoxRight = new wxComboBox( m_audioInfo, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_SIMPLE ); \r
+ m_comboBoxRight->SetToolTip( _("Output Audio Interface") );\r
+ m_comboBoxRight->SetMinSize( wxSize( 65,65 ) );\r
+ \r
+ bSizer3->Add( m_comboBoxRight, 1, wxALL|wxEXPAND, 5 );\r
+ \r
\r
- m_comboBox2 = new wxComboBox( m_panel1, wxID_ANY, _("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); \r
- fgSizer1->Add( m_comboBox2, 1, wxALL|wxEXPAND, 5 );\r
+ fgSizer1->Add( bSizer3, 1, wxEXPAND, 5 );\r
\r
\r
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );\r
\r
- m_staticText2 = new wxStaticText( m_panel1, wxID_ANY, _("Behavor:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );\r
+ m_staticText2 = new wxStaticText( m_audioInfo, wxID_ANY, _("Behavor:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );\r
m_staticText2->Wrap( -1 );\r
- fgSizer1->Add( m_staticText2, 1, wxALL|wxEXPAND, 5 );\r
+ fgSizer1->Add( m_staticText2, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL|wxEXPAND, 5 );\r
\r
- m_gauge1 = new wxGauge( m_panel1, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL|wxGA_SMOOTH );\r
+ m_gauge1 = new wxGauge( m_audioInfo, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL|wxGA_SMOOTH );\r
fgSizer1->Add( m_gauge1, 1, wxALL|wxEXPAND, 5 );\r
\r
- m_slider1 = new wxSlider( m_panel1, wxID_ANY, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );\r
+ m_slider1 = new wxSlider( m_audioInfo, wxID_ANY, 50, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_SELRANGE|wxSL_TOP );\r
fgSizer1->Add( m_slider1, 1, wxALL|wxEXPAND, 5 );\r
\r
\r
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );\r
\r
- m_staticText5 = new wxStaticText( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );\r
+ m_staticText5 = new wxStaticText( m_audioInfo, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );\r
m_staticText5->Wrap( -1 );\r
fgSizer1->Add( m_staticText5, 1, wxALL|wxEXPAND, 5 );\r
\r
- m_toggleBtn2 = new wxToggleButton( m_panel1, wxID_ANY, _("On / Off"), wxDefaultPosition, wxDefaultSize, 0 );\r
+ m_toggleBtn2 = new wxToggleButton( m_audioInfo, wxID_ANY, _("On / Off"), wxDefaultPosition, wxDefaultSize, 0 );\r
m_toggleBtn2->SetValue( true ); \r
fgSizer1->Add( m_toggleBtn2, 1, wxALL|wxEXPAND, 5 );\r
\r
- m_toggleBtn3 = new wxToggleButton( m_panel1, wxID_ANY, _("On / Off"), wxDefaultPosition, wxDefaultSize, 0 );\r
+ m_toggleBtn3 = new wxToggleButton( m_audioInfo, wxID_ANY, _("On / Off"), wxDefaultPosition, wxDefaultSize, 0 );\r
m_toggleBtn3->SetValue( true ); \r
fgSizer1->Add( m_toggleBtn3, 0, wxALL|wxEXPAND, 5 );\r
\r
\r
fgSizer1->Add( 0, 0, 1, 0, 5 );\r
\r
- m_button1 = new wxButton( m_panel1, wxID_ANY, _("Exit"), wxDefaultPosition, wxDefaultSize, 0 );\r
+ m_button1 = new wxButton( m_audioInfo, wxID_ANY, _("Exit"), wxDefaultPosition, wxDefaultSize, 0 );\r
m_button1->SetDefault(); \r
fgSizer1->Add( m_button1, 0, wxALIGN_BOTTOM|wxALIGN_RIGHT|wxALL, 5 );\r
\r
\r
- m_panel1->SetSizer( fgSizer1 );\r
- m_panel1->Layout();\r
- fgSizer1->Fit( m_panel1 );\r
- mainSizer->Add( m_panel1, 1, wxALL|wxEXPAND, 0 );\r
+ m_audioInfo->SetSizer( fgSizer1 );\r
+ m_audioInfo->Layout();\r
+ fgSizer1->Fit( m_audioInfo );\r
+ mainSizer->Add( m_audioInfo, 1, wxALL|wxEXPAND|wxFIXED_MINSIZE, 0 );\r
\r
\r
this->SetSizer( mainSizer );\r
// Connect Events\r
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainFrameBase::OnCloseFrame ) );\r
this->Connect( menuFileExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnExitClick ) );\r
- m_comboBox1->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( MainFrameBase::OnComboLeft ), NULL, this );\r
- m_comboBox2->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( MainFrameBase::OnComboRight ), NULL, this );\r
+ m_comboBoxLeft->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( MainFrameBase::OnComboLeft ), NULL, this );\r
+ m_comboBoxRight->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( MainFrameBase::OnComboRight ), NULL, this );\r
m_slider1->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( MainFrameBase::OnScroll ), NULL, this );\r
m_slider1->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( MainFrameBase::OnScroll ), NULL, this );\r
m_slider1->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( MainFrameBase::OnScroll ), NULL, this );\r
// Disconnect Events\r
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainFrameBase::OnCloseFrame ) );\r
this->Disconnect( wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrameBase::OnExitClick ) );\r
- m_comboBox1->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( MainFrameBase::OnComboLeft ), NULL, this );\r
- m_comboBox2->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( MainFrameBase::OnComboRight ), NULL, this );\r
+ m_comboBoxLeft->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( MainFrameBase::OnComboLeft ), NULL, this );\r
+ m_comboBoxRight->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( MainFrameBase::OnComboRight ), NULL, this );\r
m_slider1->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( MainFrameBase::OnScroll ), NULL, this );\r
m_slider1->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( MainFrameBase::OnScroll ), NULL, this );\r
m_slider1->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( MainFrameBase::OnScroll ), NULL, this );\r
<FileVersion major="1" minor="11" />\r
<object class="Project" expanded="1">\r
<property name="class_decoration"></property>\r
- <property name="code_generation">C++</property>\r
+ <property name="code_generation">C++|Python|XRC</property>\r
<property name="disconnect_events">1</property>\r
<property name="disconnect_mode">source_name</property>\r
<property name="disconnect_php_events">0</property>\r
<event name="OnSetFocus"></event>\r
<event name="OnSize"></event>\r
<event name="OnUpdateUI"></event>\r
- <object class="wxMenuBar" expanded="1">\r
+ <object class="wxMenuBar" expanded="0">\r
<property name="BottomDockable">1</property>\r
<property name="LeftDockable">1</property>\r
<property name="RightDockable">1</property>\r
<event name="OnSetFocus"></event>\r
<event name="OnSize"></event>\r
<event name="OnUpdateUI"></event>\r
- <object class="wxMenu" expanded="1">\r
+ <object class="wxMenu" expanded="0">\r
<property name="label">&File</property>\r
<property name="name">m_menuFile</property>\r
<property name="permission">protected</property>\r
<property name="permission">none</property>\r
<object class="sizeritem" expanded="1">\r
<property name="border">0</property>\r
- <property name="flag">wxALL|wxEXPAND</property>\r
+ <property name="flag">wxALL|wxEXPAND|wxFIXED_MINSIZE</property>\r
<property name="proportion">1</property>\r
<object class="wxPanel" expanded="1">\r
<property name="BottomDockable">1</property>\r
<property name="maximum_size"></property>\r
<property name="min_size"></property>\r
<property name="minimize_button">0</property>\r
- <property name="minimum_size"></property>\r
+ <property name="minimum_size">65,65</property>\r
<property name="moveable">1</property>\r
- <property name="name">m_panel1</property>\r
+ <property name="name">m_audioInfo</property>\r
<property name="pane_border">1</property>\r
<property name="pane_position"></property>\r
<property name="pane_size"></property>\r
<property name="resize">Resizable</property>\r
<property name="show">1</property>\r
<property name="size"></property>\r
- <property name="subclass"></property>\r
+ <property name="subclass"> ; </property>\r
<property name="toolbar_pane">0</property>\r
<property name="tooltip"></property>\r
<property name="validator_data_type"></property>\r
<property name="permission">none</property>\r
<property name="rows">4</property>\r
<property name="vgap">1</property>\r
- <object class="sizeritem" expanded="1">\r
+ <object class="sizeritem" expanded="0">\r
<property name="border">5</property>\r
<property name="flag">wxEXPAND</property>\r
<property name="proportion">1</property>\r
- <object class="spacer" expanded="1">\r
+ <object class="spacer" expanded="0">\r
<property name="height">0</property>\r
<property name="permission">protected</property>\r
<property name="width">0</property>\r
</object>\r
</object>\r
- <object class="sizeritem" expanded="1">\r
+ <object class="sizeritem" expanded="0">\r
<property name="border">5</property>\r
<property name="flag">wxALL|wxEXPAND</property>\r
<property name="proportion">1</property>\r
- <object class="wxStaticText" expanded="1">\r
+ <object class="wxStaticText" expanded="0">\r
<property name="BottomDockable">1</property>\r
<property name="LeftDockable">1</property>\r
<property name="RightDockable">1</property>\r
</object>\r
<object class="sizeritem" expanded="1">\r
<property name="border">5</property>\r
- <property name="flag">wxALL|wxEXPAND</property>\r
+ <property name="flag">wxEXPAND|wxFIXED_MINSIZE</property>\r
<property name="proportion">1</property>\r
- <object class="wxComboBox" expanded="1">\r
- <property name="BottomDockable">1</property>\r
- <property name="LeftDockable">1</property>\r
- <property name="RightDockable">1</property>\r
- <property name="TopDockable">1</property>\r
- <property name="aui_layer"></property>\r
- <property name="aui_name"></property>\r
- <property name="aui_position"></property>\r
- <property name="aui_row"></property>\r
- <property name="best_size"></property>\r
- <property name="bg"></property>\r
- <property name="caption"></property>\r
- <property name="caption_visible">1</property>\r
- <property name="center_pane">0</property>\r
- <property name="choices"></property>\r
- <property name="close_button">1</property>\r
- <property name="context_help"></property>\r
- <property name="context_menu">1</property>\r
- <property name="default_pane">0</property>\r
- <property name="dock">Dock</property>\r
- <property name="dock_fixed">0</property>\r
- <property name="docking">Left</property>\r
- <property name="enabled">1</property>\r
- <property name="fg"></property>\r
- <property name="floatable">1</property>\r
- <property name="font"></property>\r
- <property name="gripper">0</property>\r
- <property name="hidden">0</property>\r
- <property name="id">wxID_ANY</property>\r
- <property name="max_size"></property>\r
- <property name="maximize_button">0</property>\r
- <property name="maximum_size"></property>\r
- <property name="min_size"></property>\r
- <property name="minimize_button">0</property>\r
- <property name="minimum_size"></property>\r
- <property name="moveable">1</property>\r
- <property name="name">m_comboBox1</property>\r
- <property name="pane_border">1</property>\r
- <property name="pane_position"></property>\r
- <property name="pane_size"></property>\r
- <property name="permission">protected</property>\r
- <property name="pin_button">1</property>\r
- <property name="pos"></property>\r
- <property name="resize">Resizable</property>\r
- <property name="selection">-1</property>\r
- <property name="show">1</property>\r
- <property name="size"></property>\r
- <property name="style"></property>\r
- <property name="subclass"></property>\r
- <property name="toolbar_pane">0</property>\r
- <property name="tooltip"></property>\r
- <property name="validator_data_type"></property>\r
- <property name="validator_style">wxFILTER_NONE</property>\r
- <property name="validator_type">wxDefaultValidator</property>\r
- <property name="validator_variable"></property>\r
- <property name="value">Combo!</property>\r
- <property name="window_extra_style"></property>\r
- <property name="window_name"></property>\r
- <property name="window_style"></property>\r
- <event name="OnChar"></event>\r
- <event name="OnCombobox">OnComboLeft</event>\r
- <event name="OnEnterWindow"></event>\r
- <event name="OnEraseBackground"></event>\r
- <event name="OnKeyDown"></event>\r
- <event name="OnKeyUp"></event>\r
- <event name="OnKillFocus"></event>\r
- <event name="OnLeaveWindow"></event>\r
- <event name="OnLeftDClick"></event>\r
- <event name="OnLeftDown"></event>\r
- <event name="OnLeftUp"></event>\r
- <event name="OnMiddleDClick"></event>\r
- <event name="OnMiddleDown"></event>\r
- <event name="OnMiddleUp"></event>\r
- <event name="OnMotion"></event>\r
- <event name="OnMouseEvents"></event>\r
- <event name="OnMouseWheel"></event>\r
- <event name="OnPaint"></event>\r
- <event name="OnRightDClick"></event>\r
- <event name="OnRightDown"></event>\r
- <event name="OnRightUp"></event>\r
- <event name="OnSetFocus"></event>\r
- <event name="OnSize"></event>\r
- <event name="OnText"></event>\r
- <event name="OnTextEnter"></event>\r
- <event name="OnUpdateUI"></event>\r
+ <object class="wxBoxSizer" expanded="1">\r
+ <property name="minimum_size">65,65</property>\r
+ <property name="name">bSizer2</property>\r
+ <property name="orient">wxVERTICAL</property>\r
+ <property name="permission">none</property>\r
+ <object class="sizeritem" expanded="0">\r
+ <property name="border">5</property>\r
+ <property name="flag">wxALL|wxEXPAND</property>\r
+ <property name="proportion">1</property>\r
+ <object class="wxComboBox" expanded="0">\r
+ <property name="BottomDockable">1</property>\r
+ <property name="LeftDockable">1</property>\r
+ <property name="RightDockable">1</property>\r
+ <property name="TopDockable">1</property>\r
+ <property name="aui_layer"></property>\r
+ <property name="aui_name"></property>\r
+ <property name="aui_position"></property>\r
+ <property name="aui_row"></property>\r
+ <property name="best_size"></property>\r
+ <property name="bg"></property>\r
+ <property name="caption"></property>\r
+ <property name="caption_visible">1</property>\r
+ <property name="center_pane">0</property>\r
+ <property name="choices"></property>\r
+ <property name="close_button">1</property>\r
+ <property name="context_help"></property>\r
+ <property name="context_menu">1</property>\r
+ <property name="default_pane">0</property>\r
+ <property name="dock">Dock</property>\r
+ <property name="dock_fixed">0</property>\r
+ <property name="docking">Left</property>\r
+ <property name="enabled">1</property>\r
+ <property name="fg"></property>\r
+ <property name="floatable">1</property>\r
+ <property name="font"></property>\r
+ <property name="gripper">0</property>\r
+ <property name="hidden">0</property>\r
+ <property name="id">wxID_ANY</property>\r
+ <property name="max_size"></property>\r
+ <property name="maximize_button">0</property>\r
+ <property name="maximum_size"></property>\r
+ <property name="min_size"></property>\r
+ <property name="minimize_button">0</property>\r
+ <property name="minimum_size">65,65</property>\r
+ <property name="moveable">1</property>\r
+ <property name="name">m_comboBoxLeft</property>\r
+ <property name="pane_border">1</property>\r
+ <property name="pane_position"></property>\r
+ <property name="pane_size"></property>\r
+ <property name="permission">protected</property>\r
+ <property name="pin_button">1</property>\r
+ <property name="pos"></property>\r
+ <property name="resize">Resizable</property>\r
+ <property name="selection">-1</property>\r
+ <property name="show">1</property>\r
+ <property name="size"></property>\r
+ <property name="style">wxCB_SIMPLE</property>\r
+ <property name="subclass"></property>\r
+ <property name="toolbar_pane">0</property>\r
+ <property name="tooltip">Input Audio Interface</property>\r
+ <property name="validator_data_type"></property>\r
+ <property name="validator_style">wxFILTER_NONE</property>\r
+ <property name="validator_type">wxDefaultValidator</property>\r
+ <property name="validator_variable"></property>\r
+ <property name="value"></property>\r
+ <property name="window_extra_style"></property>\r
+ <property name="window_name"></property>\r
+ <property name="window_style"></property>\r
+ <event name="OnChar"></event>\r
+ <event name="OnCombobox">OnComboLeft</event>\r
+ <event name="OnEnterWindow"></event>\r
+ <event name="OnEraseBackground"></event>\r
+ <event name="OnKeyDown"></event>\r
+ <event name="OnKeyUp"></event>\r
+ <event name="OnKillFocus"></event>\r
+ <event name="OnLeaveWindow"></event>\r
+ <event name="OnLeftDClick"></event>\r
+ <event name="OnLeftDown"></event>\r
+ <event name="OnLeftUp"></event>\r
+ <event name="OnMiddleDClick"></event>\r
+ <event name="OnMiddleDown"></event>\r
+ <event name="OnMiddleUp"></event>\r
+ <event name="OnMotion"></event>\r
+ <event name="OnMouseEvents"></event>\r
+ <event name="OnMouseWheel"></event>\r
+ <event name="OnPaint"></event>\r
+ <event name="OnRightDClick"></event>\r
+ <event name="OnRightDown"></event>\r
+ <event name="OnRightUp"></event>\r
+ <event name="OnSetFocus"></event>\r
+ <event name="OnSize"></event>\r
+ <event name="OnText"></event>\r
+ <event name="OnTextEnter"></event>\r
+ <event name="OnUpdateUI"></event>\r
+ </object>\r
+ </object>\r
</object>\r
</object>\r
<object class="sizeritem" expanded="1">\r
<property name="border">5</property>\r
- <property name="flag">wxALL|wxEXPAND</property>\r
+ <property name="flag">wxEXPAND</property>\r
<property name="proportion">1</property>\r
- <object class="wxComboBox" expanded="1">\r
- <property name="BottomDockable">1</property>\r
- <property name="LeftDockable">1</property>\r
- <property name="RightDockable">1</property>\r
- <property name="TopDockable">1</property>\r
- <property name="aui_layer"></property>\r
- <property name="aui_name"></property>\r
- <property name="aui_position"></property>\r
- <property name="aui_row"></property>\r
- <property name="best_size"></property>\r
- <property name="bg"></property>\r
- <property name="caption"></property>\r
- <property name="caption_visible">1</property>\r
- <property name="center_pane">0</property>\r
- <property name="choices"></property>\r
- <property name="close_button">1</property>\r
- <property name="context_help"></property>\r
- <property name="context_menu">1</property>\r
- <property name="default_pane">0</property>\r
- <property name="dock">Dock</property>\r
- <property name="dock_fixed">0</property>\r
- <property name="docking">Left</property>\r
- <property name="enabled">1</property>\r
- <property name="fg"></property>\r
- <property name="floatable">1</property>\r
- <property name="font"></property>\r
- <property name="gripper">0</property>\r
- <property name="hidden">0</property>\r
- <property name="id">wxID_ANY</property>\r
- <property name="max_size"></property>\r
- <property name="maximize_button">0</property>\r
- <property name="maximum_size"></property>\r
- <property name="min_size"></property>\r
- <property name="minimize_button">0</property>\r
- <property name="minimum_size"></property>\r
- <property name="moveable">1</property>\r
- <property name="name">m_comboBox2</property>\r
- <property name="pane_border">1</property>\r
- <property name="pane_position"></property>\r
- <property name="pane_size"></property>\r
- <property name="permission">protected</property>\r
- <property name="pin_button">1</property>\r
- <property name="pos"></property>\r
- <property name="resize">Resizable</property>\r
- <property name="selection">-1</property>\r
- <property name="show">1</property>\r
- <property name="size"></property>\r
- <property name="style"></property>\r
- <property name="subclass"></property>\r
- <property name="toolbar_pane">0</property>\r
- <property name="tooltip"></property>\r
- <property name="validator_data_type"></property>\r
- <property name="validator_style">wxFILTER_NONE</property>\r
- <property name="validator_type">wxDefaultValidator</property>\r
- <property name="validator_variable"></property>\r
- <property name="value">Combo!</property>\r
- <property name="window_extra_style"></property>\r
- <property name="window_name"></property>\r
- <property name="window_style"></property>\r
- <event name="OnChar"></event>\r
- <event name="OnCombobox">OnComboRight</event>\r
- <event name="OnEnterWindow"></event>\r
- <event name="OnEraseBackground"></event>\r
- <event name="OnKeyDown"></event>\r
- <event name="OnKeyUp"></event>\r
- <event name="OnKillFocus"></event>\r
- <event name="OnLeaveWindow"></event>\r
- <event name="OnLeftDClick"></event>\r
- <event name="OnLeftDown"></event>\r
- <event name="OnLeftUp"></event>\r
- <event name="OnMiddleDClick"></event>\r
- <event name="OnMiddleDown"></event>\r
- <event name="OnMiddleUp"></event>\r
- <event name="OnMotion"></event>\r
- <event name="OnMouseEvents"></event>\r
- <event name="OnMouseWheel"></event>\r
- <event name="OnPaint"></event>\r
- <event name="OnRightDClick"></event>\r
- <event name="OnRightDown"></event>\r
- <event name="OnRightUp"></event>\r
- <event name="OnSetFocus"></event>\r
- <event name="OnSize"></event>\r
- <event name="OnText"></event>\r
- <event name="OnTextEnter"></event>\r
- <event name="OnUpdateUI"></event>\r
+ <object class="wxBoxSizer" expanded="1">\r
+ <property name="minimum_size">65,65</property>\r
+ <property name="name">bSizer3</property>\r
+ <property name="orient">wxVERTICAL</property>\r
+ <property name="permission">none</property>\r
+ <object class="sizeritem" expanded="0">\r
+ <property name="border">5</property>\r
+ <property name="flag">wxALL|wxEXPAND</property>\r
+ <property name="proportion">1</property>\r
+ <object class="wxComboBox" expanded="0">\r
+ <property name="BottomDockable">1</property>\r
+ <property name="LeftDockable">1</property>\r
+ <property name="RightDockable">1</property>\r
+ <property name="TopDockable">1</property>\r
+ <property name="aui_layer"></property>\r
+ <property name="aui_name"></property>\r
+ <property name="aui_position"></property>\r
+ <property name="aui_row"></property>\r
+ <property name="best_size"></property>\r
+ <property name="bg"></property>\r
+ <property name="caption"></property>\r
+ <property name="caption_visible">1</property>\r
+ <property name="center_pane">0</property>\r
+ <property name="choices"></property>\r
+ <property name="close_button">1</property>\r
+ <property name="context_help"></property>\r
+ <property name="context_menu">1</property>\r
+ <property name="default_pane">0</property>\r
+ <property name="dock">Dock</property>\r
+ <property name="dock_fixed">0</property>\r
+ <property name="docking">Left</property>\r
+ <property name="enabled">1</property>\r
+ <property name="fg"></property>\r
+ <property name="floatable">1</property>\r
+ <property name="font"></property>\r
+ <property name="gripper">0</property>\r
+ <property name="hidden">0</property>\r
+ <property name="id">wxID_ANY</property>\r
+ <property name="max_size"></property>\r
+ <property name="maximize_button">0</property>\r
+ <property name="maximum_size"></property>\r
+ <property name="min_size"></property>\r
+ <property name="minimize_button">0</property>\r
+ <property name="minimum_size">65,65</property>\r
+ <property name="moveable">1</property>\r
+ <property name="name">m_comboBoxRight</property>\r
+ <property name="pane_border">1</property>\r
+ <property name="pane_position"></property>\r
+ <property name="pane_size"></property>\r
+ <property name="permission">protected</property>\r
+ <property name="pin_button">1</property>\r
+ <property name="pos"></property>\r
+ <property name="resize">Resizable</property>\r
+ <property name="selection">-1</property>\r
+ <property name="show">1</property>\r
+ <property name="size"></property>\r
+ <property name="style">wxCB_SIMPLE</property>\r
+ <property name="subclass"></property>\r
+ <property name="toolbar_pane">0</property>\r
+ <property name="tooltip">Output Audio Interface</property>\r
+ <property name="validator_data_type"></property>\r
+ <property name="validator_style">wxFILTER_NONE</property>\r
+ <property name="validator_type">wxDefaultValidator</property>\r
+ <property name="validator_variable"></property>\r
+ <property name="value"></property>\r
+ <property name="window_extra_style"></property>\r
+ <property name="window_name"></property>\r
+ <property name="window_style"></property>\r
+ <event name="OnChar"></event>\r
+ <event name="OnCombobox">OnComboRight</event>\r
+ <event name="OnEnterWindow"></event>\r
+ <event name="OnEraseBackground"></event>\r
+ <event name="OnKeyDown"></event>\r
+ <event name="OnKeyUp"></event>\r
+ <event name="OnKillFocus"></event>\r
+ <event name="OnLeaveWindow"></event>\r
+ <event name="OnLeftDClick"></event>\r
+ <event name="OnLeftDown"></event>\r
+ <event name="OnLeftUp"></event>\r
+ <event name="OnMiddleDClick"></event>\r
+ <event name="OnMiddleDown"></event>\r
+ <event name="OnMiddleUp"></event>\r
+ <event name="OnMotion"></event>\r
+ <event name="OnMouseEvents"></event>\r
+ <event name="OnMouseWheel"></event>\r
+ <event name="OnPaint"></event>\r
+ <event name="OnRightDClick"></event>\r
+ <event name="OnRightDown"></event>\r
+ <event name="OnRightUp"></event>\r
+ <event name="OnSetFocus"></event>\r
+ <event name="OnSize"></event>\r
+ <event name="OnText"></event>\r
+ <event name="OnTextEnter"></event>\r
+ <event name="OnUpdateUI"></event>\r
+ </object>\r
+ </object>\r
</object>\r
</object>\r
- <object class="sizeritem" expanded="1">\r
+ <object class="sizeritem" expanded="0">\r
<property name="border">5</property>\r
<property name="flag">wxEXPAND</property>\r
<property name="proportion">1</property>\r
- <object class="spacer" expanded="1">\r
+ <object class="spacer" expanded="0">\r
<property name="height">0</property>\r
<property name="permission">protected</property>\r
<property name="width">0</property>\r
</object>\r
</object>\r
- <object class="sizeritem" expanded="1">\r
+ <object class="sizeritem" expanded="0">\r
<property name="border">5</property>\r
- <property name="flag">wxALL|wxEXPAND</property>\r
+ <property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL|wxEXPAND</property>\r
<property name="proportion">1</property>\r
- <object class="wxStaticText" expanded="1">\r
+ <object class="wxStaticText" expanded="0">\r
<property name="BottomDockable">1</property>\r
<property name="LeftDockable">1</property>\r
<property name="RightDockable">1</property>\r
<event name="OnUpdateUI"></event>\r
</object>\r
</object>\r
- <object class="sizeritem" expanded="1">\r
+ <object class="sizeritem" expanded="0">\r
<property name="border">5</property>\r
<property name="flag">wxALL|wxEXPAND</property>\r
<property name="proportion">1</property>\r
- <object class="wxGauge" expanded="1">\r
+ <object class="wxGauge" expanded="0">\r
<property name="BottomDockable">1</property>\r
<property name="LeftDockable">1</property>\r
<property name="RightDockable">1</property>\r
<event name="OnUpdateUI"></event>\r
</object>\r
</object>\r
- <object class="sizeritem" expanded="1">\r
+ <object class="sizeritem" expanded="0">\r
<property name="border">5</property>\r
<property name="flag">wxALL|wxEXPAND</property>\r
<property name="proportion">1</property>\r
- <object class="wxSlider" expanded="1">\r
+ <object class="wxSlider" expanded="0">\r
<property name="BottomDockable">1</property>\r
<property name="LeftDockable">1</property>\r
<property name="RightDockable">1</property>\r
<property name="resize">Resizable</property>\r
<property name="show">1</property>\r
<property name="size"></property>\r
- <property name="style">wxSL_HORIZONTAL</property>\r
+ <property name="style">wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_SELRANGE|wxSL_TOP</property>\r
<property name="subclass"></property>\r
<property name="toolbar_pane">0</property>\r
<property name="tooltip"></property>\r
<event name="OnUpdateUI"></event>\r
</object>\r
</object>\r
- <object class="sizeritem" expanded="1">\r
+ <object class="sizeritem" expanded="0">\r
<property name="border">5</property>\r
<property name="flag">wxEXPAND</property>\r
<property name="proportion">1</property>\r
- <object class="spacer" expanded="1">\r
+ <object class="spacer" expanded="0">\r
<property name="height">0</property>\r
<property name="permission">protected</property>\r
<property name="width">0</property>\r
</object>\r
</object>\r
- <object class="sizeritem" expanded="1">\r
+ <object class="sizeritem" expanded="0">\r
<property name="border">5</property>\r
<property name="flag">wxALL|wxEXPAND</property>\r
<property name="proportion">1</property>\r
- <object class="wxStaticText" expanded="1">\r
+ <object class="wxStaticText" expanded="0">\r
<property name="BottomDockable">1</property>\r
<property name="LeftDockable">1</property>\r
<property name="RightDockable">1</property>\r
<event name="OnUpdateUI"></event>\r
</object>\r
</object>\r
- <object class="sizeritem" expanded="1">\r
+ <object class="sizeritem" expanded="0">\r
<property name="border">5</property>\r
<property name="flag">wxALL|wxEXPAND</property>\r
<property name="proportion">1</property>\r
- <object class="wxToggleButton" expanded="1">\r
+ <object class="wxToggleButton" expanded="0">\r
<property name="BottomDockable">1</property>\r
<property name="LeftDockable">1</property>\r
<property name="RightDockable">1</property>\r
<event name="OnUpdateUI"></event>\r
</object>\r
</object>\r
- <object class="sizeritem" expanded="1">\r
+ <object class="sizeritem" expanded="0">\r
<property name="border">5</property>\r
<property name="flag">wxALL|wxEXPAND</property>\r
<property name="proportion">0</property>\r
- <object class="wxToggleButton" expanded="1">\r
+ <object class="wxToggleButton" expanded="0">\r
<property name="BottomDockable">1</property>\r
<property name="LeftDockable">1</property>\r
<property name="RightDockable">1</property>\r
<event name="OnUpdateUI"></event>\r
</object>\r
</object>\r
- <object class="sizeritem" expanded="1">\r
+ <object class="sizeritem" expanded="0">\r
<property name="border">5</property>\r
<property name="flag"></property>\r
<property name="proportion">1</property>\r
- <object class="spacer" expanded="1">\r
+ <object class="spacer" expanded="0">\r
<property name="height">0</property>\r
<property name="permission">protected</property>\r
<property name="width">0</property>\r
</object>\r
</object>\r
- <object class="sizeritem" expanded="1">\r
+ <object class="sizeritem" expanded="0">\r
<property name="border">5</property>\r
<property name="flag"></property>\r
<property name="proportion">1</property>\r
- <object class="spacer" expanded="1">\r
+ <object class="spacer" expanded="0">\r
<property name="height">0</property>\r
<property name="permission">protected</property>\r
<property name="width">0</property>\r
</object>\r
</object>\r
- <object class="sizeritem" expanded="1">\r
+ <object class="sizeritem" expanded="0">\r
<property name="border">5</property>\r
<property name="flag"></property>\r
<property name="proportion">1</property>\r
- <object class="spacer" expanded="1">\r
+ <object class="spacer" expanded="0">\r
<property name="height">0</property>\r
<property name="permission">protected</property>\r
<property name="width">0</property>\r
</object>\r
</object>\r
- <object class="sizeritem" expanded="1">\r
+ <object class="sizeritem" expanded="0">\r
<property name="border">5</property>\r
<property name="flag">wxALIGN_BOTTOM|wxALIGN_RIGHT|wxALL</property>\r
<property name="proportion">0</property>\r
- <object class="wxButton" expanded="1">\r
+ <object class="wxButton" expanded="0">\r
<property name="BottomDockable">1</property>\r
<property name="LeftDockable">1</property>\r
<property name="RightDockable">1</property>\r
#include <wx/settings.h>\r
#include <wx/stattext.h>\r
#include <wx/combobox.h>\r
+#include <wx/sizer.h>\r
#include <wx/gauge.h>\r
#include <wx/slider.h>\r
#include <wx/tglbtn.h>\r
#include <wx/button.h>\r
-#include <wx/sizer.h>\r
#include <wx/panel.h>\r
#include <wx/statusbr.h>\r
#include <wx/frame.h>\r
protected:\r
wxMenuBar* m_menuBar;\r
wxMenu* m_menuFile;\r
- wxPanel* m_panel1;\r
+ wxPanel* m_audioInfo;\r
wxStaticText* m_staticText1;\r
- wxComboBox* m_comboBox1;\r
- wxComboBox* m_comboBox2;\r
+ wxComboBox* m_comboBoxLeft;\r
+ wxComboBox* m_comboBoxRight;\r
wxStaticText* m_staticText2;\r
wxGauge* m_gauge1;\r
wxSlider* m_slider1;\r
{\r
Destroy();\r
}\r
+\r
+void MainFrame::printSupportedStandardSampleRates(
+ const portaudio::DirectionSpecificStreamParameters &inputParameters,
+ const portaudio::DirectionSpecificStreamParameters &outputParameters)
+{
+ static double STANDARD_SAMPLE_RATES[] = {
+ 8000.0,
+ 9600.0,
+ 11025.0,
+ 12000.0,
+ 16000.0,
+ 22050.0,
+ 24000.0,
+ 32000.0,
+ 44100.0,
+ 48000.0,
+ 88200.0,
+ 96000.0,
+ 192000.0,
+ -1
+ }; // negative terminated list
+
+ int printCount = 0;
+
+ for (int i = 0; STANDARD_SAMPLE_RATES[i] > 0; ++i)
+ {
+ portaudio::StreamParameters tmp = portaudio::StreamParameters(inputParameters, outputParameters, STANDARD_SAMPLE_RATES[i], 0, paNoFlag);
+ if (tmp.isSupported())
+ {
+ if (printCount == 0)
+ {
+ std::cout << " " << STANDARD_SAMPLE_RATES[i]; // 8.2
+ printCount = 1;
+ }
+ else if (printCount == 4)
+ {
+ std::cout << "," << std::endl;
+ std::cout << " " << STANDARD_SAMPLE_RATES[i]; // 8.2
+ printCount = 1;
+ }
+ else
+ {
+ std::cout << ", " << STANDARD_SAMPLE_RATES[i]; // 8.2
+ ++printCount;
+ }
+ }
+ }
+ if (printCount == 0)
+ {
+ std::cout << "None" << std::endl;
+ }
+ else
+ {
+ std::cout << std::endl;
+ }
+}
+
+int MainFrame::populateAudioInfo()
+{
+
+ try
+ {
+ portaudio::AutoSystem autoSys;
+ portaudio::System &sys = portaudio::System::instance();
+
+ std::cout << "PortAudio version number = " << sys.version() << std::endl;
+ std::cout << "PortAudio version text = '" << sys.versionText() << "'" << std::endl;
+
+ int numDevices = sys.deviceCount();
+ std::cout << "Number of devices = " << numDevices << std::endl;
+
+ for (portaudio::System::DeviceIterator i = sys.devicesBegin(); i != sys.devicesEnd(); ++i)
+ {
+ std::cout << "--------------------------------------- device #" << (*i).index() << std::endl;
+
+ // Mark global and API specific default devices:
+ bool defaultDisplayed = false;
+
+ if ((*i).isSystemDefaultInputDevice())
+ {
+ std::cout << "[ Default Input";
+ defaultDisplayed = true;
+ }
+ else if ((*i).isHostApiDefaultInputDevice())
+ {
+ std::cout << "[ Default " << (*i).hostApi().name() << " Input";
+ defaultDisplayed = true;
+ }
+ if ((*i).isSystemDefaultOutputDevice())
+ {
+ std::cout << (defaultDisplayed ? "," : "[");
+ std::cout << " Default Output";
+ defaultDisplayed = true;
+ }
+ else if ((*i).isHostApiDefaultOutputDevice())
+ {
+ std::cout << (defaultDisplayed ? "," : "[");
+ std::cout << " Default " << (*i).hostApi().name() << " Output";
+ defaultDisplayed = true;
+ }
+ if (defaultDisplayed)
+ {
+ std::cout << " ]" << std::endl;
+ }
+ // Print device info:
+ std::cout << "Name = " << (*i).name() << std::endl;
+ std::cout << "Host API = " << (*i).hostApi().name() << std::endl;
+ std::cout << "Max inputs = " << (*i).maxInputChannels() << ", Max outputs = " << (*i).maxOutputChannels() << std::endl;
+
+ std::cout << "Default low input latency = " << (*i).defaultLowInputLatency() << std::endl; // 8.3
+ std::cout << "Default low output latency = " << (*i).defaultLowOutputLatency() << std::endl; // 8.3
+ std::cout << "Default high input latency = " << (*i).defaultHighInputLatency() << std::endl; // 8.3
+ std::cout << "Default high output latency = " << (*i).defaultHighOutputLatency() << std::endl; // 8.3
+
+#ifdef WIN32
+ // ASIO specific latency information:
+ if ((*i).hostApi().typeId() == paASIO)
+ {
+ portaudio::AsioDeviceAdapter asioDevice((*i));
+
+ std::cout << "ASIO minimum buffer size = " << asioDevice.minBufferSize() << std::endl;
+ std::cout << "ASIO maximum buffer size = " << asioDevice.maxBufferSize() << std::endl;
+ std::cout << "ASIO preferred buffer size = " << asioDevice.preferredBufferSize() << std::endl;
+
+ if (asioDevice.granularity() == -1)
+ {
+ std::cout << "ASIO buffer granularity = power of 2" << std::endl;
+ }
+ else
+ {
+ std::cout << "ASIO buffer granularity = " << asioDevice.granularity() << std::endl;
+ }
+ }
+#endif // WIN32
+
+ std::cout << "Default sample rate = " << (*i).defaultSampleRate() << std::endl; // 8.2
+
+ // Poll for standard sample rates:
+ portaudio::DirectionSpecificStreamParameters inputParameters((*i), (*i).maxInputChannels(), portaudio::INT16, true, 0.0, NULL);
+ portaudio::DirectionSpecificStreamParameters outputParameters((*i), (*i).maxOutputChannels(), portaudio::INT16, true, 0.0, NULL);
+ if (inputParameters.numChannels() > 0)
+ {
+ std::cout << "Supported standard sample rates" << std::endl;
+ std::cout << " for half-duplex 16 bit " << inputParameters.numChannels() << " channel input = " << std::endl;
+ printSupportedStandardSampleRates(inputParameters, portaudio::DirectionSpecificStreamParameters::null());
+ }
+ if (outputParameters.numChannels() > 0)
+ {
+ std::cout << "Supported standard sample rates" << std::endl;
+ std::cout << " for half-duplex 16 bit " << outputParameters.numChannels() << " channel output = " << std::endl;
+ printSupportedStandardSampleRates(portaudio::DirectionSpecificStreamParameters::null(), outputParameters);
+ }
+ if (inputParameters.numChannels() > 0 && outputParameters.numChannels() > 0)
+ {
+ std::cout << "Supported standard sample rates" << std::endl;
+ std::cout << " for full-duplex 16 bit " << inputParameters.numChannels() << " channel input, " << outputParameters.numChannels() << " channel output = " << std::endl;
+ printSupportedStandardSampleRates(inputParameters, outputParameters);
+ }
+ }
+ std::cout << "----------------------------------------------" << std::endl;
+ }
+ catch (const portaudio::PaException &e)
+ {
+ std::cout << "A PortAudio error occured: " << e.paErrorText() << std::endl;
+ }
+ catch (const portaudio::PaCppException &e)
+ {
+ std::cout << "A PortAudioCpp error occured: " << e.what() << std::endl;
+ }
+ catch (const std::exception &e)
+ {
+ std::cout << "A generic exception occured: " << e.what() << std::endl;
+ }
+ catch (...)
+ {
+ std::cout << "An unknown exception occured." << std::endl;
+ }
+ return 0;
+}
+
+\r
* Notes: Note that all GUI creation code is declared in
* gui.h source file which is generated by wxFormBuilder.
*********************************************************************/
-
#ifndef __main__
#define __main__
// main wxWidgets header file
#include <wx/wx.h>
#include <portaudio.h>
-#include <PortAudioCpp.hxx>
+#include "portaudiocpp/PortAudioCpp.hxx"
+#ifdef WIN32
+#include "../extern/include/portaudiocpp/AsioDeviceAdapter.hxx"
+#endif
// gui classes generated by wxFormBuilder
#include "gui.h"
// protected event handlers
virtual void OnCloseFrame(wxCloseEvent& event);
virtual void OnExitClick(wxCommandEvent& event);
+ void printSupportedStandardSampleRates(
+ const portaudio::DirectionSpecificStreamParameters &inputParameters,
+ const portaudio::DirectionSpecificStreamParameters &outputParameters);
+ int populateAudioInfo();
};
#endif //__main__
CmpOptions := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) $(Preprocessors)\r
C_CmpOptions := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) $(Preprocessors)\r
LinkOptions := -mwindows -s $(shell wx-config --debug=no --libs --unicode=yes)\r
-IncludePath := $(IncludeSwitch). $(IncludeSwitch)./ $(IncludeSwitch)../extern/include/ $(IncludeSwitch)../pa_cpp_binding/ \r
+IncludePath := $(IncludeSwitch). $(IncludeSwitch)./ $(IncludeSwitch)C:/bin/MinGW/msys/1.0/local/include $(IncludeSwitch)./portaudiocpp \r
IncludePCH := \r
RcIncludePath := \r
-Libs := \r
-LibPath := $(LibraryPathSwitch). \r
+Libs := $(LibrarySwitch)portaudiocpp.la $(LibrarySwitch)portaudio.la \r
+LibPath := $(LibraryPathSwitch). $(LibraryPathSwitch). $(LibraryPathSwitch)../../extern/lib/ \r
\r
\r
##\r
<CodeLite_Project Name="pa_cppbinding_test" InternalType="GUI">
<Plugins>
<Plugin Name="qmake">
- <![CDATA[00010001N0007Release000000000000]]>
+ <![CDATA[00020001N0005Debug0000000000000001N0007Release000000000000]]>
</Plugin>
</Plugins>
<Description/>
<VirtualDirectory Name="include">
<File Name="gui.h"/>
<File Name="main.h"/>
- <File Name="../pa_cpp_binding/AsioDeviceAdapter.hxx"/>
- <File Name="../pa_cpp_binding/AutoSystem.hxx"/>
- <File Name="../pa_cpp_binding/BlockingStream.hxx"/>
- <File Name="../pa_cpp_binding/CallbackInterface.hxx"/>
- <File Name="../pa_cpp_binding/CallbackStream.hxx"/>
- <File Name="../pa_cpp_binding/CFunCallbackStream.hxx"/>
- <File Name="../pa_cpp_binding/CppFunCallbackStream.hxx"/>
- <File Name="../pa_cpp_binding/Device.hxx"/>
- <File Name="../pa_cpp_binding/DirectionSpecificStreamParameters.hxx"/>
- <File Name="../pa_cpp_binding/Exception.hxx"/>
- <File Name="../pa_cpp_binding/HostApi.hxx"/>
- <File Name="../pa_cpp_binding/InterfaceCallbackStream.hxx"/>
- <File Name="../pa_cpp_binding/MemFunCallbackStream.hxx"/>
- <File Name="../pa_cpp_binding/PortAudioCpp.hxx"/>
- <File Name="../pa_cpp_binding/SampleDataFormat.hxx"/>
- <File Name="../pa_cpp_binding/Stream.hxx"/>
- <File Name="../pa_cpp_binding/StreamParameters.hxx"/>
- <File Name="../pa_cpp_binding/System.hxx"/>
- <File Name="../pa_cpp_binding/SystemDeviceIterator.hxx"/>
- <File Name="../pa_cpp_binding/SystemHostApiIterator.hxx"/>
+ <VirtualDirectory Name="cpp_binding">
+ <File Name="../extern/include/portaudiocpp/AsioDeviceAdapter.hxx"/>
+ <File Name="../extern/include/portaudiocpp/AutoSystem.hxx"/>
+ <File Name="../extern/include/portaudiocpp/BlockingStream.hxx"/>
+ <File Name="../extern/include/portaudiocpp/CallbackInterface.hxx"/>
+ <File Name="../extern/include/portaudiocpp/CallbackStream.hxx"/>
+ <File Name="../extern/include/portaudiocpp/CFunCallbackStream.hxx"/>
+ <File Name="../extern/include/portaudiocpp/CppFunCallbackStream.hxx"/>
+ <File Name="../extern/include/portaudiocpp/Device.hxx"/>
+ <File Name="../extern/include/portaudiocpp/DirectionSpecificStreamParameters.hxx"/>
+ <File Name="../extern/include/portaudiocpp/Exception.hxx"/>
+ <File Name="../extern/include/portaudiocpp/HostApi.hxx"/>
+ <File Name="../extern/include/portaudiocpp/InterfaceCallbackStream.hxx"/>
+ <File Name="../extern/include/portaudiocpp/MemFunCallbackStream.hxx"/>
+ <File Name="../extern/include/portaudiocpp/PortAudioCpp.hxx"/>
+ <File Name="../extern/include/portaudiocpp/SampleDataFormat.hxx"/>
+ <File Name="../extern/include/portaudiocpp/Stream.hxx"/>
+ <File Name="../extern/include/portaudiocpp/StreamParameters.hxx"/>
+ <File Name="../extern/include/portaudiocpp/System.hxx"/>
+ <File Name="../extern/include/portaudiocpp/SystemDeviceIterator.hxx"/>
+ <File Name="../extern/include/portaudiocpp/SystemHostApiIterator.hxx"/>
+ </VirtualDirectory>
</VirtualDirectory>
<VirtualDirectory Name="resources">
<File Name="gui.fbp"/>
<Compiler Options="-g;-O0;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=yes)" C_Options="-g;-O0;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=yes)" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
<Preprocessor Value="__WX__"/>
</Compiler>
- <Linker Options="-mwindows;$(shell wx-config --debug=yes --libs --unicode=yes)" Required="yes"/>
+ <Linker Options="-mwindows;$(shell wx-config --debug=yes --libs --unicode=yes)" Required="yes">
+ <LibraryPath Value="../extern/lib"/>
+ <Library Value="libportaudio.dll"/>
+ <Library Value="libportaudiocpp.dll.a"/>
+ </Linker>
<ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
<General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Debug" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
<Environment EnvVarSetName="<Use Defaults>" DbgSetName="<Use Defaults>">
<Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
<Compiler Options="-O2;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=no)" C_Options="-O2;-Wall;$(shell wx-config --cxxflags --unicode=yes --debug=no)" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
<IncludePath Value="./"/>
- <IncludePath Value="../extern/include/"/>
- <IncludePath Value="../pa_cpp_binding/"/>
+ <IncludePath Value="C:/bin/MinGW/msys/1.0/local/include"/>
+ <IncludePath Value="./portaudiocpp"/>
<Preprocessor Value="__WX__"/>
</Compiler>
- <Linker Options="-mwindows;-s;$(shell wx-config --debug=no --libs --unicode=yes)" Required="yes"/>
+ <Linker Options="-mwindows;-s;$(shell wx-config --debug=no --libs --unicode=yes)" Required="yes">
+ <LibraryPath Value="."/>
+ <LibraryPath Value="../../extern/lib/"/>
+ <Library Value="libportaudiocpp.la"/>
+ <Library Value="libportaudio.la"/>
+ </Linker>
<ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/>
<General OutputFile="$(IntermediateDirectory)/$(ProjectName)" IntermediateDirectory="./Release" Command="./$(ProjectName)" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
<Environment EnvVarSetName="<Use Defaults>" DbgSetName="<Use Defaults>">