Audio Processing Framework (APF) version 0.5.0
jack_minimal.cpp
// Minimalistic example for the MimoProcessor with JACK.
#include "apf/combine_channels.h" // for apf::CombineChannelsCopy
class MyProcessor : public apf::MimoProcessor<MyProcessor, apf::jack_policy>
{
public:
using Input = MimoProcessorBase::DefaultInput;
class Output;
MyProcessor();
};
class MyProcessor::Output : public MimoProcessorBase::DefaultOutput
{
public:
explicit Output(const Params& p)
: MimoProcessorBase::DefaultOutput(p)
, _combiner(this->parent.get_input_list(), *this)
{}
APF_PROCESS(Output, MimoProcessorBase::DefaultOutput)
{
_combiner.process(my_predicate());
}
private:
struct my_predicate
{
// trivial, all inputs are used
apf::CombineChannelsResult::type select(const Input&)
{
return apf::CombineChannelsResult::constant;
}
};
};
MyProcessor::MyProcessor()
: MimoProcessorBase()
{
this->add<Input>();
this->add<Output>();
}
int main()
{
MyProcessor processor;
processor.activate();
std::this_thread::sleep_for(std::chrono::seconds(30));
processor.deactivate();
}
Combine channels: accumulate.
Multi-threaded multiple-input-multiple-output (MIMO) processor.
Combine channels, interpolate, crossfade.
JACK policy for MimoProcessor's interface_policy.
Multi-threaded MIMO (multiple input, multiple output) processor.
#define APF_PROCESS(name, parent)
Macro to create a Process struct and a corresponding member function.
Definition: mimoprocessor.h:68