36 template <
typename Fn,
typename Tuple,
size_t... Ix>
45 template <
typename Fn,
typename Tuple>
46 constexpr void forEachInTuple (
Fn&& fn, Tuple&& tuple)
48 forEachInTuple (std::forward<Fn> (fn), std::forward<Tuple> (tuple), TupleIndexSequence<Tuple>{});
51 template <
typename Context,
size_t Ix>
52 inline constexpr auto useContextDirectly = ! Context::usesSeparateInputAndOutputBlocks() || Ix == 0;
66 template <
int Index>
auto&
get() noexcept {
return std::get<Index> (processors); }
69 template <
int Index>
const auto&
get()
const noexcept {
return std::get<Index> (processors); }
82 detail::forEachInTuple ([&] (
auto&
proc,
auto) {
proc.prepare (
spec); }, processors);
88 detail::forEachInTuple ([] (
auto&
proc,
auto) {
proc.reset(); }, processors);
92 template <
typename ProcessContext>
95 detail::forEachInTuple ([
this, &context] (
auto&
proc,
auto index)
noexcept { this->processOne (context,
proc, index); },
100 template <
typename Context,
typename Proc,
size_t Ix>
103 if constexpr (detail::useContextDirectly<Context, Ix>)
106 contextCopy.isBypassed = (bypassed[
Ix] || context.isBypassed);
112 jassert (context.getOutputBlock().getNumChannels() == context.getInputBlock().getNumChannels());
166JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE (
"-Wmismatched-tags")
169template <typename... Processors>
170struct tuple_size<::
juce::dsp::ProcessorChain<Processors...>> : integral_constant<
size_t, sizeof... (Processors)> {};
173template <
size_t I,
typename... Processors>
176JUCE_END_IGNORE_WARNINGS_GCC_LIKE
This variadically-templated class lets you join together any number of processor classes into a singl...
bool isBypassed() const noexcept
Query whether the processor at index Index is bypassed.
void setBypassed(bool b) noexcept
Set the processor at index Index to be bypassed or enabled.
void prepare(const ProcessSpec &spec)
Prepare all inner processors with the provided ProcessSpec.
void reset()
Reset all inner processors.
auto & get() noexcept
Get a reference to the processor at index Index.
const auto & get() const noexcept
Get a reference to the processor at index Index.
void process(const ProcessContext &context) noexcept
Process context through all inner processors in sequence.
auto & get(ProcessorChain< Processors... > &chain) noexcept
Non-member equivalent of ProcessorChain::get which avoids awkward member template syntax.
void setBypassed(ProcessorChain< Processors... > &chain, bool bypassed) noexcept
Non-member equivalent of ProcessorChain::setBypassed which avoids awkward member template syntax.
bool isBypassed(const ProcessorChain< Processors... > &chain) noexcept
Non-member equivalent of ProcessorChain::isBypassed which avoids awkward member template syntax.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
This structure is passed into a DSP algorithm's prepare() method, and contains information about vari...