TracktionEngine
|
A tempo value, as used in a TempoSequence. More...
#include <tracktion_TempoSetting.h>
Public Types | |
using | Ptr = juce::ReferenceCountedObjectPtr< TempoSetting > |
![]() | |
using | WeakRef = juce::WeakReference< Selectable > |
Public Member Functions | |
TempoSetting (TempoSequence &, const juce::ValueTree &) | |
Constructs a TempoSetting belonging to a given TempoSequence. | |
~TempoSetting () override | |
Destructor. | |
Edit & | getEdit () const |
Returns the Edit this setting belongs to. | |
juce::String | getSelectableDescription () override |
Returns the description of this Selectable. | |
BeatPosition | getStartBeat () const |
Returns the start beat of the setting. | |
double | getBpm () const |
Returns the BPM of the setting. | |
float | getCurve () const |
Returns the curve of the setting. | |
TimePosition | getStartTime () const |
Returns the start time in seconds of the tempo setting. | |
void | set (BeatPosition, double newBpm, float newCurve, bool remapEditPositions) |
Sets the properties of this tempo setting. | |
void | setBpm (double newBpm) |
Sets the BPM of this tempo setting. | |
void | setCurve (float curve) |
Sets the curve of this tempo setting. | |
void | setStartBeat (BeatPosition) |
void | removeFromEdit () |
Removes the TempoSetting from the sequence. | |
TimeDuration | getApproxBeatLength () const |
Returns the approximate length of one beat based on the bpm and matching time sig denonimator. | |
TempoSetting * | getPreviousTempo () const |
Returns the previous tempo setting in the sequence. | |
TimeSigSetting & | getMatchingTimeSig () const |
Returns the time signature at this tempo's time in the sequence. | |
HashCode | getHash () const noexcept |
![]() | |
CurveEditorPoint () noexcept | |
CurveEditorPoint (int i, CurveEditor *ed) | |
~CurveEditorPoint () override | |
void | selectionStatusChanged (bool isNowSelected) override |
Can be overridden to tell this object that it has just been selected or deselected. | |
![]() | |
Selectable () | |
virtual | ~Selectable () |
virtual void | changed () |
This should be called to send a change notification to any SelectableListeners that are registered with this object. | |
virtual void | selectableAboutToBeDeleted () |
Called just before the selectable is about to be deleted so any subclasses should still be valid at this point. | |
void | addListener (SelectableListener *) |
void | removeListener (SelectableListener *) |
void | addSelectableListener (SelectableListener *) |
void | removeSelectableListener (SelectableListener *) |
void | cancelAnyPendingUpdates () |
If changed() has been called, this will cancel any pending async change notificaions. | |
void | deselect () |
void | propertiesChanged () |
void | notifyListenersOfDeletion () |
WeakRef | getWeakRef () |
Static Public Member Functions | |
static juce::ValueTree | create (BeatPosition startBeat, double bpm, float curve) |
Creates a tree to prepresent a TempoSetting. | |
![]() | |
static bool | arePointsConsecutive (const SelectableList &) |
static bool | arePointsOnSameCurve (const SelectableList &) |
static TimeRange | getPointTimeRange (const SelectableList &) |
![]() | |
static void | initialise () |
static bool | isSelectableValid (const Selectable *) noexcept |
checks whether this object has been deleted. | |
Public Attributes | |
TempoSequence & | ownerSequence |
juce::ValueTree | state |
juce::CachedValue< BeatPosition > | startBeatNumber |
juce::CachedValue< double > | bpm |
juce::CachedValue< float > | curve |
TimePosition | startTime |
![]() | |
int | index = 0 |
juce::Component::SafePointer< CurveEditor > | editor |
![]() | |
WeakRef::Master | masterReference |
Static Public Attributes | |
static constexpr double | minBPM = 20.0 |
Minimum BPM a setting can have. | |
static constexpr double | maxBPM = 300.0 |
Maximum BPM a setting can have. | |
A tempo value, as used in a TempoSequence.
This specifies the BPM, time sig, etc. at a particular time
using tracktion::engine::TempoSetting::Ptr = juce::ReferenceCountedObjectPtr<TempoSetting> |
tracktion::engine::TempoSetting::TempoSetting | ( | TempoSequence & | , |
const juce::ValueTree & | |||
) |
Constructs a TempoSetting belonging to a given TempoSequence.
Don't construct these directly, use the appropriate insert methods of TempoSequence.
|
override |
Destructor.
|
static |
Creates a tree to prepresent a TempoSetting.
|
overridevirtual |
Returns the description of this Selectable.
Implements tracktion::engine::Selectable.
BeatPosition tracktion::engine::TempoSetting::getStartBeat | ( | ) | const |
Returns the start beat of the setting.
References startBeatNumber.
double tracktion::engine::TempoSetting::getBpm | ( | ) | const |
Returns the BPM of the setting.
References bpm.
float tracktion::engine::TempoSetting::getCurve | ( | ) | const |
Returns the curve of the setting.
References curve.
TimePosition tracktion::engine::TempoSetting::getStartTime | ( | ) | const |
Returns the start time in seconds of the tempo setting.
void tracktion::engine::TempoSetting::set | ( | BeatPosition | , |
double | newBpm, | ||
float | newCurve, | ||
bool | remapEditPositions | ||
) |
Sets the properties of this tempo setting.
startBeatNum | The new start beat number to set. |
newBpm | The new bpm value to set. |
newCurve | The new curve to set. |
remapEditPositions | If true, this will adjust any Edit items start/end positions so they fall on the same beat as they currently do. |
void tracktion::engine::TempoSetting::setBpm | ( | double | newBpm | ) |
Sets the BPM of this tempo setting.
void tracktion::engine::TempoSetting::setCurve | ( | float | curve | ) |
Sets the curve of this tempo setting.
<0.0 is a log curve 0.0 is a linear curve >0.0 is an exponential curve
void tracktion::engine::TempoSetting::setStartBeat | ( | BeatPosition | ) |
void tracktion::engine::TempoSetting::removeFromEdit | ( | ) |
Removes the TempoSetting from the sequence.
TimeDuration tracktion::engine::TempoSetting::getApproxBeatLength | ( | ) | const |
Returns the approximate length of one beat based on the bpm and matching time sig denonimator.
TempoSetting * tracktion::engine::TempoSetting::getPreviousTempo | ( | ) | const |
Returns the previous tempo setting in the sequence.
TimeSigSetting & tracktion::engine::TempoSetting::getMatchingTimeSig | ( | ) | const |
Returns the time signature at this tempo's time in the sequence.
|
noexcept |
|
staticconstexpr |
Minimum BPM a setting can have.
|
staticconstexpr |
Maximum BPM a setting can have.
TempoSequence& tracktion::engine::TempoSetting::ownerSequence |
juce::ValueTree tracktion::engine::TempoSetting::state |
juce::CachedValue<BeatPosition> tracktion::engine::TempoSetting::startBeatNumber |
Referenced by getStartBeat().
juce::CachedValue<double> tracktion::engine::TempoSetting::bpm |
Referenced by getBpm().
juce::CachedValue<float> tracktion::engine::TempoSetting::curve |
Referenced by getCurve().
TimePosition tracktion::engine::TempoSetting::startTime |