JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_ProcessContext.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce::dsp
27{
28
46
47constexpr bool operator== (const ProcessSpec& a, const ProcessSpec& b)
48{
49 const auto tie = [] (const ProcessSpec& p)
50 {
51 return std::tie (p.sampleRate, p.maximumBlockSize, p.numChannels);
52 };
53
54 return tie (a) == tie (b);
55}
56
57constexpr bool operator!= (const ProcessSpec& a, const ProcessSpec& b) { return ! (a == b); }
58
59//==============================================================================
74
75//==============================================================================
87template <typename ContextSampleType>
89{
90public:
96
101
104
106 const ConstAudioBlockType& getInputBlock() const noexcept { return constBlock; }
107
109 AudioBlockType& getOutputBlock() const noexcept { return ioBlock; }
110
115 static constexpr bool usesSeparateInputAndOutputBlocks() { return false; }
116
120 bool isBypassed = false;
121
122private:
123 AudioBlockType& ioBlock;
124 ConstAudioBlockType constBlock { ioBlock };
125};
126
127//==============================================================================
140template <typename ContextSampleType>
142{
143public:
149
154 : inputBlock (input), outputBlock (output)
155 {
156 // If the input and output blocks are the same then you should use
157 // ProcessContextReplacing instead.
158 jassert (input != output);
159 }
160
163
165 const ConstAudioBlockType& getInputBlock() const noexcept { return inputBlock; }
166
168 AudioBlockType& getOutputBlock() const noexcept { return outputBlock; }
169
174 static constexpr bool usesSeparateInputAndOutputBlocks() { return true; }
175
179 bool isBypassed = false;
180
181private:
182 ConstAudioBlockType inputBlock;
183 AudioBlockType& outputBlock;
184};
185
186} // namespace juce::dsp
A smart-pointer class which points to a reference-counted object.
A base class which provides methods for reference-counting.
Minimal and lightweight data-structure which contains a list of pointers to channels containing some ...
#define jassert(expression)
Platform-independent assertion macro.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
Definition juce_Memory.h:88
unsigned int uint32
A platform-independent 32-bit unsigned integer type.
Contains context information that is passed into an algorithm's process method.
static constexpr bool usesSeparateInputAndOutputBlocks()
All process context classes will define this constant method so that templated code can determine whe...
AudioBlockType & getOutputBlock() const noexcept
Returns the audio block to use as the output to a process function.
const ConstAudioBlockType & getInputBlock() const noexcept
Returns the audio block to use as the input to a process function.
ProcessContextNonReplacing(const ConstAudioBlockType &input, AudioBlockType &output) noexcept
Creates a ProcessContextNonReplacing that uses the given input and output blocks.
bool isBypassed
If set to true, then a processor's process() method is expected to do whatever is appropriate for it ...
ContextSampleType SampleType
The type of a single sample (which may be a vector if multichannel).
Contains context information that is passed into an algorithm's process method.
ProcessContextReplacing(AudioBlockType &block) noexcept
Creates a ProcessContextReplacing that uses the given audio block.
ContextSampleType SampleType
The type of a single sample (which may be a vector if multichannel).
static constexpr bool usesSeparateInputAndOutputBlocks()
All process context classes will define this constant method so that templated code can determine whe...
const ConstAudioBlockType & getInputBlock() const noexcept
Returns the audio block to use as the input to a process function.
AudioBlockType & getOutputBlock() const noexcept
Returns the audio block to use as the output to a process function.
bool isBypassed
If set to true, then a processor's process() method is expected to do whatever is appropriate for it ...
This structure is passed into a DSP algorithm's prepare() method, and contains information about vari...
uint32 numChannels
The number of channels that the process() method will be expected to handle.
double sampleRate
The sample rate that will be used for the data that is sent to the processor.
uint32 maximumBlockSize
The maximum number of samples that will be in the blocks sent to process() method.
This is a handy base class for the state of a processor (such as parameter values) which is typically...
T tie(T... args)