tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_StepModifier.h
Go to the documentation of this file.
1 /*
2 ,--. ,--. ,--. ,--.
3 ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2024
4 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software
5 | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation
6 `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com
7
8 Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details.
9*/
10
11namespace tracktion { inline namespace engine
12{
13
15class StepModifier : public Modifier,
17{
18public:
19 //==============================================================================
21 ~StepModifier() override;
22
25
27 void initialise() override;
28 float getCurrentValue() override;
29
30 juce::String getName() const override { return TRANS("Step Modifier"); }
31
32 //==============================================================================
33 enum { maxNumSteps = 64 };
34 float getStep (int step) const;
35 void setStep (int step, float value);
36
37 int getCurrentStep() const noexcept;
38
40
42 void applyToBuffer (const PluginRenderContext&) override;
43
44 //==============================================================================
46 {
48
49 bool isForModifierSource (const ModifierSource&) const override;
51
52 const EditItemID stepModifierID;
53
55 };
56
57 //==============================================================================
59
60 //==============================================================================
61 juce::CachedValue<float> syncType, numSteps, rate, rateType, depth;
62
63 AutomatableParameter::Ptr syncTypeParam, numStepsParam, rateParam, rateTypeParam, depthParam;
64
65private:
66 struct StepModifierTimer;
67 std::unique_ptr<StepModifierTimer> stepModifierTimer;
68
69 LambdaTimer changedTimer;
70 float steps[maxNumSteps];
71 std::atomic<int> currentStep { 0 };
72
73 void flushStepsToProperty();
74 void restoreStepsFromProperty();
75
76 void valueTreeChanged() override;
77 void valueTreePropertyChanged (juce::ValueTree&, const juce::Identifier&) override;
78};
79
80}} // namespace tracktion { inline namespace engine
The Tracktion Edit class!
void initialise() override
Call this once after construction to connect it to the audio graph.
void applyToBuffer(const PluginRenderContext &) override
Sub classes should implement this to process the Modifier.
float getCurrentValue() override
Must return the current value of the modifier.
AutomatableParameter::ModifierAssignment * createAssignment(const juce::ValueTree &) override
Must return a new ModifierAssignment for a given state.
juce::String getSelectableDescription() override
Subclasses must return a description of what they are.
ProcessingPosition getProcessingPosition() override
Should return the position in the plugin chain that this Modifier should be processed.
#define TRANS(stringLiteral)
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Connects a modifier source to an AutomatableParameter.
ID for objects of type EditElement - e.g.
Bass class for parameter Modifiers.
virtual void initialise()=0
Call this once after construction to connect it to the audio graph.
ProcessingPosition
Determines the position in the FX chain where the modifier should be processed.
@ preFX
The Modifier is processed before the plugn chain.
The context passed to plugin render methods to provide it with buffers to fill.