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

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_AutomationRecordManager.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
21{
22public:
23 //==============================================================================
26
27 //==============================================================================
31 bool isReadingAutomation() const noexcept { return readingAutomation; }
32 void setReadingAutomation (bool);
33
37 bool isWritingAutomation() const noexcept { return writingAutomation; }
38 void setWritingAutomation (bool);
39
42
43 //==============================================================================
44 // Called by the transportcontrol
45 void playStartedOrStopped();
46
47 // True if some parameter data has been recorded since play began.
48 bool isRecordingAutomation() const;
49
50 // True if some param data has been recorded for this parameter since play began.
51 bool isParameterRecording (AutomatableParameter*) const;
52
53 // if we're recording, stop and write the data back to the edit.
54 void punchOut (bool toEnd);
55
56 //==============================================================================
61 static void setGlideSeconds (Engine&, TimeDuration);
62
63 Engine& engine;
64
65private:
66 //==============================================================================
68
69 struct AutomationParamData
70 {
71 AutomationParamData (AutomatableParameter& p, float value)
72 : parameter (p), originalValue (value)
73 {
74 }
75
76 struct Change
77 {
78 inline Change (TimePosition t, float v) noexcept
79 : time (t), value (v) {}
80
81 TimePosition time;
82 float value;
83 };
84
85 AutomatableParameter& parameter;
86 juce::Array<Change> changes;
87 float originalValue;
88 };
89
90 Edit& edit;
93 bool writingAutomation = false;
94 juce::CachedValue<bool> readingAutomation;
95 bool wasPlaying = false;
96
97 friend class AutomatableParameter;
98 void postFirstAutomationChange (AutomatableParameter&, float originalValue);
99 void postAutomationChange (AutomatableParameter&, TimePosition time, float value);
100 void parameterBeingDeleted (AutomatableParameter&);
101
102 void applyChangesToParameter (AutomationParamData*, TimePosition endTime, bool toEnd);
103
104 void changeListenerCallback (juce::ChangeBroadcaster*);
105};
106
107}} // namespace tracktion { inline namespace engine
Stores automation data as it's being read in, and writes it back to the edit when recording finishes.
bool isWritingAutomation() const noexcept
Toggles automation recording Matches the auto rec button on the transport controls.
static TimeDuration getGlideSeconds(Engine &)
Set the 'glide' or crossfade length it'll use to patch the data back into the edit.
void toggleWriteAutomationMode()
flips the write mode, first punching out if it needs to.
bool isReadingAutomation() const noexcept
Toggles automation playback Matches the auto play button on the transport controls.
The Tracktion Edit class!
The Engine is the central class for all tracktion sessions.
void toEnd(TransportControl &tc, const SelectableList &items)
Moves the transport to the end of the selected objects.
Represents a duration in real-life time.
Represents a position in real-life time.