annotate src/portaudio_20140130/bindings/cpp/source/portaudiocpp/CallbackInterface.cxx @ 39:7ddb4fc30dac

Current stable PortAudio source
author Chris Cannam
date Tue, 18 Oct 2016 13:11:05 +0100
parents
children
rev   line source
Chris@39 1 #include "portaudiocpp/CallbackInterface.hxx"
Chris@39 2
Chris@39 3 namespace portaudio
Chris@39 4 {
Chris@39 5
Chris@39 6 namespace impl
Chris@39 7 {
Chris@39 8
Chris@39 9 //////
Chris@39 10 /// Adapts any CallbackInterface object to a C-callable function (ie this function). A
Chris@39 11 /// pointer to the object should be passed as ``userData'' when setting up the callback.
Chris@39 12 //////
Chris@39 13 int callbackInterfaceToPaCallbackAdapter(const void *inputBuffer, void *outputBuffer, unsigned long numFrames,
Chris@39 14 const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData)
Chris@39 15 {
Chris@39 16 CallbackInterface *cb = static_cast<CallbackInterface *>(userData);
Chris@39 17 return cb->paCallbackFun(inputBuffer, outputBuffer, numFrames, timeInfo, statusFlags);
Chris@39 18 }
Chris@39 19
Chris@39 20
Chris@39 21 } // namespace impl
Chris@39 22
Chris@39 23 } // namespace portaudio
Chris@39 24
Chris@39 25