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