Mercurial > hg > sv-dependency-builds
diff src/portaudio_20161030/bindings/cpp/source/portaudiocpp/CallbackInterface.cxx @ 55:284acf908dcd
Add source for PortAudio stable v190600_20161030
author | Chris Cannam |
---|---|
date | Tue, 03 Jan 2017 13:44:07 +0000 |
parents | src/portaudio/bindings/cpp/source/portaudiocpp/CallbackInterface.cxx@e13257ea84a4 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/portaudio_20161030/bindings/cpp/source/portaudiocpp/CallbackInterface.cxx Tue Jan 03 13:44:07 2017 +0000 @@ -0,0 +1,25 @@ +#include "portaudiocpp/CallbackInterface.hxx" + +namespace portaudio +{ + + namespace impl + { + + ////// + /// Adapts any CallbackInterface object to a C-callable function (ie this function). A + /// pointer to the object should be passed as ``userData'' when setting up the callback. + ////// + int callbackInterfaceToPaCallbackAdapter(const void *inputBuffer, void *outputBuffer, unsigned long numFrames, + const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData) + { + CallbackInterface *cb = static_cast<CallbackInterface *>(userData); + return cb->paCallbackFun(inputBuffer, outputBuffer, numFrames, timeInfo, statusFlags); + } + + + } // namespace impl + +} // namespace portaudio + +