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

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_FollowActions.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
11#pragma once
12
13#include <span>
14
15namespace tracktion::inline engine
16{
17
18//==============================================================================
20enum class FollowAction
21{
22 none,
23
24 globalStop,
25 globalReturnToArrangement,
26 globalPlayAgain,
27
28 trackPrevious,
29 trackNext,
30 trackFirst,
31 trackLast,
32 trackAny,
33 trackOther,
34 trackRoundRobin,
35
36 currentGroupPrevious,
37 currentGroupNext,
38 currentGroupFirst,
39 currentGroupLast,
40 currentGroupAny,
41 currentGroupOther,
42 currentGroupRoundRobin,
43
44 previousGroupFirst,
45 previousGroupLast,
46 previousGroupAny,
47
48 nextGroupFirst,
49 nextGroupLast,
50 nextGroupAny,
51
52 otherGroupFirst,
53 otherGroupLast,
54 otherGroupAny,
55};
56
57//==============================================================================
60
63
65juce::String toString (FollowAction);
66
68std::function<void (MonotonicBeat)> createFollowAction (Clip&);
69
70//==============================================================================
71//==============================================================================
73{
74public:
75 struct Action
76 {
77 juce::ValueTree state;
80 };
81
83 ~FollowActions() override;
84
85 Action& addAction();
86
87 void removeAction (Action&);
88
89 std::span<Action*> getActions() const;
90
91private:
92 juce::ValueTree state;
93 juce::UndoManager* undoManager = nullptr;
94 class List;
96};
97
98}
99
100
101//==============================================================================
102//==============================================================================
103namespace juce
104{
105 template <>
107 {
108 static tracktion::engine::FollowAction fromVar (const var& v)
109 {
110 using namespace tracktion::engine;
111 return followActionFromString (v.toString()).value_or (FollowAction::none);
112 }
113
114 static var toVar (tracktion::engine::FollowAction v)
115 {
116 return toString (v);
117 }
118 };
119}
const String & toString() const noexcept
Declarations from this namespaces are inlined into tracktion.
std::optional< FollowAction > followActionFromString(juce::String s)
Converts a string to a FollowAction if possible.
std::optional< FollowAction > followActionFromChoice(juce::String)
Converts a FollowAction choice to a FollowAction if possible.
FollowAction
Determines the type of action to perform after a Clip has played for a set period.