Chris@4: #ifndef INCLUDED_PORTAUDIO_CALLBACKINTERFACE_HXX Chris@4: #define INCLUDED_PORTAUDIO_CALLBACKINTERFACE_HXX Chris@4: Chris@4: // --------------------------------------------------------------------------------------- Chris@4: Chris@4: #include "portaudio.h" Chris@4: Chris@4: // --------------------------------------------------------------------------------------- Chris@4: Chris@4: namespace portaudio Chris@4: { Chris@4: // ----------------------------------------------------------------------------------- Chris@4: Chris@4: ////// Chris@4: /// @brief Interface for an object that's callable as a PortAudioCpp callback object (ie that implements the Chris@4: /// paCallbackFun method). Chris@4: ////// Chris@4: class CallbackInterface Chris@4: { Chris@4: public: Chris@4: virtual ~CallbackInterface() {} Chris@4: Chris@4: virtual int paCallbackFun(const void *inputBuffer, void *outputBuffer, unsigned long numFrames, Chris@4: const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags) = 0; Chris@4: }; Chris@4: Chris@4: // ----------------------------------------------------------------------------------- Chris@4: Chris@4: namespace impl Chris@4: { Chris@4: extern "C" Chris@4: { Chris@4: int callbackInterfaceToPaCallbackAdapter(const void *inputBuffer, void *outputBuffer, unsigned long numFrames, Chris@4: const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, Chris@4: void *userData); Chris@4: } // extern "C" Chris@4: } Chris@4: Chris@4: // ----------------------------------------------------------------------------------- Chris@4: Chris@4: } // namespace portaudio Chris@4: Chris@4: // --------------------------------------------------------------------------------------- Chris@4: Chris@4: #endif // INCLUDED_PORTAUDIO_CALLBACKINTERFACE_HXX