1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-07 15:22:34 +02:00
lllucius b4ba110811 Reverting r12850...hopefully
Never removed one before, but I'm pretty sure it is correct.
2013-11-03 01:54:50 +00:00

46 lines
1.2 KiB
C++

#include "portaudiocpp/InterfaceCallbackStream.hxx"
#include "portaudiocpp/StreamParameters.hxx"
#include "portaudiocpp/Exception.hxx"
#include "portaudiocpp/CallbackInterface.hxx"
namespace portaudio
{
// ---------------------------------------------------------------------------------==
InterfaceCallbackStream::InterfaceCallbackStream()
{
}
InterfaceCallbackStream::InterfaceCallbackStream(const StreamParameters &parameters, CallbackInterface &instance)
{
open(parameters, instance);
}
InterfaceCallbackStream::~InterfaceCallbackStream()
{
try
{
close();
}
catch (...)
{
// ignore all errors
}
}
// ---------------------------------------------------------------------------------==
void InterfaceCallbackStream::open(const StreamParameters &parameters, 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);
}
}
}