TracktionEngine
|
Base class for EditItems that live in a Track, e.g. More...
#include <tracktion_TrackItem.h>
Public Types | |
enum class | Type { unknown , wave , midi , edit , step , marker , pitch , timeSig , collection , video , recording , chord , arranger , container } |
Defines the types of item that can live on Track[s]. More... | |
![]() | |
using | WeakRef = juce::WeakReference< Selectable > |
Public Member Functions | |
TrackItem (Edit &, EditItemID, Type) | |
Creates a TrackItem with an ID and type. | |
~TrackItem () | |
Destructor. | |
virtual Track * | getTrack () const =0 |
Must return the track this item lives on. | |
virtual bool | isGrouped () const |
Should return true if this clip is part of a group. | |
virtual TrackItem * | getGroupParent () const |
If this clip is part of a group, this should return the parent item it belongs to. | |
virtual ClipPosition | getPosition () const =0 |
Must return the position of this item. | |
TimeRange | getEditTimeRange () const |
Returns the time range of this item. | |
BeatRange | getEditBeatRange () const |
Returns the beat range of this item. | |
BeatPosition | getStartBeat () const |
Returns the start beat in the Edit of this item. | |
BeatPosition | getContentStartBeat () const |
Returns the start beat of the content in the Edit of this item. | |
BeatPosition | getEndBeat () const |
Returns the end beat in the Edit of this item. | |
BeatDuration | getLengthInBeats () const |
Returns the duration in beats the of this item. | |
TimePosition | getTimeOfRelativeBeat (BeatDuration) const |
Returns an Edit time point for a given number of beats from the start of this item. | |
BeatPosition | getBeatOfRelativeTime (TimeDuration) const |
Returns an Edit beat point for a given number of seconds from the start of this item. | |
BeatDuration | getOffsetInBeats () const |
Returns an the offset of this item in beats. | |
EditItemID | getTrackID () const |
Returns the ID of the Track this item lives on. | |
![]() | |
EditItem (EditItemID, Edit &) | |
EditItem (Edit &, const juce::ValueTree &) | |
virtual | ~EditItem ()=default |
virtual juce::String | getName () const =0 |
![]() | |
Selectable () | |
virtual | ~Selectable () |
virtual juce::String | getSelectableDescription ()=0 |
Subclasses must return a description of what they are. | |
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 () |
Static Public Member Functions | |
static const char * | typeToString (Type) |
Returns the string version of a TrackItem::Type. | |
static juce::Identifier | clipTypeToXMLType (Type) |
Returns an Identifier version of a TrackItem::Type. | |
static TrackItem::Type | xmlTagToType (juce::StringRef) |
Returns the TrackItem::Type of a type string. | |
static TrackItem::Type | stringToType (const juce::String &) |
Returns the TrackItem::Type of a type string. | |
static juce::String | getSuggestedNameForNewItem (Type) |
Returns a text string for a new clip of the given type. | |
template<typename ArrayType > | |
static void | sortByTime (ArrayType &items) |
Helper function to sort an array of TrackItem[s] by their start time. | |
template<typename ArrayType > | |
static void | stableSortByTime (ArrayType &items) |
Helper function to sort an array of TrackItem[s] by their start time without changing the order of items at the same time. | |
![]() | |
static void | initialise () |
static bool | isSelectableValid (const Selectable *) noexcept |
checks whether this object has been deleted. | |
Public Attributes | |
const Type | type |
The type of this item. | |
![]() | |
Edit & | edit |
const EditItemID | itemID |
Every EditItem has an ID which is unique within the edit. | |
![]() | |
WeakRef::Master | masterReference |
Base class for EditItems that live in a Track, e.g.
clips
|
strong |
Defines the types of item that can live on Track[s].
Enumerator | |
---|---|
unknown | A placeholder for unknown items. |
wave | A wave clip.
|
midi | A MIDI clip.
|
edit | An Edit clip.
|
step | A MIDI step clip.
|
marker | A marker clip.
|
pitch | A pitch setting.
|
timeSig | A time signature settings.
|
collection | A collection clip.
|
video | A video clip. N.B. not yet imlemented. |
recording | A temporary recording clip. |
chord | A chord clip.
|
arranger | An arranger clip.
|
container | An container clip.
|
tracktion::engine::TrackItem::TrackItem | ( | Edit & | , |
EditItemID | , | ||
Type | |||
) |
tracktion::engine::TrackItem::~TrackItem | ( | ) |
Destructor.
|
static |
Returns the string version of a TrackItem::Type.
|
static |
Returns an Identifier version of a TrackItem::Type.
|
static |
Returns the TrackItem::Type of a type string.
|
static |
Returns the TrackItem::Type of a type string.
|
static |
Returns a text string for a new clip of the given type.
E.g. "New Audio Clip" for Type::wave
|
pure virtual |
Must return the track this item lives on.
Implemented in tracktion::engine::Clip, tracktion::engine::CollectionClip, tracktion::engine::PitchSetting, and tracktion::engine::TimeSigSetting.
Referenced by tracktion::engine::TrackSection::merge().
|
virtual |
Should return true if this clip is part of a group.
Reimplemented in tracktion::engine::Clip.
|
virtual |
If this clip is part of a group, this should return the parent item it belongs to.
Reimplemented in tracktion::engine::Clip.
|
pure virtual |
Must return the position of this item.
Implemented in tracktion::engine::Clip, tracktion::engine::CollectionClip, tracktion::engine::StepClip, tracktion::engine::PitchSetting, and tracktion::engine::TimeSigSetting.
Referenced by getEditTimeRange().
TimeRange tracktion::engine::TrackItem::getEditTimeRange | ( | ) | const |
Returns the time range of this item.
References getPosition(), and tracktion::engine::ClipPosition::time.
Referenced by tracktion::engine::TrackSection::merge().
BeatRange tracktion::engine::TrackItem::getEditBeatRange | ( | ) | const |
Returns the beat range of this item.
BeatPosition tracktion::engine::TrackItem::getStartBeat | ( | ) | const |
Returns the start beat in the Edit of this item.
BeatPosition tracktion::engine::TrackItem::getContentStartBeat | ( | ) | const |
Returns the start beat of the content in the Edit of this item.
I.e. the beat index of (start - offset)
BeatPosition tracktion::engine::TrackItem::getEndBeat | ( | ) | const |
Returns the end beat in the Edit of this item.
BeatDuration tracktion::engine::TrackItem::getLengthInBeats | ( | ) | const |
Returns the duration in beats the of this item.
TimePosition tracktion::engine::TrackItem::getTimeOfRelativeBeat | ( | BeatDuration | ) | const |
Returns an Edit time point for a given number of beats from the start of this item.
BeatPosition tracktion::engine::TrackItem::getBeatOfRelativeTime | ( | TimeDuration | ) | const |
Returns an Edit beat point for a given number of seconds from the start of this item.
BeatDuration tracktion::engine::TrackItem::getOffsetInBeats | ( | ) | const |
Returns an the offset of this item in beats.
EditItemID tracktion::engine::TrackItem::getTrackID | ( | ) | const |
Returns the ID of the Track this item lives on.
|
static |
Helper function to sort an array of TrackItem[s] by their start time.
|
static |
Helper function to sort an array of TrackItem[s] by their start time without changing the order of items at the same time.
const Type tracktion::engine::TrackItem::type |
The type of this item.