2 ==============================================================================
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
7 JUCE is an open source library subject to commercial or open-source
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
23 ==============================================================================
32 Acts as a polymorphic base class for processors.
33 This exposes the same set of methods that a processor must implement as virtual
34 methods, so that you can use the ProcessorWrapper class to wrap an instance of
35 a subclass, and then pass that around using ProcessorBase as a base class.
42 ProcessorBase() = default;
43 virtual ~ProcessorBase() = default;
45 virtual void prepare (const ProcessSpec
&) = 0;
46 virtual void process (const ProcessContextReplacing
<float>&) = 0;
47 virtual void reset() = 0;
51 //==============================================================================
53 Wraps an instance of a given processor class, and exposes it through the
54 ProcessorBase interface.
59 template <typename ProcessorType
>
60 struct ProcessorWrapper
: public ProcessorBase
62 void prepare (const ProcessSpec
& spec
) override
64 processor
.prepare (spec
);
67 void process (const ProcessContextReplacing
<float>& context
) override
69 processor
.process (context
);
77 ProcessorType processor
;