Mercurial > hg > sv-dependency-builds
view src/portaudio_20140130/bindings/cpp/source/portaudiocpp/InterfaceCallbackStream.cxx @ 80:0b60a66de5e2
This Mac compatibility fix appears to work, resolving SourceForge issue #273 Port Audio Fail on MacOS Catalina (10.15) - merging back
author | Chris Cannam |
---|---|
date | Thu, 31 Oct 2019 13:20:41 +0000 |
parents | 7ddb4fc30dac |
children |
line wrap: on
line source
#include "portaudiocpp/InterfaceCallbackStream.hxx" #include "portaudiocpp/StreamParameters.hxx" #include "portaudiocpp/Exception.hxx" #include "portaudiocpp/CallbackInterface.hxx" namespace portaudio { // ---------------------------------------------------------------------------------== InterfaceCallbackStream::InterfaceCallbackStream() { } InterfaceCallbackStream::InterfaceCallbackStream(const StreamParameters ¶meters, CallbackInterface &instance) { open(parameters, instance); } InterfaceCallbackStream::~InterfaceCallbackStream() { try { close(); } catch (...) { // ignore all errors } } // ---------------------------------------------------------------------------------== void InterfaceCallbackStream::open(const StreamParameters ¶meters, CallbackInterface &instance) { PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(), parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), &impl::callbackInterfaceToPaCallbackAdapter, static_cast<void *>(&instance)); if (err != paNoError) { throw PaException(err); } } }