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