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

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_TempoSetting.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
14//==============================================================================
21 public CurveEditorPoint
22{
23public:
24 //==============================================================================
30
32 ~TempoSetting() override;
33
35
37 Edit& getEdit() const;
38
40 static juce::ValueTree create (BeatPosition startBeat, double bpm, float curve);
41
43 static constexpr double minBPM = 20.0;
44
46 static constexpr double maxBPM = 300.0;
47
48 //==============================================================================
51
52 //==============================================================================
54 BeatPosition getStartBeat() const { return startBeatNumber; }
55
57 double getBpm() const { return bpm; }
58
60 float getCurve() const { return curve; }
61
64
73 void set (BeatPosition, double newBpm, float newCurve, bool remapEditPositions);
74
76 void setBpm (double newBpm);
77
83 void setCurve (float curve);
84
85 void setStartBeat (BeatPosition);
86
88 void removeFromEdit();
89
90 //==============================================================================
94 TimeDuration getApproxBeatLength() const; // doesn't take into account ramping, etc
95
98
101
102 HashCode getHash() const noexcept;
103
104 TempoSequence& ownerSequence;
105 juce::ValueTree state;
106
107 juce::CachedValue<BeatPosition> startBeatNumber;
108 juce::CachedValue<double> bpm;
109 juce::CachedValue<float> curve;
110
112 TimePosition startTime; // (updated by TempoSequence)
113};
114
115}} // namespace tracktion { inline namespace engine
The Tracktion Edit class!
Holds a list of TempoSetting objects, to form a sequence of tempo changes.
A tempo value, as used in a TempoSequence.
void setBpm(double newBpm)
Sets the BPM of this tempo setting.
BeatPosition getStartBeat() const
Returns the start beat of the setting.
static constexpr double minBPM
Minimum BPM a setting can have.
juce::String getSelectableDescription() override
Returns the description of this Selectable.
TimeSigSetting & getMatchingTimeSig() const
Returns the time signature at this tempo's time in the sequence.
TimePosition getStartTime() const
Returns the start time in seconds of the tempo setting.
TempoSetting * getPreviousTempo() const
Returns the previous tempo setting in the sequence.
void setCurve(float curve)
Sets the curve of this tempo setting.
double getBpm() const
Returns the BPM of the setting.
TimeDuration getApproxBeatLength() const
Returns the approximate length of one beat based on the bpm and matching time sig denonimator.
static constexpr double maxBPM
Maximum BPM a setting can have.
static juce::ValueTree create(BeatPosition startBeat, double bpm, float curve)
Creates a tree to prepresent a TempoSetting.
void removeFromEdit()
Removes the TempoSetting from the sequence.
Edit & getEdit() const
Returns the Edit this setting belongs to.
float getCurve() const
Returns the curve of the setting.
Represents a position in beats.
Represents a duration in real-life time.
Represents a position in real-life time.