Audio Processing Framework (APF)
version 0.5.0
jack_minimal.cpp
// Minimalistic example for the MimoProcessor with JACK.
#include "
apf/mimoprocessor.h
"
#include "
apf/combine_channels.h
"
// for apf::CombineChannelsCopy
#include "
apf/jack_policy.h
"
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;
}
};
apf::CombineChannelsCopy<rtlist_proxy<Input>
, DefaultOutput> _combiner;
};
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();
}
apf::CombineChannelsCopy
Combine channels: accumulate.
Definition:
combine_channels.h:195
apf::MimoProcessor
Multi-threaded multiple-input-multiple-output (MIMO) processor.
Definition:
mimoprocessor.h:202
combine_channels.h
Combine channels, interpolate, crossfade.
jack_policy.h
JACK policy for MimoProcessor's interface_policy.
mimoprocessor.h
Multi-threaded MIMO (multiple input, multiple output) processor.
APF_PROCESS
#define APF_PROCESS(name, parent)
Macro to create a Process struct and a corresponding member function.
Definition:
mimoprocessor.h:68
Generated by
1.9.4