|
TracktionEngine
|
Holds a list of TempoSetting objects, to form a sequence of tempo changes. More...
#include <tracktion_TempoSequence.h>
Public Member Functions | |
| TempoSequence (Edit &) | |
| Creates a TempoSequence for an Edit. | |
| ~TempoSequence () override | |
| Destructor. | |
| Edit & | getEdit () const |
| Returns the Edit this TempoSequence refers to. | |
| const juce::ValueTree & | getState () const |
| Returns the state this TempoSequence models. | |
| void | setState (const juce::ValueTree &, bool remapEdit) |
| Sets the state this TempoSequence should refer to. | |
| void | createEmptyState () |
| Resets this to a default, empty state. | |
| void | copyFrom (const TempoSequence &) |
| Copies the contents of another TempoSequence. | |
| const juce::Array< TimeSigSetting * > & | getTimeSigs () const |
| Returns an array of the TimeSigSetting. | |
| int | getNumTimeSigs () const |
| Returns the number of TimeSigSetting[s] in the sequence. | |
| TimeSigSetting * | getTimeSig (int index) const |
| Returns the TimeSigSetting at a given index. | |
| TimeSigSetting & | getTimeSigAt (TimePosition) const |
| Returns the TimeSigSetting at a given position. | |
| TimeSigSetting & | getTimeSigAt (BeatPosition) const |
| Returns the TimeSigSetting at a given position. | |
| int | indexOfTimeSigAt (TimePosition) const |
| Returns the index of TimeSigSetting at a given position. | |
| int | indexOfTimeSig (const TimeSigSetting *) const |
| Returns the index of a given TimeSigSetting. | |
| const juce::Array< TempoSetting * > & | getTempos () const |
| Returns the TempoSettings. | |
| int | getNumTempos () const |
| Returns the current number of TempoSettings. | |
| TempoSetting * | getTempo (int index) const |
| Returns the TempoSetting at the given index. | |
| TempoSetting & | getTempoAt (TimePosition) const |
| Returns the TempoSetting at the given position. | |
| TempoSetting & | getTempoAt (BeatPosition) const |
| Returns the TempoSetting at the given position. | |
| double | getBpmAt (TimePosition) const |
| Returns the tempo at a given position. | |
| double | getBeatsPerSecondAt (TimePosition, bool lengthOfOneBeatDependsOnTimeSignature=false) const |
| Returns the tempo at a given position. | |
| bool | isTripletsAtTime (TimePosition) const |
| Returns true if the TempoSetting is triplets at the given time. | |
| int | indexOfTempoAt (TimePosition) const |
| Returns the index of the TempoSetting at the given position. | |
| int | indexOfNextTempoAt (TimePosition) const |
| Returns the index of the TempoSetting after the given position. | |
| int | indexOfTempo (const TempoSetting *) const |
| Returns the index of the given TempoSetting. | |
| int | countTemposInRegion (TimeRange) const |
| Returns the number of TempoSetting[s] in the given range. | |
| TempoSetting::Ptr | insertTempo (TimePosition) |
| Inserts a tempo break that can be edited later. | |
| TempoSetting::Ptr | insertTempo (BeatPosition, double bpm, float curve) |
| Inserts a tempo with a bpm and curve value. | |
| TimeSigSetting::Ptr | insertTimeSig (TimePosition) |
| Inserts a new TimeSigSetting at the given position. | |
| TimeSigSetting::Ptr | insertTimeSig (BeatPosition) |
| Inserts a new TimeSigSetting at the given position. | |
| void | removeTempo (int index, bool remapEdit) |
| Removes the TempoSetting at a given index. | |
| void | removeTemposBetween (TimeRange, bool remapEdit) |
| Removes any TempoSetting[s] within the range. | |
| void | removeTimeSig (int index) |
| Removes the TimeSigSetting at a given index. | |
| void | removeTimeSigsBetween (TimeRange) |
| Removes any TimeSigSetting[s] within the range. | |
| void | moveTempoStart (int index, BeatDuration deltaBeats, bool snapToBeat) |
| Moves the TempoSetting at a given index by a number of beats. | |
| void | moveTimeSigStart (int index, BeatDuration deltaBeats, bool snapToBeat) |
| Moves the TimeSigSetting at a given index by a number of beats. | |
| void | insertSpaceIntoSequence (TimePosition time, TimeDuration amountOfSpaceInSeconds, bool snapToBeat) |
| Inserts space in to a sequence, shifting TempoSettings and TimeSigs. | |
| void | deleteRegion (TimeRange) |
| Removes a region in a sequence, shifting TempoSettings and TimeSigs. | |
| BeatPosition | toBeats (TimePosition) const |
| Converts a time to a number of beats. | |
| BeatRange | toBeats (TimeRange) const |
| Converts a time range to a beat range. | |
| BeatPosition | toBeats (tempo::BarsAndBeats) const |
| Converts a number of BarsAndBeats to a position. | |
| TimePosition | toTime (BeatPosition) const |
| Converts a number of beats a time. | |
| TimeRange | toTime (BeatRange) const |
| Converts a beat range to a time range. | |
| TimePosition | toTime (tempo::BarsAndBeats) const |
| Converts a number of BarsAndBeats to a position. | |
| tempo::BarsAndBeats | toBarsAndBeats (TimePosition) const |
| Converts a time to a number of BarsAndBeats. | |
| const tempo::Sequence & | getInternalSequence () const |
| N.B. | |
| 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. | |
| 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 () |
Public Attributes | |
| Edit & | edit |
| The Edit this sequence belongs to. | |
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. | |
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 |