|
tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications
« « « Anklang Documentation |
Holds a list of TempoSetting objects, to form a sequence of tempo changes. More...
#include "tracktion_TempoSequence.h"
Classes | |
| struct | TempoSettingList |
| struct | TimeSigList |
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 |
| Subclasses must return a description of what they are. | |
| void | freeResources () |
| void | updateTempoData () |
Public Member Functions inherited from tracktion::engine::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 |
Friends | |
| class | TempoSetting |
| class | TimeSigSetting |
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.
Definition at line 35 of file tracktion_TempoSequence.h.
| tracktion::engine::TempoSequence::TempoSequence | ( | Edit & | e | ) |
Creates a TempoSequence for an Edit.
Definition at line 110 of file tracktion_TempoSequence.cpp.
|
override |
Destructor.
Definition at line 114 of file tracktion_TempoSequence.cpp.
| BeatPosition tracktion::engine::TempoSequence::barsBeatsToBeats | ( | tempo::BarsAndBeats | barsBeats | ) | const |
Definition at line 653 of file tracktion_TempoSequence.cpp.
| TimePosition tracktion::engine::TempoSequence::barsBeatsToTime | ( | tempo::BarsAndBeats | barsBeats | ) | const |
Definition at line 648 of file tracktion_TempoSequence.cpp.
| TimePosition tracktion::engine::TempoSequence::beatsToTime | ( | BeatPosition | beats | ) | const |
Definition at line 668 of file tracktion_TempoSequence.cpp.
| TimeRange tracktion::engine::TempoSequence::beatsToTime | ( | BeatRange | range | ) | const |
Definition at line 673 of file tracktion_TempoSequence.cpp.
| void tracktion::engine::TempoSequence::copyFrom | ( | const TempoSequence & | other | ) |
Copies the contents of another TempoSequence.
Definition at line 168 of file tracktion_TempoSequence.cpp.
| int tracktion::engine::TempoSequence::countTemposInRegion | ( | TimeRange | range | ) | const |
Returns the number of TempoSetting[s] in the given range.
Definition at line 620 of file tracktion_TempoSequence.cpp.
| void tracktion::engine::TempoSequence::createEmptyState | ( | ) |
Resets this to a default, empty state.
Definition at line 163 of file tracktion_TempoSequence.cpp.
| void tracktion::engine::TempoSequence::deleteRegion | ( | TimeRange | range | ) |
Removes a region in a sequence, shifting TempoSettings and TimeSigs.
Definition at line 383 of file tracktion_TempoSequence.cpp.
| void tracktion::engine::TempoSequence::freeResources | ( | ) |
Definition at line 173 of file tracktion_TempoSequence.cpp.
| double tracktion::engine::TempoSequence::getBeatsPerSecondAt | ( | TimePosition | time, |
| 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
Definition at line 488 of file tracktion_TempoSequence.cpp.
| double tracktion::engine::TempoSequence::getBpmAt | ( | TimePosition | time | ) | 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
Definition at line 482 of file tracktion_TempoSequence.cpp.
| Edit & tracktion::engine::TempoSequence::getEdit | ( | ) | const |
Returns the Edit this TempoSequence refers to.
Definition at line 47 of file tracktion_TempoSequence.h.
| 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.
Definition at line 547 of file tracktion_TempoSequence.cpp.
| int tracktion::engine::TempoSequence::getNumTempos | ( | ) | const |
Returns the current number of TempoSettings.
Definition at line 184 of file tracktion_TempoSequence.cpp.
| int tracktion::engine::TempoSequence::getNumTimeSigs | ( | ) | const |
Returns the number of TimeSigSetting[s] in the sequence.
Definition at line 180 of file tracktion_TempoSequence.cpp.
|
overridevirtual |
Subclasses must return a description of what they are.
Implements tracktion::engine::Selectable.
Definition at line 615 of file tracktion_TempoSequence.cpp.
| const juce::ValueTree & tracktion::engine::TempoSequence::getState | ( | ) | const |
Returns the state this TempoSequence models.
Definition at line 50 of file tracktion_TempoSequence.h.
| TempoSetting * tracktion::engine::TempoSequence::getTempo | ( | int | index | ) | const |
Returns the TempoSetting at the given index.
Definition at line 185 of file tracktion_TempoSequence.cpp.
| TempoSetting & tracktion::engine::TempoSequence::getTempoAt | ( | BeatPosition | beat | ) | const |
Returns the TempoSetting at the given position.
Definition at line 448 of file tracktion_TempoSequence.cpp.
| TempoSetting & tracktion::engine::TempoSequence::getTempoAt | ( | TimePosition | time | ) | const |
Returns the TempoSetting at the given position.
Definition at line 443 of file tracktion_TempoSequence.cpp.
| TempoSetting & tracktion::engine::TempoSequence::getTempoAtBeat | ( | BeatPosition | beat | ) | const |
Definition at line 683 of file tracktion_TempoSequence.cpp.
| const juce::Array< TempoSetting * > & tracktion::engine::TempoSequence::getTempos | ( | ) | const |
Returns the TempoSettings.
Definition at line 183 of file tracktion_TempoSequence.cpp.
| TimeSigSetting * tracktion::engine::TempoSequence::getTimeSig | ( | int | index | ) | const |
Returns the TimeSigSetting at a given index.
Definition at line 181 of file tracktion_TempoSequence.cpp.
| TimeSigSetting & tracktion::engine::TempoSequence::getTimeSigAt | ( | BeatPosition | beat | ) | const |
Returns the TimeSigSetting at a given position.
Definition at line 417 of file tracktion_TempoSequence.cpp.
| TimeSigSetting & tracktion::engine::TempoSequence::getTimeSigAt | ( | TimePosition | time | ) | const |
Returns the TimeSigSetting at a given position.
Definition at line 412 of file tracktion_TempoSequence.cpp.
| TimeSigSetting & tracktion::engine::TempoSequence::getTimeSigAtBeat | ( | BeatPosition | beat | ) | const |
Definition at line 678 of file tracktion_TempoSequence.cpp.
| const juce::Array< TimeSigSetting * > & tracktion::engine::TempoSequence::getTimeSigs | ( | ) | const |
Returns an array of the TimeSigSetting.
Definition at line 179 of file tracktion_TempoSequence.cpp.
|
noexcept |
Definition at line 120 of file tracktion_TempoSequence.cpp.
| int tracktion::engine::TempoSequence::indexOfNextTempoAt | ( | TimePosition | t | ) | const |
Returns the index of the TempoSetting after the given position.
Definition at line 468 of file tracktion_TempoSequence.cpp.
| int tracktion::engine::TempoSequence::indexOfTempo | ( | const TempoSetting * | t | ) | const |
Returns the index of the given TempoSetting.
Definition at line 477 of file tracktion_TempoSequence.cpp.
| int tracktion::engine::TempoSequence::indexOfTempoAt | ( | TimePosition | t | ) | const |
Returns the index of the TempoSetting at the given position.
Definition at line 458 of file tracktion_TempoSequence.cpp.
| int tracktion::engine::TempoSequence::indexOfTimeSig | ( | const TimeSigSetting * | timeSigSetting | ) | const |
Returns the index of a given TimeSigSetting.
Definition at line 437 of file tracktion_TempoSequence.cpp.
| int tracktion::engine::TempoSequence::indexOfTimeSigAt | ( | TimePosition | t | ) | const |
Returns the index of TimeSigSetting at a given position.
Definition at line 427 of file tracktion_TempoSequence.cpp.
| void tracktion::engine::TempoSequence::insertSpaceIntoSequence | ( | TimePosition | time, |
| TimeDuration | amountOfSpaceInSeconds, | ||
| bool | snapToBeat | ||
| ) |
Inserts space in to a sequence, shifting TempoSettings and TimeSigs.
Definition at line 360 of file tracktion_TempoSequence.cpp.
| TempoSetting::Ptr tracktion::engine::TempoSequence::insertTempo | ( | BeatPosition | beatNum, |
| double | bpm, | ||
| float | curve | ||
| ) |
Inserts a tempo with a bpm and curve value.
Definition at line 192 of file tracktion_TempoSequence.cpp.
| TempoSetting::Ptr tracktion::engine::TempoSequence::insertTempo | ( | TimePosition | time | ) |
Inserts a tempo break that can be edited later.
Definition at line 187 of file tracktion_TempoSequence.cpp.
| TimeSigSetting::Ptr tracktion::engine::TempoSequence::insertTimeSig | ( | BeatPosition | beats | ) |
Inserts a new TimeSigSetting at the given position.
Definition at line 225 of file tracktion_TempoSequence.cpp.
| TimeSigSetting::Ptr tracktion::engine::TempoSequence::insertTimeSig | ( | TimePosition | time | ) |
Inserts a new TimeSigSetting at the given position.
Definition at line 220 of file tracktion_TempoSequence.cpp.
| bool tracktion::engine::TempoSequence::isTripletsAtTime | ( | TimePosition | time | ) | const |
Returns true if the TempoSetting is triplets at the given time.
Definition at line 499 of file tracktion_TempoSequence.cpp.
| void tracktion::engine::TempoSequence::moveTempoStart | ( | int | index, |
| BeatDuration | deltaBeats, | ||
| bool | snapToBeat | ||
| ) |
Moves the TempoSetting at a given index by a number of beats.
Definition at line 318 of file tracktion_TempoSequence.cpp.
| void tracktion::engine::TempoSequence::moveTimeSigStart | ( | int | index, |
| BeatDuration | deltaBeats, | ||
| bool | snapToBeat | ||
| ) |
Moves the TimeSigSetting at a given index by a number of beats.
Definition at line 337 of file tracktion_TempoSequence.cpp.
| 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 |
Definition at line 259 of file tracktion_TempoSequence.cpp.
| void tracktion::engine::TempoSequence::removeTemposBetween | ( | TimeRange | range, |
| bool | remapEdit | ||
| ) |
Removes any TempoSetting[s] within the range.
| remapEdit | If true, this will update the positions of Edit content |
Definition at line 282 of file tracktion_TempoSequence.cpp.
| void tracktion::engine::TempoSequence::removeTimeSig | ( | int | index | ) |
Removes the TimeSigSetting at a given index.
Definition at line 298 of file tracktion_TempoSequence.cpp.
| void tracktion::engine::TempoSequence::removeTimeSigsBetween | ( | TimeRange | range | ) |
Removes any TimeSigSetting[s] within the range.
Definition at line 310 of file tracktion_TempoSequence.cpp.
| void tracktion::engine::TempoSequence::setState | ( | const juce::ValueTree & | v, |
| bool | remapEdit | ||
| ) |
Sets the state this TempoSequence should refer to.
Definition at line 126 of file tracktion_TempoSequence.cpp.
| tempo::BarsAndBeats tracktion::engine::TempoSequence::timeToBarsBeats | ( | TimePosition | t | ) | const |
Definition at line 643 of file tracktion_TempoSequence.cpp.
| BeatPosition tracktion::engine::TempoSequence::timeToBeats | ( | TimePosition | time | ) | const |
Definition at line 658 of file tracktion_TempoSequence.cpp.
| BeatRange tracktion::engine::TempoSequence::timeToBeats | ( | TimeRange | range | ) | const |
Definition at line 663 of file tracktion_TempoSequence.cpp.
| tempo::BarsAndBeats tracktion::engine::TempoSequence::toBarsAndBeats | ( | TimePosition | t | ) | const |
Converts a time to a number of BarsAndBeats.
Definition at line 540 of file tracktion_TempoSequence.cpp.
| BeatPosition tracktion::engine::TempoSequence::toBeats | ( | tempo::BarsAndBeats | barsBeats | ) | const |
Converts a number of BarsAndBeats to a position.
Definition at line 517 of file tracktion_TempoSequence.cpp.
| BeatPosition tracktion::engine::TempoSequence::toBeats | ( | TimePosition | time | ) | const |
Converts a time to a number of beats.
Definition at line 505 of file tracktion_TempoSequence.cpp.
| BeatRange tracktion::engine::TempoSequence::toBeats | ( | TimeRange | range | ) | const |
Converts a time range to a beat range.
Definition at line 511 of file tracktion_TempoSequence.cpp.
| TimePosition tracktion::engine::TempoSequence::toTime | ( | BeatPosition | beats | ) | const |
Converts a number of beats a time.
Definition at line 522 of file tracktion_TempoSequence.cpp.
| TimeRange tracktion::engine::TempoSequence::toTime | ( | BeatRange | range | ) | const |
Converts a beat range to a time range.
Definition at line 528 of file tracktion_TempoSequence.cpp.
| TimePosition tracktion::engine::TempoSequence::toTime | ( | tempo::BarsAndBeats | barsBeats | ) | const |
Converts a number of BarsAndBeats to a position.
Definition at line 534 of file tracktion_TempoSequence.cpp.
| void tracktion::engine::TempoSequence::updateTempoData | ( | ) |
Definition at line 552 of file tracktion_TempoSequence.cpp.
|
friend |
Definition at line 220 of file tracktion_TempoSequence.h.
|
friend |
Definition at line 221 of file tracktion_TempoSequence.h.
| Edit& tracktion::engine::TempoSequence::edit |
The Edit this sequence belongs to.
Definition at line 196 of file tracktion_TempoSequence.h.