TracktionEngine
|
Holds a list of TempoSetting objects, to form a sequence of tempo changes. More...
Public Member Functions | |
TempoSequence (Edit &) | |
Creates a TempoSequence for an Edit. More... | |
~TempoSequence () override | |
Destructor. More... | |
Edit & | getEdit () const |
Returns the Edit this TempoSequence refers to. More... | |
const juce::ValueTree & | getState () const |
Returns the state this TempoSequence models. More... | |
void | setState (const juce::ValueTree &, bool remapEdit) |
Sets the state this TempoSequence should refer to. More... | |
void | createEmptyState () |
Resets this to a default, empty state. More... | |
void | copyFrom (const TempoSequence &) |
Copies the contents of another TempoSequence. More... | |
const juce::Array< TimeSigSetting * > & | getTimeSigs () const |
Returns an array of the TimeSigSetting. More... | |
int | getNumTimeSigs () const |
Returns the number of TimeSigSetting[s] in the sequence. More... | |
TimeSigSetting * | getTimeSig (int index) const |
Returns the TimeSigSetting at a given index. More... | |
TimeSigSetting & | getTimeSigAt (TimePosition) const |
Returns the TimeSigSetting at a given position. More... | |
TimeSigSetting & | getTimeSigAt (BeatPosition) const |
Returns the TimeSigSetting at a given position. More... | |
int | indexOfTimeSigAt (TimePosition) const |
Returns the index of TimeSigSetting at a given position. More... | |
int | indexOfTimeSig (const TimeSigSetting *) const |
Returns the index of a given TimeSigSetting. More... | |
const juce::Array< TempoSetting * > & | getTempos () const |
Returns the TempoSettings. More... | |
int | getNumTempos () const |
Returns the current number of TempoSettings. More... | |
TempoSetting * | getTempo (int index) const |
Returns the TempoSetting at the given index. More... | |
TempoSetting & | getTempoAt (TimePosition) const |
Returns the TempoSetting at the given position. More... | |
TempoSetting & | getTempoAt (BeatPosition) const |
Returns the TempoSetting at the given position. More... | |
double | getBpmAt (TimePosition) const |
Returns the tempo at a given position. More... | |
double | getBeatsPerSecondAt (TimePosition, bool lengthOfOneBeatDependsOnTimeSignature=false) const |
Returns the tempo at a given position. More... | |
bool | isTripletsAtTime (TimePosition) const |
Returns true if the TempoSetting is triplets at the given time. More... | |
int | indexOfTempoAt (TimePosition) const |
Returns the index of the TempoSetting at the given position. More... | |
int | indexOfNextTempoAt (TimePosition) const |
Returns the index of the TempoSetting after the given position. More... | |
int | indexOfTempo (const TempoSetting *) const |
Returns the index of the given TempoSetting. More... | |
int | countTemposInRegion (TimeRange) const |
Returns the number of TempoSetting[s] in the given range. More... | |
TempoSetting::Ptr | insertTempo (TimePosition) |
Inserts a tempo break that can be edited later. More... | |
TempoSetting::Ptr | insertTempo (BeatPosition, double bpm, float curve) |
Inserts a tempo with a bpm and curve value. More... | |
TimeSigSetting::Ptr | insertTimeSig (TimePosition) |
Inserts a new TimeSigSetting at the given position. More... | |
TimeSigSetting::Ptr | insertTimeSig (BeatPosition) |
Inserts a new TimeSigSetting at the given position. More... | |
void | removeTempo (int index, bool remapEdit) |
Removes the TempoSetting at a given index. More... | |
void | removeTemposBetween (TimeRange, bool remapEdit) |
Removes any TempoSetting[s] within the range. More... | |
void | removeTimeSig (int index) |
Removes the TimeSigSetting at a given index. More... | |
void | removeTimeSigsBetween (TimeRange) |
Removes any TimeSigSetting[s] within the range. More... | |
void | moveTempoStart (int index, BeatDuration deltaBeats, bool snapToBeat) |
Moves the TempoSetting at a given index by a number of beats. More... | |
void | moveTimeSigStart (int index, BeatDuration deltaBeats, bool snapToBeat) |
Moves the TimeSigSetting at a given index by a number of beats. More... | |
void | insertSpaceIntoSequence (TimePosition time, TimeDuration amountOfSpaceInSeconds, bool snapToBeat) |
Inserts space in to a sequence, shifting TempoSettings and TimeSigs. More... | |
void | deleteRegion (TimeRange) |
Removes a region in a sequence, shifting TempoSettings and TimeSigs. More... | |
BeatPosition | toBeats (TimePosition) const |
Converts a time to a number of beats. More... | |
BeatRange | toBeats (TimeRange) const |
Converts a time range to a beat range. More... | |
BeatPosition | toBeats (tempo::BarsAndBeats) const |
Converts a number of BarsAndBeats to a position. More... | |
TimePosition | toTime (BeatPosition) const |
Converts a number of beats a time. More... | |
TimeRange | toTime (BeatRange) const |
Converts a beat range to a time range. More... | |
TimePosition | toTime (tempo::BarsAndBeats) const |
Converts a number of BarsAndBeats to a position. More... | |
tempo::BarsAndBeats | toBarsAndBeats (TimePosition) const |
Converts a time to a number of BarsAndBeats. More... | |
const tempo::Sequence & | getInternalSequence () const |
N.B. More... | |
tempo::BarsAndBeats | timeToBarsBeats (TimePosition) const |
TimePosition | barsBeatsToTime (tempo::BarsAndBeats) const |
BeatPosition | barsBeatsToBeats (tempo::BarsAndBeats) const |
BeatPosition | timeToBeats (TimePosition time) const |
BeatRange | timeToBeats (TimeRange range) const |
TimePosition | beatsToTime (BeatPosition beats) const |
TimeRange | beatsToTime (BeatRange range) const |
TimeSigSetting & | getTimeSigAtBeat (BeatPosition) const |
TempoSetting & | getTempoAtBeat (BeatPosition) const |
juce::UndoManager * | getUndoManager () const noexcept |
juce::String | getSelectableDescription () override |
void | freeResources () |
void | updateTempoData () |
Public Member Functions inherited from tracktion::engine::Selectable | |
Selectable () | |
virtual | ~Selectable () |
virtual void | selectionStatusChanged (bool isNowSelected) |
Can be overridden to tell this object that it has just been selected or deselected. More... | |
virtual void | changed () |
This should be called to send a change notification to any SelectableListeners that are registered with this object. More... | |
virtual void | selectableAboutToBeDeleted () |
Called just before the selectable is about to be deleted so any subclasses should still be valid at this point. More... | |
void | addSelectableListener (SelectableListener *) |
void | removeSelectableListener (SelectableListener *) |
void | cancelAnyPendingUpdates () |
If changed() has been called, this will cancel any pending async change notificaions. More... | |
void | deselect () |
void | propertiesChanged () |
void | notifyListenersOfDeletion () |
WeakRef | getWeakRef () |
Public Attributes | |
Edit & | edit |
The Edit this sequence belongs to. More... | |
Public Attributes inherited from tracktion::engine::Selectable | |
WeakRef::Master | masterReference |
Additional Inherited Members | |
Public Types inherited from tracktion::engine::Selectable | |
using | WeakRef = juce::WeakReference< Selectable > |
Static Public Member Functions inherited from tracktion::engine::Selectable | |
static void | initialise () |
static bool | isSelectableValid (const Selectable *) noexcept |
checks whether this object has been deleted. More... | |
Holds a list of TempoSetting objects, to form a sequence of tempo changes.
You can query this at particular points, but it's wise to use a tempo::Sequence::Position object to iterate it.
tracktion::engine::TempoSequence::TempoSequence | ( | Edit & | ) |
Creates a TempoSequence for an Edit.
|
override |
Destructor.
Edit& tracktion::engine::TempoSequence::getEdit | ( | ) | const |
Returns the Edit this TempoSequence refers to.
References edit.
const juce::ValueTree& tracktion::engine::TempoSequence::getState | ( | ) | const |
Returns the state this TempoSequence models.
void tracktion::engine::TempoSequence::setState | ( | const juce::ValueTree & | , |
bool | remapEdit | ||
) |
Sets the state this TempoSequence should refer to.
void tracktion::engine::TempoSequence::createEmptyState | ( | ) |
Resets this to a default, empty state.
void tracktion::engine::TempoSequence::copyFrom | ( | const TempoSequence & | ) |
Copies the contents of another TempoSequence.
const juce::Array<TimeSigSetting*>& tracktion::engine::TempoSequence::getTimeSigs | ( | ) | const |
Returns an array of the TimeSigSetting.
int tracktion::engine::TempoSequence::getNumTimeSigs | ( | ) | const |
Returns the number of TimeSigSetting[s] in the sequence.
TimeSigSetting* tracktion::engine::TempoSequence::getTimeSig | ( | int | index | ) | const |
Returns the TimeSigSetting at a given index.
TimeSigSetting& tracktion::engine::TempoSequence::getTimeSigAt | ( | TimePosition | ) | const |
Returns the TimeSigSetting at a given position.
TimeSigSetting& tracktion::engine::TempoSequence::getTimeSigAt | ( | BeatPosition | ) | const |
Returns the TimeSigSetting at a given position.
int tracktion::engine::TempoSequence::indexOfTimeSigAt | ( | TimePosition | ) | const |
Returns the index of TimeSigSetting at a given position.
int tracktion::engine::TempoSequence::indexOfTimeSig | ( | const TimeSigSetting * | ) | const |
Returns the index of a given TimeSigSetting.
const juce::Array<TempoSetting*>& tracktion::engine::TempoSequence::getTempos | ( | ) | const |
Returns the TempoSettings.
int tracktion::engine::TempoSequence::getNumTempos | ( | ) | const |
Returns the current number of TempoSettings.
TempoSetting* tracktion::engine::TempoSequence::getTempo | ( | int | index | ) | const |
Returns the TempoSetting at the given index.
TempoSetting& tracktion::engine::TempoSequence::getTempoAt | ( | TimePosition | ) | const |
Returns the TempoSetting at the given position.
TempoSetting& tracktion::engine::TempoSequence::getTempoAt | ( | BeatPosition | ) | const |
Returns the TempoSetting at the given position.
double tracktion::engine::TempoSequence::getBpmAt | ( | TimePosition | ) | const |
Returns the tempo at a given position.
N.B. This is the actual tempo at the time, including any curves. I.e. it is not just the bpm of the previous TempoSetting
double tracktion::engine::TempoSequence::getBeatsPerSecondAt | ( | TimePosition | , |
bool | lengthOfOneBeatDependsOnTimeSignature = false |
||
) | const |
Returns the tempo at a given position.
N.B. This is the actual tempo at the time, including any curves. I.e. it is not just the bpm of the previous TempoSetting
bool tracktion::engine::TempoSequence::isTripletsAtTime | ( | TimePosition | ) | const |
Returns true if the TempoSetting is triplets at the given time.
int tracktion::engine::TempoSequence::indexOfTempoAt | ( | TimePosition | ) | const |
Returns the index of the TempoSetting at the given position.
int tracktion::engine::TempoSequence::indexOfNextTempoAt | ( | TimePosition | ) | const |
Returns the index of the TempoSetting after the given position.
int tracktion::engine::TempoSequence::indexOfTempo | ( | const TempoSetting * | ) | const |
Returns the index of the given TempoSetting.
int tracktion::engine::TempoSequence::countTemposInRegion | ( | TimeRange | ) | const |
Returns the number of TempoSetting[s] in the given range.
TempoSetting::Ptr tracktion::engine::TempoSequence::insertTempo | ( | TimePosition | ) |
Inserts a tempo break that can be edited later.
TempoSetting::Ptr tracktion::engine::TempoSequence::insertTempo | ( | BeatPosition | , |
double | bpm, | ||
float | curve | ||
) |
Inserts a tempo with a bpm and curve value.
TimeSigSetting::Ptr tracktion::engine::TempoSequence::insertTimeSig | ( | TimePosition | ) |
Inserts a new TimeSigSetting at the given position.
TimeSigSetting::Ptr tracktion::engine::TempoSequence::insertTimeSig | ( | BeatPosition | ) |
Inserts a new TimeSigSetting at the given position.
void tracktion::engine::TempoSequence::removeTempo | ( | int | index, |
bool | remapEdit | ||
) |
Removes the TempoSetting at a given index.
remapEdit | If true, this will update the positions of Edit content |
void tracktion::engine::TempoSequence::removeTemposBetween | ( | TimeRange | , |
bool | remapEdit | ||
) |
Removes any TempoSetting[s] within the range.
remapEdit | If true, this will update the positions of Edit content |
void tracktion::engine::TempoSequence::removeTimeSig | ( | int | index | ) |
Removes the TimeSigSetting at a given index.
void tracktion::engine::TempoSequence::removeTimeSigsBetween | ( | TimeRange | ) |
Removes any TimeSigSetting[s] within the range.
void tracktion::engine::TempoSequence::moveTempoStart | ( | int | index, |
BeatDuration | deltaBeats, | ||
bool | snapToBeat | ||
) |
Moves the TempoSetting at a given index by a number of beats.
void tracktion::engine::TempoSequence::moveTimeSigStart | ( | int | index, |
BeatDuration | deltaBeats, | ||
bool | snapToBeat | ||
) |
Moves the TimeSigSetting at a given index by a number of beats.
void tracktion::engine::TempoSequence::insertSpaceIntoSequence | ( | TimePosition | time, |
TimeDuration | amountOfSpaceInSeconds, | ||
bool | snapToBeat | ||
) |
Inserts space in to a sequence, shifting TempoSettings and TimeSigs.
void tracktion::engine::TempoSequence::deleteRegion | ( | TimeRange | ) |
Removes a region in a sequence, shifting TempoSettings and TimeSigs.
BeatPosition tracktion::engine::TempoSequence::toBeats | ( | TimePosition | ) | const |
Converts a time to a number of beats.
BeatRange tracktion::engine::TempoSequence::toBeats | ( | TimeRange | ) | const |
Converts a time range to a beat range.
BeatPosition tracktion::engine::TempoSequence::toBeats | ( | tempo::BarsAndBeats | ) | const |
Converts a number of BarsAndBeats to a position.
TimePosition tracktion::engine::TempoSequence::toTime | ( | BeatPosition | ) | const |
Converts a number of beats a time.
TimeRange tracktion::engine::TempoSequence::toTime | ( | BeatRange | ) | const |
Converts a beat range to a time range.
TimePosition tracktion::engine::TempoSequence::toTime | ( | tempo::BarsAndBeats | ) | const |
Converts a number of BarsAndBeats to a position.
tempo::BarsAndBeats tracktion::engine::TempoSequence::toBarsAndBeats | ( | TimePosition | ) | const |
Converts a time to a number of BarsAndBeats.
const tempo::Sequence& tracktion::engine::TempoSequence::getInternalSequence | ( | ) | const |
N.B.
It is only safe to call this from the message thread or during audio callbacks. Access at any other time could incur data races.
tempo::BarsAndBeats tracktion::engine::TempoSequence::timeToBarsBeats | ( | TimePosition | ) | const |
TimePosition tracktion::engine::TempoSequence::barsBeatsToTime | ( | tempo::BarsAndBeats | ) | const |
BeatPosition tracktion::engine::TempoSequence::barsBeatsToBeats | ( | tempo::BarsAndBeats | ) | const |
BeatPosition tracktion::engine::TempoSequence::timeToBeats | ( | TimePosition | time | ) | const |
BeatRange tracktion::engine::TempoSequence::timeToBeats | ( | TimeRange | range | ) | const |
TimePosition tracktion::engine::TempoSequence::beatsToTime | ( | BeatPosition | beats | ) | const |
TimeRange tracktion::engine::TempoSequence::beatsToTime | ( | BeatRange | range | ) | const |
TimeSigSetting& tracktion::engine::TempoSequence::getTimeSigAtBeat | ( | BeatPosition | ) | const |
TempoSetting& tracktion::engine::TempoSequence::getTempoAtBeat | ( | BeatPosition | ) | const |
|
noexcept |
|
overridevirtual |
Implements tracktion::engine::Selectable.
void tracktion::engine::TempoSequence::freeResources | ( | ) |
void tracktion::engine::TempoSequence::updateTempoData | ( | ) |
Edit& tracktion::engine::TempoSequence::edit |