More work with portaudiocpp
authorwittend99 <wittend99@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 17 May 2012 15:03:24 +0000 (15:03 +0000)
committerwittend99 <wittend99@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 17 May 2012 15:03:24 +0000 (15:03 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@471 01035d8c-6547-0410-b346-abe4f91aad63

50 files changed:
fdmdv2/extern/include/portaudiocpp/AsioDeviceAdapter.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/AutoSystem.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/BlockingStream.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/CFunCallbackStream.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/CallbackInterface.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/CallbackStream.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/CppFunCallbackStream.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/Device.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/DirectionSpecificStreamParameters.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/Exception.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/HostApi.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/InterfaceCallbackStream.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/MemFunCallbackStream.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/PortAudioCpp.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/SampleDataFormat.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/Stream.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/StreamParameters.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/System.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/SystemDeviceIterator.hxx [new file with mode: 0644]
fdmdv2/extern/include/portaudiocpp/SystemHostApiIterator.hxx [new file with mode: 0644]
fdmdv2/fdmdv2.mk
fdmdv2/fdmdv2.project
fdmdv2/fdmdv2.workspace
fdmdv2/fdmdv2_main.h
fdmdv2/fdmdv2_thread_audio.cpp [new file with mode: 0644]
fdmdv2/fdmdv2_thread_audio.h [new file with mode: 0644]
fdmdv2/fdmdv2_wsp.mk
fdmdv2/pa_cpp_binding/AsioDeviceAdapter.hxx [deleted file]
fdmdv2/pa_cpp_binding/AutoSystem.hxx [deleted file]
fdmdv2/pa_cpp_binding/BlockingStream.hxx [deleted file]
fdmdv2/pa_cpp_binding/CFunCallbackStream.hxx [deleted file]
fdmdv2/pa_cpp_binding/CallbackInterface.hxx [deleted file]
fdmdv2/pa_cpp_binding/CallbackStream.hxx [deleted file]
fdmdv2/pa_cpp_binding/CppFunCallbackStream.hxx [deleted file]
fdmdv2/pa_cpp_binding/Device.hxx [deleted file]
fdmdv2/pa_cpp_binding/DirectionSpecificStreamParameters.hxx [deleted file]
fdmdv2/pa_cpp_binding/Exception.hxx [deleted file]
fdmdv2/pa_cpp_binding/HostApi.hxx [deleted file]
fdmdv2/pa_cpp_binding/InterfaceCallbackStream.hxx [deleted file]
fdmdv2/pa_cpp_binding/MemFunCallbackStream.hxx [deleted file]
fdmdv2/pa_cpp_binding/PortAudioCpp.hxx [deleted file]
fdmdv2/pa_cpp_binding/SampleDataFormat.hxx [deleted file]
fdmdv2/pa_cpp_binding/Stream.hxx [deleted file]
fdmdv2/pa_cpp_binding/StreamParameters.hxx [deleted file]
fdmdv2/pa_cpp_binding/System.hxx [deleted file]
fdmdv2/pa_cpp_binding/SystemDeviceIterator.hxx [deleted file]
fdmdv2/pa_cpp_binding/SystemHostApiIterator.hxx [deleted file]
fdmdv2/pa_test/pa_test.project
fdmdv2/thread_audio.cpp
fdmdv2/thread_audio.h

diff --git a/fdmdv2/extern/include/portaudiocpp/AsioDeviceAdapter.hxx b/fdmdv2/extern/include/portaudiocpp/AsioDeviceAdapter.hxx
new file mode 100644 (file)
index 0000000..1964b6a
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef INCLUDED_PORTAUDIO_ASIODEVICEADAPTER_HXX
+#define INCLUDED_PORTAUDIO_ASIODEVICEADAPTER_HXX
+
+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_;
+       };
+}
+
+#endif // INCLUDED_PORTAUDIO_ASIODEVICEADAPTER_HXX
diff --git a/fdmdv2/extern/include/portaudiocpp/AutoSystem.hxx b/fdmdv2/extern/include/portaudiocpp/AutoSystem.hxx
new file mode 100644 (file)
index 0000000..16cac5e
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef INCLUDED_PORTAUDIO_AUTOSYSTEM_HXX\r
+#define INCLUDED_PORTAUDIO_AUTOSYSTEM_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include "portaudiocpp/System.hxx"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+namespace portaudio\r
+{\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
+#endif // INCLUDED_PORTAUDIO_AUTOSYSTEM_HXX\r
diff --git a/fdmdv2/extern/include/portaudiocpp/BlockingStream.hxx b/fdmdv2/extern/include/portaudiocpp/BlockingStream.hxx
new file mode 100644 (file)
index 0000000..37fa766
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef INCLUDED_PORTAUDIO_BLOCKINGSTREAM_HXX\r
+#define INCLUDED_PORTAUDIO_BLOCKINGSTREAM_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include "portaudiocpp/Stream.hxx"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+namespace portaudio\r
+{\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 &parameters);\r
+               ~BlockingStream();\r
+\r
+               void open(const StreamParameters &parameters);\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
+} // portaudio\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#endif // INCLUDED_PORTAUDIO_BLOCKINGSTREAM_HXX\r
+\r
diff --git a/fdmdv2/extern/include/portaudiocpp/CFunCallbackStream.hxx b/fdmdv2/extern/include/portaudiocpp/CFunCallbackStream.hxx
new file mode 100644 (file)
index 0000000..b3e3b5c
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef INCLUDED_PORTAUDIO_CFUNCALLBACKSTREAM_HXX\r
+#define INCLUDED_PORTAUDIO_CFUNCALLBACKSTREAM_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include "portaudio.h"\r
+\r
+#include "portaudiocpp/CallbackStream.hxx"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Forward declaration(s)\r
+namespace portaudio\r
+{\r
+       class StreamParameters;\r
+}\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 &parameters, PaStreamCallback *funPtr, void *userData);\r
+               ~CFunCallbackStream();\r
+               \r
+               void open(const StreamParameters &parameters, 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
+#endif // INCLUDED_PORTAUDIO_MEMFUNCALLBACKSTREAM_HXX\r
+\r
diff --git a/fdmdv2/extern/include/portaudiocpp/CallbackInterface.hxx b/fdmdv2/extern/include/portaudiocpp/CallbackInterface.hxx
new file mode 100644 (file)
index 0000000..d498ec5
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef INCLUDED_PORTAUDIO_CALLBACKINTERFACE_HXX\r
+#define INCLUDED_PORTAUDIO_CALLBACKINTERFACE_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include "portaudio.h"\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
+} // namespace portaudio\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#endif // INCLUDED_PORTAUDIO_CALLBACKINTERFACE_HXX\r
diff --git a/fdmdv2/extern/include/portaudiocpp/CallbackStream.hxx b/fdmdv2/extern/include/portaudiocpp/CallbackStream.hxx
new file mode 100644 (file)
index 0000000..0382275
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef INCLUDED_PORTAUDIO_CALLBACKSTREAM_HXX\r
+#define INCLUDED_PORTAUDIO_CALLBACKSTREAM_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include "portaudio.h"\r
+\r
+#include "portaudiocpp/Stream.hxx"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Declaration(s):\r
+namespace portaudio\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
+\r
+} // namespace portaudio\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#endif // INCLUDED_PORTAUDIO_CALLBACKSTREAM_HXX\r
diff --git a/fdmdv2/extern/include/portaudiocpp/CppFunCallbackStream.hxx b/fdmdv2/extern/include/portaudiocpp/CppFunCallbackStream.hxx
new file mode 100644 (file)
index 0000000..e0c0012
--- /dev/null
@@ -0,0 +1,86 @@
+#ifndef INCLUDED_PORTAUDIO_CPPFUNCALLBACKSTREAM_HXX\r
+#define INCLUDED_PORTAUDIO_CPPFUNCALLBACKSTREAM_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include "portaudio.h"\r
+\r
+#include "portaudiocpp/CallbackStream.hxx"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Forward declaration(s):\r
+namespace portaudio\r
+{\r
+       class StreamParameters;\r
+}\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Declaration(s):\r
+namespace portaudio\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 &parameters, CallbackFunPtr funPtr, void *userData);\r
+               ~FunCallbackStream();\r
+\r
+               void open(const StreamParameters &parameters, 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 &parameters);\r
+       };\r
+\r
+\r
+} // portaudio\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#endif // INCLUDED_PORTAUDIO_CPPFUNCALLBACKSTREAM_HXX\r
diff --git a/fdmdv2/extern/include/portaudiocpp/Device.hxx b/fdmdv2/extern/include/portaudiocpp/Device.hxx
new file mode 100644 (file)
index 0000000..ffde7aa
--- /dev/null
@@ -0,0 +1,91 @@
+#ifndef INCLUDED_PORTAUDIO_DEVICE_HXX\r
+#define INCLUDED_PORTAUDIO_DEVICE_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include <iterator>\r
+\r
+#include "portaudio.h"\r
+\r
+#include "portaudiocpp/SampleDataFormat.hxx"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Forward declaration(s):\r
+namespace portaudio\r
+{\r
+       class System;\r
+       class HostApi;\r
+}\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Declaration(s):\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
+} // namespace portaudio\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#endif // INCLUDED_PORTAUDIO_DEVICE_HXX\r
+\r
diff --git a/fdmdv2/extern/include/portaudiocpp/DirectionSpecificStreamParameters.hxx b/fdmdv2/extern/include/portaudiocpp/DirectionSpecificStreamParameters.hxx
new file mode 100644 (file)
index 0000000..dd5ae0b
--- /dev/null
@@ -0,0 +1,77 @@
+#ifndef INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX\r
+#define INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include <cstddef>\r
+\r
+#include "portaudio.h"\r
+\r
+#include "portaudiocpp/System.hxx"\r
+#include "portaudiocpp/SampleDataFormat.hxx"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Forward declaration(s):\r
+namespace portaudio\r
+{\r
+       class Device;\r
+}\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Declaration(s):\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
+               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
+\r
+               void setSampleFormat(SampleDataFormat format, bool interleaved = true);\r
+               void setHostApiSpecificSampleFormat(PaSampleFormat format, bool interleaved = true);\r
+\r
+               void setSuggestedLatency(PaTime latency);\r
+\r
+               void setHostApiSpecificStreamInfo(void *streamInfo);\r
+\r
+               // Accessor methods:\r
+               PaStreamParameters *paStreamParameters();\r
+               const PaStreamParameters *paStreamParameters() const;\r
+\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
+\r
+               PaTime suggestedLatency() const;\r
+\r
+               void *hostApiSpecificStreamInfo() const;\r
+       \r
+       private:\r
+               PaStreamParameters paStreamParameters_;\r
+       };\r
+\r
+\r
+} // namespace portaudio\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#endif // INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX\r
diff --git a/fdmdv2/extern/include/portaudiocpp/Exception.hxx b/fdmdv2/extern/include/portaudiocpp/Exception.hxx
new file mode 100644 (file)
index 0000000..a70c2f1
--- /dev/null
@@ -0,0 +1,108 @@
+#ifndef INCLUDED_PORTAUDIO_EXCEPTION_HXX\r
+#define INCLUDED_PORTAUDIO_EXCEPTION_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include <exception>\r
+\r
+#include "portaudio.h"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\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
+\r
+} // namespace portaudio\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#endif // INCLUDED_PORTAUDIO_EXCEPTION_HXX\r
+\r
diff --git a/fdmdv2/extern/include/portaudiocpp/HostApi.hxx b/fdmdv2/extern/include/portaudiocpp/HostApi.hxx
new file mode 100644 (file)
index 0000000..899fc42
--- /dev/null
@@ -0,0 +1,76 @@
+#ifndef INCLUDED_PORTAUDIO_HOSTAPI_HXX\r
+#define INCLUDED_PORTAUDIO_HOSTAPI_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include "portaudio.h"\r
+\r
+#include "portaudiocpp/System.hxx"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Forward declaration(s):\r
+namespace portaudio\r
+{\r
+       class Device;\r
+}\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Declaration(s):\r
+namespace portaudio\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
+\r
+}\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#endif // INCLUDED_PORTAUDIO_HOSTAPI_HXX\r
+\r
diff --git a/fdmdv2/extern/include/portaudiocpp/InterfaceCallbackStream.hxx b/fdmdv2/extern/include/portaudiocpp/InterfaceCallbackStream.hxx
new file mode 100644 (file)
index 0000000..e496dd2
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef INCLUDED_PORTAUDIO_INTERFACECALLBACKSTREAM_HXX\r
+#define INCLUDED_PORTAUDIO_INTERFACECALLBACKSTREAM_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include "portaudio.h"\r
+\r
+#include "portaudiocpp/CallbackStream.hxx"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Forward declaration(s)\r
+namespace portaudio\r
+{\r
+       class StreamParameters;\r
+       class CallbackInterface;\r
+}\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Declaration(s):\r
+namespace portaudio\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 &parameters, CallbackInterface &instance);\r
+               ~InterfaceCallbackStream();\r
+               \r
+               void open(const StreamParameters &parameters, 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
+#endif // INCLUDED_PORTAUDIO_INTERFACECALLBACKSTREAM_HXX\r
diff --git a/fdmdv2/extern/include/portaudiocpp/MemFunCallbackStream.hxx b/fdmdv2/extern/include/portaudiocpp/MemFunCallbackStream.hxx
new file mode 100644 (file)
index 0000000..a9e50ca
--- /dev/null
@@ -0,0 +1,107 @@
+#ifndef INCLUDED_PORTAUDIO_MEMFUNCALLBACKSTREAM_HXX\r
+#define INCLUDED_PORTAUDIO_MEMFUNCALLBACKSTREAM_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include "portaudio.h"\r
+\r
+#include "portaudiocpp/CallbackStream.hxx"\r
+#include "portaudiocpp/CallbackInterface.hxx"\r
+#include "portaudiocpp/StreamParameters.hxx"\r
+#include "portaudiocpp/Exception.hxx"\r
+#include "portaudiocpp/InterfaceCallbackStream.hxx"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+namespace 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 &parameters, 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 &parameters, 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 &parameters)\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
+// ---------------------------------------------------------------------------------------\r
+\r
+#endif // INCLUDED_PORTAUDIO_MEMFUNCALLBACKSTREAM_HXX\r
diff --git a/fdmdv2/extern/include/portaudiocpp/PortAudioCpp.hxx b/fdmdv2/extern/include/portaudiocpp/PortAudioCpp.hxx
new file mode 100644 (file)
index 0000000..f11e7fb
--- /dev/null
@@ -0,0 +1,109 @@
+#ifndef INCLUDED_PORTAUDIO_PORTAUDIOCPP_HXX\r
+#define INCLUDED_PORTAUDIO_PORTAUDIOCPP_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+//////\r
+/// @mainpage PortAudioCpp\r
+///\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
+///   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
+///   no additional features were added except for some `convenience methods'.\r
+/// </p>\r
+/// <p>\r
+///   PortAudioCpp's main features are:\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
+///     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
+///   examples can easily be modified to compile without needing ASIO.\r
+/// </p>\r
+/// <p>\r
+///   Supported platforms:\r
+///   <ul>\r
+///     <li>Microsoft Visual C++ 6.0, 7.0 (.NET 2002) and 7.1 (.NET 2003).</li>\r
+///     <li>GNU G++ 2.95 and G++ 3.3.</li>\r
+///   </ul>\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
+///   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
+///   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
+/// <p>\r
+///   <a href="http://www.portaudio.com/">Official PortAudio site.</a><br>\r
+/// </p>\r
+//////\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\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
+/// alias like ``namespace pa = portaudio;''.\r
+//////\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+//////\r
+/// @file PortAudioCpp.hxx\r
+/// An include-all header file (for lazy programmers and using pre-compiled headers).\r
+//////\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include "portaudio.h"\r
+\r
+#include "portaudiocpp/AutoSystem.hxx"\r
+#include "portaudiocpp/BlockingStream.hxx"\r
+#include "portaudiocpp/CallbackInterface.hxx"\r
+#include "portaudiocpp/CallbackStream.hxx"\r
+#include "portaudiocpp/CFunCallbackStream.hxx"\r
+#include "portaudiocpp/CppFunCallbackStream.hxx"\r
+#include "portaudiocpp/Device.hxx"\r
+#include "portaudiocpp/Exception.hxx"\r
+#include "portaudiocpp/HostApi.hxx"\r
+#include "portaudiocpp/InterfaceCallbackStream.hxx"\r
+#include "portaudiocpp/MemFunCallbackStream.hxx"\r
+#include "portaudiocpp/SampleDataFormat.hxx"\r
+#include "portaudiocpp/DirectionSpecificStreamParameters.hxx"\r
+#include "portaudiocpp/Stream.hxx"\r
+#include "portaudiocpp/StreamParameters.hxx"\r
+#include "portaudiocpp/System.hxx"\r
+#include "portaudiocpp/SystemDeviceIterator.hxx"\r
+#include "portaudiocpp/SystemHostApiIterator.hxx"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#endif // INCLUDED_PORTAUDIO_PORTAUDIOCPP_HXX\r
diff --git a/fdmdv2/extern/include/portaudiocpp/SampleDataFormat.hxx b/fdmdv2/extern/include/portaudiocpp/SampleDataFormat.hxx
new file mode 100644 (file)
index 0000000..a7e25b2
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef INCLUDED_PORTAUDIO_SAMPLEDATAFORMAT_HXX\r
+#define INCLUDED_PORTAUDIO_SAMPLEDATAFORMAT_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include "portaudio.h"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+namespace portaudio\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
+\r
+} // namespace portaudio\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#endif // INCLUDED_PORTAUDIO_SAMPLEDATAFORMAT_HXX\r
diff --git a/fdmdv2/extern/include/portaudiocpp/Stream.hxx b/fdmdv2/extern/include/portaudiocpp/Stream.hxx
new file mode 100644 (file)
index 0000000..8a255ec
--- /dev/null
@@ -0,0 +1,82 @@
+#ifndef INCLUDED_PORTAUDIO_STREAM_HXX\r
+#define INCLUDED_PORTAUDIO_STREAM_HXX\r
+\r
+#include "portaudio.h"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Forward declaration(s):\r
+namespace portaudio\r
+{\r
+       class StreamParameters;\r
+}\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Declaration(s):\r
+namespace portaudio\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
+\r
+} // namespace portaudio\r
+\r
+\r
+#endif // INCLUDED_PORTAUDIO_STREAM_HXX\r
+\r
diff --git a/fdmdv2/extern/include/portaudiocpp/StreamParameters.hxx b/fdmdv2/extern/include/portaudiocpp/StreamParameters.hxx
new file mode 100644 (file)
index 0000000..2b6aa2e
--- /dev/null
@@ -0,0 +1,77 @@
+#ifndef INCLUDED_PORTAUDIO_STREAMPARAMETERS_HXX\r
+#define INCLUDED_PORTAUDIO_STREAMPARAMETERS_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include "portaudio.h"\r
+\r
+#include "portaudiocpp/DirectionSpecificStreamParameters.hxx"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Declaration(s):\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 &parameters);\r
+               void setOutputParameters(const DirectionSpecificStreamParameters &parameters);\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
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#endif // INCLUDED_PORTAUDIO_STREAMPARAMETERS_HXX\r
diff --git a/fdmdv2/extern/include/portaudiocpp/System.hxx b/fdmdv2/extern/include/portaudiocpp/System.hxx
new file mode 100644 (file)
index 0000000..f5fb713
--- /dev/null
@@ -0,0 +1,107 @@
+#ifndef INCLUDED_PORTAUDIO_SYSTEM_HXX\r
+#define INCLUDED_PORTAUDIO_SYSTEM_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include "portaudio.h"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Forward declaration(s):\r
+namespace portaudio\r
+{\r
+       class Device;\r
+       class Stream;\r
+       class HostApi;\r
+}\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Declaration(s):\r
+namespace portaudio\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
+               // -------------------------------------------------------------------------------\r
+\r
+               static int version();\r
+               static const char *versionText();\r
+\r
+               static void initialize();\r
+               static void terminate();\r
+\r
+               static System &instance();\r
+               static bool exists();\r
+\r
+               // -------------------------------------------------------------------------------\r
+\r
+               // host apis:\r
+               HostApiIterator hostApisBegin();\r
+               HostApiIterator hostApisEnd();\r
+\r
+               HostApi &defaultHostApi();\r
+\r
+               HostApi &hostApiByTypeId(PaHostApiTypeId type);\r
+               HostApi &hostApiByIndex(PaHostApiIndex index);\r
+\r
+               int hostApiCount();\r
+\r
+               // -------------------------------------------------------------------------------\r
+\r
+               // devices:\r
+               DeviceIterator devicesBegin();\r
+               DeviceIterator devicesEnd();\r
+\r
+               Device &defaultInputDevice();\r
+               Device &defaultOutputDevice();\r
+\r
+               Device &deviceByIndex(PaDeviceIndex index);\r
+\r
+               int deviceCount();\r
+\r
+               static Device &nullDevice();\r
+\r
+               // -------------------------------------------------------------------------------\r
+\r
+               // misc:\r
+               void sleep(long msec);\r
+               int sizeOfSample(PaSampleFormat format);\r
+\r
+       private:\r
+               System();\r
+               ~System();\r
+\r
+               static System *instance_;\r
+               static int initCount_;\r
+\r
+               static HostApi **hostApis_;\r
+               static Device **devices_;\r
+\r
+               static Device *nullDevice_;\r
+       };\r
+\r
+\r
+} // namespace portaudio\r
+\r
+\r
+#endif // INCLUDED_PORTAUDIO_SYSTEM_HXX\r
+\r
diff --git a/fdmdv2/extern/include/portaudiocpp/SystemDeviceIterator.hxx b/fdmdv2/extern/include/portaudiocpp/SystemDeviceIterator.hxx
new file mode 100644 (file)
index 0000000..613fc3d
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef INCLUDED_PORTAUDIO_SYSTEMDEVICEITERATOR_HXX\r
+#define INCLUDED_PORTAUDIO_SYSTEMDEVICEITERATOR_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include <iterator>\r
+#include <cstddef>\r
+\r
+#include "portaudiocpp/System.hxx"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Forward declaration(s):\r
+namespace portaudio\r
+{\r
+       class Device;\r
+       class HostApi;\r
+}\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Declaration(s):\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
+} // namespace portaudio\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#endif // INCLUDED_PORTAUDIO_SYSTEMDEVICEITERATOR_HXX\r
+\r
diff --git a/fdmdv2/extern/include/portaudiocpp/SystemHostApiIterator.hxx b/fdmdv2/extern/include/portaudiocpp/SystemHostApiIterator.hxx
new file mode 100644 (file)
index 0000000..b9b13b8
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef INCLUDED_PORTAUDIO_SYSTEMHOSTAPIITERATOR_HXX\r
+#define INCLUDED_PORTAUDIO_SYSTEMHOSTAPIITERATOR_HXX\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#include <iterator>\r
+#include <cstddef>\r
+\r
+#include "portaudiocpp/System.hxx"\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Forward declaration(s):\r
+namespace portaudio\r
+{\r
+       class HostApi;\r
+}\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+// Declaration(s):\r
+namespace portaudio\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
+\r
+} // namespace portaudio\r
+\r
+// ---------------------------------------------------------------------------------------\r
+\r
+#endif // INCLUDED_PORTAUDIO_SYSTEMHOSTAPIITERATOR_HXX\r
index 85b3e0ebe95b962c669cd6c2586a5fcbdd28c397..8dc37dadb291c4bb36ae7bd9a19e61c773c0cf8b 100644 (file)
@@ -13,7 +13,7 @@ CurrentFileName        :=
 CurrentFilePath        :=\r
 CurrentFileFullPath    :=\r
 User                   :=wittend\r
-Date                   :=5/13/2012\r
+Date                   :=5/17/2012\r
 CodeLitePath           :="C:\Program Files\CodeLite"\r
 LinkerName             :=g++\r
 ArchiveTool            :=ar rcus\r
@@ -56,7 +56,7 @@ WXWIN:=C:\bin\wxWidgets-2.9.2
 PATH:=$(WXWIN)\lib\gcc_dll;$(PATH)\r
 WXCFG:=gcc_dll\mswu\r
 UNIT_TEST_PP_SRC_DIR:=C:\bin\UnitTest++-1.3\r
-Objects=$(IntermediateDirectory)/topFrame$(ObjectSuffix) $(IntermediateDirectory)/dlg_about$(ObjectSuffix) $(IntermediateDirectory)/dlg_audio$(ObjectSuffix) $(IntermediateDirectory)/dlg_options$(ObjectSuffix) $(IntermediateDirectory)/dlg_comports$(ObjectSuffix) $(IntermediateDirectory)/fdmdv2_plot$(ObjectSuffix) $(IntermediateDirectory)/fdmdv2_main$(ObjectSuffix) \r
+Objects=$(IntermediateDirectory)/topFrame$(ObjectSuffix) $(IntermediateDirectory)/dlg_about$(ObjectSuffix) $(IntermediateDirectory)/dlg_audio$(ObjectSuffix) $(IntermediateDirectory)/dlg_options$(ObjectSuffix) $(IntermediateDirectory)/dlg_comports$(ObjectSuffix) $(IntermediateDirectory)/fdmdv2_plot$(ObjectSuffix) $(IntermediateDirectory)/fdmdv2_main$(ObjectSuffix) $(IntermediateDirectory)/thread_audio$(ObjectSuffix) $(IntermediateDirectory)/fdmdv2_thread_audio$(ObjectSuffix) \r
 \r
 ##\r
 ## Main Build Targets \r
@@ -135,6 +135,22 @@ $(IntermediateDirectory)/fdmdv2_main$(DependSuffix): fdmdv2_main.cpp
 $(IntermediateDirectory)/fdmdv2_main$(PreprocessSuffix): fdmdv2_main.cpp\r
        @$(CompilerName) $(CmpOptions) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/fdmdv2_main$(PreprocessSuffix) "C:/Users/wittend/Projects/Radio/fdmdv2/fdmdv2_main.cpp"\r
 \r
+$(IntermediateDirectory)/thread_audio$(ObjectSuffix): thread_audio.cpp $(IntermediateDirectory)/thread_audio$(DependSuffix)\r
+       $(CompilerName) $(IncludePCH) $(SourceSwitch) "C:/Users/wittend/Projects/Radio/fdmdv2/thread_audio.cpp" $(CmpOptions) $(ObjectSwitch)$(IntermediateDirectory)/thread_audio$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/thread_audio$(DependSuffix): thread_audio.cpp\r
+       @$(CompilerName) $(CmpOptions) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/thread_audio$(ObjectSuffix) -MF$(IntermediateDirectory)/thread_audio$(DependSuffix) -MM "C:/Users/wittend/Projects/Radio/fdmdv2/thread_audio.cpp"\r
+\r
+$(IntermediateDirectory)/thread_audio$(PreprocessSuffix): thread_audio.cpp\r
+       @$(CompilerName) $(CmpOptions) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/thread_audio$(PreprocessSuffix) "C:/Users/wittend/Projects/Radio/fdmdv2/thread_audio.cpp"\r
+\r
+$(IntermediateDirectory)/fdmdv2_thread_audio$(ObjectSuffix): fdmdv2_thread_audio.cpp $(IntermediateDirectory)/fdmdv2_thread_audio$(DependSuffix)\r
+       $(CompilerName) $(IncludePCH) $(SourceSwitch) "C:/Users/wittend/Projects/Radio/fdmdv2/fdmdv2_thread_audio.cpp" $(CmpOptions) $(ObjectSwitch)$(IntermediateDirectory)/fdmdv2_thread_audio$(ObjectSuffix) $(IncludePath)\r
+$(IntermediateDirectory)/fdmdv2_thread_audio$(DependSuffix): fdmdv2_thread_audio.cpp\r
+       @$(CompilerName) $(CmpOptions) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/fdmdv2_thread_audio$(ObjectSuffix) -MF$(IntermediateDirectory)/fdmdv2_thread_audio$(DependSuffix) -MM "C:/Users/wittend/Projects/Radio/fdmdv2/fdmdv2_thread_audio.cpp"\r
+\r
+$(IntermediateDirectory)/fdmdv2_thread_audio$(PreprocessSuffix): fdmdv2_thread_audio.cpp\r
+       @$(CompilerName) $(CmpOptions) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/fdmdv2_thread_audio$(PreprocessSuffix) "C:/Users/wittend/Projects/Radio/fdmdv2/fdmdv2_thread_audio.cpp"\r
+\r
 \r
 -include $(IntermediateDirectory)/*$(DependSuffix)\r
 ##\r
@@ -162,6 +178,12 @@ clean:
        $(RM) $(IntermediateDirectory)/fdmdv2_main$(ObjectSuffix)\r
        $(RM) $(IntermediateDirectory)/fdmdv2_main$(DependSuffix)\r
        $(RM) $(IntermediateDirectory)/fdmdv2_main$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/thread_audio$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/thread_audio$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/thread_audio$(PreprocessSuffix)\r
+       $(RM) $(IntermediateDirectory)/fdmdv2_thread_audio$(ObjectSuffix)\r
+       $(RM) $(IntermediateDirectory)/fdmdv2_thread_audio$(DependSuffix)\r
+       $(RM) $(IntermediateDirectory)/fdmdv2_thread_audio$(PreprocessSuffix)\r
        $(RM) $(OutputFile)\r
        $(RM) $(OutputFile).exe\r
        $(RM) "C:\Users\wittend\Projects\Radio\fdmdv2\.build-release\fdmdv2"\r
index 1a55b90b8808bd26ad07af4b3e572be18354399c..883aea66bd3614a25112493689c87e9161c5eb53 100644 (file)
@@ -15,6 +15,8 @@
     <File Name="dlg_comports.cpp"/>
     <File Name="fdmdv2_plot.cpp"/>
     <File Name="fdmdv2_main.cpp"/>
+    <File Name="thread_audio.cpp"/>
+    <File Name="fdmdv2_thread_audio.cpp"/>
   </VirtualDirectory>
   <VirtualDirectory Name="include">
     <File Name="topFrame.h"/>
@@ -24,6 +26,8 @@
     <File Name="dlg_comports.h"/>
     <File Name="fdmdv2_plot.h"/>
     <File Name="fdmdv2_main.h"/>
+    <File Name="thread_audio.h"/>
+    <File Name="fdmdv2_thread_audio.h"/>
   </VirtualDirectory>
   <VirtualDirectory Name="resources">
     <File Name="FDMDV2.fbp"/>
index 748741c324022d917b7b2822cd60400e54923ab1..9254a85e1dd01f46cf5a16d1643c0a8d2df358c4 100644 (file)
@@ -2,7 +2,9 @@
 <CodeLite_Workspace Name="fdmdv2" Database="./fdmdv2.tags">
   <Project Name="test_portaudio" Path="libsndfile/Projects/w32-mingw/test_sndfile.project" Active="No"/>
   <Project Name="test_hamlib" Path="hamlib-3.0/test_hamlib/test_hamlib.project" Active="No"/>
-  <Project Name="fdmdv2" Path="fdmdv2.project" Active="Yes"/>
+  <Project Name="fdmdv2" Path="fdmdv2.project" Active="No"/>
+  <Project Name="pa_test" Path="pa_test/pa_test.project" Active="No"/>
+  <Project Name="pa_cppbinding_test" Path="pa_cppbinding_test/pa_cppbinding_test.project" Active="Yes"/>
   <BuildMatrix>
     <WorkspaceConfiguration Name="Debug" Selected="no">
       <Project Name="test_sndfile" ConfigName="Debug"/>
@@ -11,6 +13,8 @@
       <Project Name="test_hamlib" ConfigName="Debug"/>
       <Project Name="librs232" ConfigName="Debug"/>
       <Project Name="fdmdv2" ConfigName="Debug"/>
+      <Project Name="pa_test" ConfigName="Debug"/>
+      <Project Name="pa_cppbinding_test" ConfigName="Debug"/>
     </WorkspaceConfiguration>
     <WorkspaceConfiguration Name="Release" Selected="yes">
       <Project Name="test_sndfile" ConfigName="Release"/>
@@ -19,6 +23,8 @@
       <Project Name="test_hamlib" ConfigName="Release"/>
       <Project Name="librs232" ConfigName="Release"/>
       <Project Name="fdmdv2" ConfigName="Release"/>
+      <Project Name="pa_test" ConfigName="Release"/>
+      <Project Name="pa_cppbinding_test" ConfigName="Release"/>
     </WorkspaceConfiguration>
   </BuildMatrix>
 </CodeLite_Workspace>
index b13f6e7d229723754626b822efeb2fb3bffb06c8..08f03fdaf1eb0aff2980cd205d4b3b10ba3a1b81 100644 (file)
@@ -30,6 +30,7 @@
 #include "dlg_options.h"\r
 #include "dlg_comports.h"\r
 #include "fdmdv2_plot.h"
+#include "fdmdv2_thread_audio.h"
 
 #define WAV_FILE wxT("doggrowl.wav")
 \r
@@ -85,7 +86,7 @@ class MainFrame : public TopFrame
         void OnThreadCompletion(wxThreadEvent&);\r
 \r
     protected:\r
-        MyThread *m_pThread;\r
+        Fdmdv2ThreadAudio *m_pThread;\r
         wxCriticalSection m_pThreadCS;    // protects the m_pThread pointer\r
         // protected event handlers
         virtual void OnCloseFrame(wxCloseEvent& event);
diff --git a/fdmdv2/fdmdv2_thread_audio.cpp b/fdmdv2/fdmdv2_thread_audio.cpp
new file mode 100644 (file)
index 0000000..4d17ea4
--- /dev/null
@@ -0,0 +1,30 @@
+#include "fdmdv2_thread_audio.h"
+
+//namespace NSfdmdv2Audio
+//{
+
+    Fdmdv2ThreadAudio::Fdmdv2ThreadAudio()
+    {
+    }
+
+    Fdmdv2ThreadAudio::~Fdmdv2ThreadAudio()
+    {
+    }
+
+    void* Fdmdv2ThreadAudio::Entry()
+    {
+        return NULL;
+    }
+    void Fdmdv2ThreadAudio::OnDelete()
+    {
+    }
+    void Fdmdv2ThreadAudio::OnExit()
+    {
+    }
+    void Fdmdv2ThreadAudio::OnKill()
+    {
+    }
+//    bool Fdmdv2ThreadAudio::TestDestroy()
+//    {
+//    }
+//}
diff --git a/fdmdv2/fdmdv2_thread_audio.h b/fdmdv2/fdmdv2_thread_audio.h
new file mode 100644 (file)
index 0000000..d96221f
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef __THREAD_AUDIO__
+#define __THREAD_AUDIO__
+#include "wx/thread.h"     // Base class: wxThread
+
+//namespace NSfdmdv2Audio
+//{
+    class Fdmdv2ThreadAudio : public wxThread
+    {
+        public:
+            Fdmdv2ThreadAudio();
+            ~Fdmdv2ThreadAudio();
+        public:
+            virtual void* Entry();
+            virtual void OnDelete();
+            virtual void OnExit();
+            virtual void OnKill();
+            virtual bool TestDestroy();
+    };
+//}
+#endif // __THREAD_AUDIO__
index 661439a3e53524f4a5ec6b028d5d3bd7f4945da1..13bc5fdcbc912874d4e5ccdbebfbdfe926d81bad 100644 (file)
@@ -1,8 +1,8 @@
 .PHONY: clean All
 
 All:
-       @echo ----------Building project:[ test_hamlib - Release ]----------
-       @cd "hamlib-3.0\test_hamlib" && "mingw32-make.exe"  -j 2 -f "test_hamlib.mk"
+       @echo ----------Building project:[ pa_cppbinding_test - Release ]----------
+       @cd "pa_cppbinding_test" && "mingw32-make.exe"  -j 2 -f "pa_cppbinding_test.mk"
 clean:
-       @echo ----------Cleaning project:[ test_hamlib - Release ]----------
-       @cd "hamlib-3.0\test_hamlib" && "mingw32-make.exe"  -j 2 -f "test_hamlib.mk" clean
+       @echo ----------Cleaning project:[ pa_cppbinding_test - Release ]----------
+       @cd "pa_cppbinding_test" && "mingw32-make.exe"  -j 2 -f "pa_cppbinding_test.mk" clean
diff --git a/fdmdv2/pa_cpp_binding/AsioDeviceAdapter.hxx b/fdmdv2/pa_cpp_binding/AsioDeviceAdapter.hxx
deleted file mode 100644 (file)
index 1964b6a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_ASIODEVICEADAPTER_HXX
-#define INCLUDED_PORTAUDIO_ASIODEVICEADAPTER_HXX
-
-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_;
-       };
-}
-
-#endif // INCLUDED_PORTAUDIO_ASIODEVICEADAPTER_HXX
diff --git a/fdmdv2/pa_cpp_binding/AutoSystem.hxx b/fdmdv2/pa_cpp_binding/AutoSystem.hxx
deleted file mode 100644 (file)
index 16cac5e..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_AUTOSYSTEM_HXX\r
-#define INCLUDED_PORTAUDIO_AUTOSYSTEM_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include "portaudiocpp/System.hxx"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-namespace portaudio\r
-{\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
-#endif // INCLUDED_PORTAUDIO_AUTOSYSTEM_HXX\r
diff --git a/fdmdv2/pa_cpp_binding/BlockingStream.hxx b/fdmdv2/pa_cpp_binding/BlockingStream.hxx
deleted file mode 100644 (file)
index 37fa766..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_BLOCKINGSTREAM_HXX\r
-#define INCLUDED_PORTAUDIO_BLOCKINGSTREAM_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include "portaudiocpp/Stream.hxx"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-namespace portaudio\r
-{\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 &parameters);\r
-               ~BlockingStream();\r
-\r
-               void open(const StreamParameters &parameters);\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
-} // portaudio\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#endif // INCLUDED_PORTAUDIO_BLOCKINGSTREAM_HXX\r
-\r
diff --git a/fdmdv2/pa_cpp_binding/CFunCallbackStream.hxx b/fdmdv2/pa_cpp_binding/CFunCallbackStream.hxx
deleted file mode 100644 (file)
index b3e3b5c..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_CFUNCALLBACKSTREAM_HXX\r
-#define INCLUDED_PORTAUDIO_CFUNCALLBACKSTREAM_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include "portaudio.h"\r
-\r
-#include "portaudiocpp/CallbackStream.hxx"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Forward declaration(s)\r
-namespace portaudio\r
-{\r
-       class StreamParameters;\r
-}\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 &parameters, PaStreamCallback *funPtr, void *userData);\r
-               ~CFunCallbackStream();\r
-               \r
-               void open(const StreamParameters &parameters, 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
-#endif // INCLUDED_PORTAUDIO_MEMFUNCALLBACKSTREAM_HXX\r
-\r
diff --git a/fdmdv2/pa_cpp_binding/CallbackInterface.hxx b/fdmdv2/pa_cpp_binding/CallbackInterface.hxx
deleted file mode 100644 (file)
index d498ec5..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_CALLBACKINTERFACE_HXX\r
-#define INCLUDED_PORTAUDIO_CALLBACKINTERFACE_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include "portaudio.h"\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
-} // namespace portaudio\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#endif // INCLUDED_PORTAUDIO_CALLBACKINTERFACE_HXX\r
diff --git a/fdmdv2/pa_cpp_binding/CallbackStream.hxx b/fdmdv2/pa_cpp_binding/CallbackStream.hxx
deleted file mode 100644 (file)
index 0382275..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_CALLBACKSTREAM_HXX\r
-#define INCLUDED_PORTAUDIO_CALLBACKSTREAM_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include "portaudio.h"\r
-\r
-#include "portaudiocpp/Stream.hxx"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Declaration(s):\r
-namespace portaudio\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
-\r
-} // namespace portaudio\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#endif // INCLUDED_PORTAUDIO_CALLBACKSTREAM_HXX\r
diff --git a/fdmdv2/pa_cpp_binding/CppFunCallbackStream.hxx b/fdmdv2/pa_cpp_binding/CppFunCallbackStream.hxx
deleted file mode 100644 (file)
index e0c0012..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_CPPFUNCALLBACKSTREAM_HXX\r
-#define INCLUDED_PORTAUDIO_CPPFUNCALLBACKSTREAM_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include "portaudio.h"\r
-\r
-#include "portaudiocpp/CallbackStream.hxx"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Forward declaration(s):\r
-namespace portaudio\r
-{\r
-       class StreamParameters;\r
-}\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Declaration(s):\r
-namespace portaudio\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 &parameters, CallbackFunPtr funPtr, void *userData);\r
-               ~FunCallbackStream();\r
-\r
-               void open(const StreamParameters &parameters, 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 &parameters);\r
-       };\r
-\r
-\r
-} // portaudio\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#endif // INCLUDED_PORTAUDIO_CPPFUNCALLBACKSTREAM_HXX\r
diff --git a/fdmdv2/pa_cpp_binding/Device.hxx b/fdmdv2/pa_cpp_binding/Device.hxx
deleted file mode 100644 (file)
index ffde7aa..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_DEVICE_HXX\r
-#define INCLUDED_PORTAUDIO_DEVICE_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include <iterator>\r
-\r
-#include "portaudio.h"\r
-\r
-#include "portaudiocpp/SampleDataFormat.hxx"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Forward declaration(s):\r
-namespace portaudio\r
-{\r
-       class System;\r
-       class HostApi;\r
-}\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Declaration(s):\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
-} // namespace portaudio\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#endif // INCLUDED_PORTAUDIO_DEVICE_HXX\r
-\r
diff --git a/fdmdv2/pa_cpp_binding/DirectionSpecificStreamParameters.hxx b/fdmdv2/pa_cpp_binding/DirectionSpecificStreamParameters.hxx
deleted file mode 100644 (file)
index dd5ae0b..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX\r
-#define INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include <cstddef>\r
-\r
-#include "portaudio.h"\r
-\r
-#include "portaudiocpp/System.hxx"\r
-#include "portaudiocpp/SampleDataFormat.hxx"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Forward declaration(s):\r
-namespace portaudio\r
-{\r
-       class Device;\r
-}\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Declaration(s):\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
-               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
-\r
-               void setSampleFormat(SampleDataFormat format, bool interleaved = true);\r
-               void setHostApiSpecificSampleFormat(PaSampleFormat format, bool interleaved = true);\r
-\r
-               void setSuggestedLatency(PaTime latency);\r
-\r
-               void setHostApiSpecificStreamInfo(void *streamInfo);\r
-\r
-               // Accessor methods:\r
-               PaStreamParameters *paStreamParameters();\r
-               const PaStreamParameters *paStreamParameters() const;\r
-\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
-\r
-               PaTime suggestedLatency() const;\r
-\r
-               void *hostApiSpecificStreamInfo() const;\r
-       \r
-       private:\r
-               PaStreamParameters paStreamParameters_;\r
-       };\r
-\r
-\r
-} // namespace portaudio\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#endif // INCLUDED_PORTAUDIO_SINGLEDIRECTIONSTREAMPARAMETERS_HXX\r
diff --git a/fdmdv2/pa_cpp_binding/Exception.hxx b/fdmdv2/pa_cpp_binding/Exception.hxx
deleted file mode 100644 (file)
index a70c2f1..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_EXCEPTION_HXX\r
-#define INCLUDED_PORTAUDIO_EXCEPTION_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include <exception>\r
-\r
-#include "portaudio.h"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\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
-\r
-} // namespace portaudio\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#endif // INCLUDED_PORTAUDIO_EXCEPTION_HXX\r
-\r
diff --git a/fdmdv2/pa_cpp_binding/HostApi.hxx b/fdmdv2/pa_cpp_binding/HostApi.hxx
deleted file mode 100644 (file)
index 899fc42..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_HOSTAPI_HXX\r
-#define INCLUDED_PORTAUDIO_HOSTAPI_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include "portaudio.h"\r
-\r
-#include "portaudiocpp/System.hxx"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Forward declaration(s):\r
-namespace portaudio\r
-{\r
-       class Device;\r
-}\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Declaration(s):\r
-namespace portaudio\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
-\r
-}\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#endif // INCLUDED_PORTAUDIO_HOSTAPI_HXX\r
-\r
diff --git a/fdmdv2/pa_cpp_binding/InterfaceCallbackStream.hxx b/fdmdv2/pa_cpp_binding/InterfaceCallbackStream.hxx
deleted file mode 100644 (file)
index e496dd2..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_INTERFACECALLBACKSTREAM_HXX\r
-#define INCLUDED_PORTAUDIO_INTERFACECALLBACKSTREAM_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include "portaudio.h"\r
-\r
-#include "portaudiocpp/CallbackStream.hxx"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Forward declaration(s)\r
-namespace portaudio\r
-{\r
-       class StreamParameters;\r
-       class CallbackInterface;\r
-}\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Declaration(s):\r
-namespace portaudio\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 &parameters, CallbackInterface &instance);\r
-               ~InterfaceCallbackStream();\r
-               \r
-               void open(const StreamParameters &parameters, 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
-#endif // INCLUDED_PORTAUDIO_INTERFACECALLBACKSTREAM_HXX\r
diff --git a/fdmdv2/pa_cpp_binding/MemFunCallbackStream.hxx b/fdmdv2/pa_cpp_binding/MemFunCallbackStream.hxx
deleted file mode 100644 (file)
index a9e50ca..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_MEMFUNCALLBACKSTREAM_HXX\r
-#define INCLUDED_PORTAUDIO_MEMFUNCALLBACKSTREAM_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include "portaudio.h"\r
-\r
-#include "portaudiocpp/CallbackStream.hxx"\r
-#include "portaudiocpp/CallbackInterface.hxx"\r
-#include "portaudiocpp/StreamParameters.hxx"\r
-#include "portaudiocpp/Exception.hxx"\r
-#include "portaudiocpp/InterfaceCallbackStream.hxx"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-namespace 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 &parameters, 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 &parameters, 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 &parameters)\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
-// ---------------------------------------------------------------------------------------\r
-\r
-#endif // INCLUDED_PORTAUDIO_MEMFUNCALLBACKSTREAM_HXX\r
diff --git a/fdmdv2/pa_cpp_binding/PortAudioCpp.hxx b/fdmdv2/pa_cpp_binding/PortAudioCpp.hxx
deleted file mode 100644 (file)
index f11e7fb..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_PORTAUDIOCPP_HXX\r
-#define INCLUDED_PORTAUDIO_PORTAUDIOCPP_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-//////\r
-/// @mainpage PortAudioCpp\r
-///\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
-///   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
-///   no additional features were added except for some `convenience methods'.\r
-/// </p>\r
-/// <p>\r
-///   PortAudioCpp's main features are:\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
-///     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
-///   examples can easily be modified to compile without needing ASIO.\r
-/// </p>\r
-/// <p>\r
-///   Supported platforms:\r
-///   <ul>\r
-///     <li>Microsoft Visual C++ 6.0, 7.0 (.NET 2002) and 7.1 (.NET 2003).</li>\r
-///     <li>GNU G++ 2.95 and G++ 3.3.</li>\r
-///   </ul>\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
-///   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
-///   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
-/// <p>\r
-///   <a href="http://www.portaudio.com/">Official PortAudio site.</a><br>\r
-/// </p>\r
-//////\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\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
-/// alias like ``namespace pa = portaudio;''.\r
-//////\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-//////\r
-/// @file PortAudioCpp.hxx\r
-/// An include-all header file (for lazy programmers and using pre-compiled headers).\r
-//////\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include "portaudio.h"\r
-\r
-#include "portaudiocpp/AutoSystem.hxx"\r
-#include "portaudiocpp/BlockingStream.hxx"\r
-#include "portaudiocpp/CallbackInterface.hxx"\r
-#include "portaudiocpp/CallbackStream.hxx"\r
-#include "portaudiocpp/CFunCallbackStream.hxx"\r
-#include "portaudiocpp/CppFunCallbackStream.hxx"\r
-#include "portaudiocpp/Device.hxx"\r
-#include "portaudiocpp/Exception.hxx"\r
-#include "portaudiocpp/HostApi.hxx"\r
-#include "portaudiocpp/InterfaceCallbackStream.hxx"\r
-#include "portaudiocpp/MemFunCallbackStream.hxx"\r
-#include "portaudiocpp/SampleDataFormat.hxx"\r
-#include "portaudiocpp/DirectionSpecificStreamParameters.hxx"\r
-#include "portaudiocpp/Stream.hxx"\r
-#include "portaudiocpp/StreamParameters.hxx"\r
-#include "portaudiocpp/System.hxx"\r
-#include "portaudiocpp/SystemDeviceIterator.hxx"\r
-#include "portaudiocpp/SystemHostApiIterator.hxx"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#endif // INCLUDED_PORTAUDIO_PORTAUDIOCPP_HXX\r
diff --git a/fdmdv2/pa_cpp_binding/SampleDataFormat.hxx b/fdmdv2/pa_cpp_binding/SampleDataFormat.hxx
deleted file mode 100644 (file)
index a7e25b2..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_SAMPLEDATAFORMAT_HXX\r
-#define INCLUDED_PORTAUDIO_SAMPLEDATAFORMAT_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include "portaudio.h"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-namespace portaudio\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
-\r
-} // namespace portaudio\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#endif // INCLUDED_PORTAUDIO_SAMPLEDATAFORMAT_HXX\r
diff --git a/fdmdv2/pa_cpp_binding/Stream.hxx b/fdmdv2/pa_cpp_binding/Stream.hxx
deleted file mode 100644 (file)
index 8a255ec..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_STREAM_HXX\r
-#define INCLUDED_PORTAUDIO_STREAM_HXX\r
-\r
-#include "portaudio.h"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Forward declaration(s):\r
-namespace portaudio\r
-{\r
-       class StreamParameters;\r
-}\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Declaration(s):\r
-namespace portaudio\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
-\r
-} // namespace portaudio\r
-\r
-\r
-#endif // INCLUDED_PORTAUDIO_STREAM_HXX\r
-\r
diff --git a/fdmdv2/pa_cpp_binding/StreamParameters.hxx b/fdmdv2/pa_cpp_binding/StreamParameters.hxx
deleted file mode 100644 (file)
index 2b6aa2e..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_STREAMPARAMETERS_HXX\r
-#define INCLUDED_PORTAUDIO_STREAMPARAMETERS_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include "portaudio.h"\r
-\r
-#include "portaudiocpp/DirectionSpecificStreamParameters.hxx"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Declaration(s):\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 &parameters);\r
-               void setOutputParameters(const DirectionSpecificStreamParameters &parameters);\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
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#endif // INCLUDED_PORTAUDIO_STREAMPARAMETERS_HXX\r
diff --git a/fdmdv2/pa_cpp_binding/System.hxx b/fdmdv2/pa_cpp_binding/System.hxx
deleted file mode 100644 (file)
index f5fb713..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_SYSTEM_HXX\r
-#define INCLUDED_PORTAUDIO_SYSTEM_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include "portaudio.h"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Forward declaration(s):\r
-namespace portaudio\r
-{\r
-       class Device;\r
-       class Stream;\r
-       class HostApi;\r
-}\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Declaration(s):\r
-namespace portaudio\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
-               // -------------------------------------------------------------------------------\r
-\r
-               static int version();\r
-               static const char *versionText();\r
-\r
-               static void initialize();\r
-               static void terminate();\r
-\r
-               static System &instance();\r
-               static bool exists();\r
-\r
-               // -------------------------------------------------------------------------------\r
-\r
-               // host apis:\r
-               HostApiIterator hostApisBegin();\r
-               HostApiIterator hostApisEnd();\r
-\r
-               HostApi &defaultHostApi();\r
-\r
-               HostApi &hostApiByTypeId(PaHostApiTypeId type);\r
-               HostApi &hostApiByIndex(PaHostApiIndex index);\r
-\r
-               int hostApiCount();\r
-\r
-               // -------------------------------------------------------------------------------\r
-\r
-               // devices:\r
-               DeviceIterator devicesBegin();\r
-               DeviceIterator devicesEnd();\r
-\r
-               Device &defaultInputDevice();\r
-               Device &defaultOutputDevice();\r
-\r
-               Device &deviceByIndex(PaDeviceIndex index);\r
-\r
-               int deviceCount();\r
-\r
-               static Device &nullDevice();\r
-\r
-               // -------------------------------------------------------------------------------\r
-\r
-               // misc:\r
-               void sleep(long msec);\r
-               int sizeOfSample(PaSampleFormat format);\r
-\r
-       private:\r
-               System();\r
-               ~System();\r
-\r
-               static System *instance_;\r
-               static int initCount_;\r
-\r
-               static HostApi **hostApis_;\r
-               static Device **devices_;\r
-\r
-               static Device *nullDevice_;\r
-       };\r
-\r
-\r
-} // namespace portaudio\r
-\r
-\r
-#endif // INCLUDED_PORTAUDIO_SYSTEM_HXX\r
-\r
diff --git a/fdmdv2/pa_cpp_binding/SystemDeviceIterator.hxx b/fdmdv2/pa_cpp_binding/SystemDeviceIterator.hxx
deleted file mode 100644 (file)
index 613fc3d..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_SYSTEMDEVICEITERATOR_HXX\r
-#define INCLUDED_PORTAUDIO_SYSTEMDEVICEITERATOR_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include <iterator>\r
-#include <cstddef>\r
-\r
-#include "portaudiocpp/System.hxx"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Forward declaration(s):\r
-namespace portaudio\r
-{\r
-       class Device;\r
-       class HostApi;\r
-}\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Declaration(s):\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
-} // namespace portaudio\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#endif // INCLUDED_PORTAUDIO_SYSTEMDEVICEITERATOR_HXX\r
-\r
diff --git a/fdmdv2/pa_cpp_binding/SystemHostApiIterator.hxx b/fdmdv2/pa_cpp_binding/SystemHostApiIterator.hxx
deleted file mode 100644 (file)
index b9b13b8..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef INCLUDED_PORTAUDIO_SYSTEMHOSTAPIITERATOR_HXX\r
-#define INCLUDED_PORTAUDIO_SYSTEMHOSTAPIITERATOR_HXX\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#include <iterator>\r
-#include <cstddef>\r
-\r
-#include "portaudiocpp/System.hxx"\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Forward declaration(s):\r
-namespace portaudio\r
-{\r
-       class HostApi;\r
-}\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-// Declaration(s):\r
-namespace portaudio\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
-\r
-} // namespace portaudio\r
-\r
-// ---------------------------------------------------------------------------------------\r
-\r
-#endif // INCLUDED_PORTAUDIO_SYSTEMHOSTAPIITERATOR_HXX\r
index 28ec3f4492d655d35724df6d62e1c6551185a4e9..86d39e3b02f73f1610b264f6218ee8ad08eb3b7f 100644 (file)
@@ -10,6 +10,9 @@
   <VirtualDirectory Name="src">
     <File Name="pa_class.cpp"/>
   </VirtualDirectory>
+  <VirtualDirectory Name="include">
+    <File Name="pa_class.h"/>
+  </VirtualDirectory>
   <Settings Type="Executable">
     <GlobalSettings>
       <Compiler Options="" C_Options="">
@@ -23,6 +26,8 @@
     <Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
       <Compiler Options="-g;-O0;-Wall" C_Options="-g;-O0;-Wall" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
         <IncludePath Value="."/>
+        <IncludePath Value="."/>
+        <IncludePath Value="extern/include"/>
         <IncludePath Value="../../../portaudio/include"/>
       </Compiler>
       <Linker Options="" Required="yes">
@@ -62,7 +67,7 @@
     <Configuration Name="Release" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
       <Compiler Options="-O2;-Wall" C_Options="-O2;-Wall" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
         <IncludePath Value="."/>
-        <IncludePath Value="../../../portaudio/include"/>
+        <IncludePath Value="extern/include"/>
       </Compiler>
       <Linker Options="" Required="yes">
         <Library Value="portaudio"/>
       </Completion>
     </Configuration>
   </Settings>
-  <VirtualDirectory Name="include">
-    <File Name="pa_class.h"/>
-  </VirtualDirectory>
 </CodeLite_Project>
index 889bf7325a7b20a63b3126ec33585a5b5724d030..72793fdc436ecda76f4c200a46b6f4fc0a101655 100644 (file)
@@ -14,12 +14,10 @@ wxDECLARE_EVENT(wxEVT_COMMAND_AUDIOTHREAD_COMPLETED, wxThreadEvent);
 wxDECLARE_EVENT(wxEVT_COMMAND_AUDIOTHREAD_UPDATE, wxThreadEvent);\r
 \r
 #include "stdio.h"\r
-#include "portaudio.h"\r
+#include "extern/include/portaudio.h"\r
 \r
 /* This will be called asynchronously by the PortAudio engine. */\r
-static int audioCallback( void *inputBuffer, void *outputBuffer,\r
-\r
-unsigned long framesPerBuffer, PaTimestamp outTime, void *userData )\r
+static int audioCallback( void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, PaTime outTime, void *userData )\r
 {\r
     float *out = (float *) outputBuffer;\r
     float *in = (float *) inputBuffer;\r
@@ -40,10 +38,11 @@ unsigned long framesPerBuffer, PaTimestamp outTime, void *userData )
     }\r
     return 0;\r
 }\r
+\r
 /* Use a PortAudioStream to process audio data. */\r
 int main(void)\r
 {\r
-    PortAudioStream *stream;\r
+    PortAudioWrap *stream;\r
     Pa_Initialize();\r
     //Pa_OpenDefaultStream(&stream, 2, 2, /* stereo input and output */ paFloat32, 44100.0, 64, 0, /* 64 frames per buffer, let PA determine numBuffers */audioCallback, NULL );\r
     Pa_OpenDefaultStream(&stream, 2, 2, paFloat32, 44100.0, 64, 0, audioCallback, NULL );\r
index 5c2e9a4ec839d2ad472054e7a1bc0bd5150d07c3..fa2cc4f484457865ad61203165e3d00e123e4746 100644 (file)
@@ -16,7 +16,7 @@
 class AudioThread: public wxThread\r
 {\r
     public:\r
-        AudioThread(MainFrame *handler) : wxThread(wxTHREAD_DETACHED) { m_pHandler = handler }\r
+        AudioThread(MainFrame *handler) : wxThread(wxTHREAD_DETACHED){ m_pHandler = handler; }\r
         ~AudioThread();\r
 \r
     protected:\r