tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
tracktion::engine::TrackItem Class Referenceabstract

Base class for EditItems that live in a Track, e.g. More...

#include "tracktion_TrackItem.h"

Inheritance diagram for tracktion::engine::TrackItem:
tracktion::engine::EditItem tracktion::engine::Selectable juce::ReferenceCountedObject tracktion::engine::Clip tracktion::engine::CollectionClip tracktion::engine::PitchSetting tracktion::engine::TimeSigSetting tracktion::engine::ArrangerClip tracktion::engine::AudioClipBase tracktion::engine::ChordClip tracktion::engine::MarkerClip tracktion::engine::MidiClip tracktion::engine::StepClip tracktion::engine::ContainerClip tracktion::engine::EditClip tracktion::engine::WaveAudioClip

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...
 
- Public Types inherited from tracktion::engine::Selectable
using WeakRef = juce::WeakReference< Selectable >
 

Public Member Functions

 TrackItem (Edit &, EditItemID, Type)
 Creates a TrackItem with an ID and type.
 
 ~TrackItem ()
 Destructor.
 
virtual TrackgetTrack () 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 TrackItemgetGroupParent () 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.
 
- Public Member Functions inherited from tracktion::engine::EditItem
 EditItem (EditItemID, Edit &)
 
virtual juce::String getName () const =0
 
- Public Member Functions inherited from tracktion::engine::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 ()
 
- Public Member Functions inherited from juce::ReferenceCountedObject
void incReferenceCount () noexcept
 
void decReferenceCount () noexcept
 
bool decReferenceCountWithoutDeleting () noexcept
 
int getReferenceCount () const noexcept
 

Static Public Member Functions

static const chartypeToString (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 Public Member Functions inherited from tracktion::engine::Selectable
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.
 
- Public Attributes inherited from tracktion::engine::EditItem
Editedit
 
const EditItemID itemID
 Every EditItem has an ID which is unique within the edit.
 
- Public Attributes inherited from tracktion::engine::Selectable
WeakRef::Master masterReference
 

Additional Inherited Members

- Protected Member Functions inherited from juce::ReferenceCountedObject
 ReferenceCountedObject (const ReferenceCountedObject &) noexcept
 
 ReferenceCountedObject (ReferenceCountedObject &&) noexcept
 
ReferenceCountedObjectoperator= (const ReferenceCountedObject &) noexcept
 
ReferenceCountedObjectoperator= (ReferenceCountedObject &&) noexcept
 
void resetReferenceCount () noexcept
 

Detailed Description

Base class for EditItems that live in a Track, e.g.

clips

See also
WaveAudioClip, MidiClip, StepClip, MarkerClip, PitchSetting, TimeSigSetting

Definition at line 19 of file tracktion_TrackItem.h.

Member Enumeration Documentation

◆ Type

Defines the types of item that can live on Track[s].

Enumerator
unknown 

A placeholder for unknown items.

wave 

A wave clip.

See also
WaveAudioClip
midi 

A MIDI clip.

See also
MidiClip.
edit 

An Edit clip.

See also
EditClip.
step 

A MIDI step clip.

See also
StepClip.
marker 

A marker clip.

See also
MarkerClip.
pitch 

A pitch setting.

See also
PitchSetting.
timeSig 

A time signature settings.

See also
TimeSigSetting.
collection 

A collection clip.

See also
CollectionClip.
video 

A video clip.

N.B. not yet imlemented.

recording 

A temporary recording clip.

chord 

A chord clip.

See also
ChordClip.
arranger 

An arranger clip.

See also
ArrangerClip.
container 

An container clip.

See also
ContainerClip.

Definition at line 25 of file tracktion_TrackItem.h.

Constructor & Destructor Documentation

◆ TrackItem()

tracktion::engine::TrackItem::TrackItem ( Edit ed,
EditItemID  id,
Type  t 
)

Creates a TrackItem with an ID and type.

IDs should be unique within an Edit.

Definition at line 14 of file tracktion_TrackItem.cpp.

◆ ~TrackItem()

tracktion::engine::TrackItem::~TrackItem ( )

Destructor.

Definition at line 19 of file tracktion_TrackItem.cpp.

Member Function Documentation

◆ clipTypeToXMLType()

juce::Identifier tracktion::engine::TrackItem::clipTypeToXMLType ( TrackItem::Type  t)
static

Returns an Identifier version of a TrackItem::Type.

Definition at line 65 of file tracktion_TrackItem.cpp.

◆ getBeatOfRelativeTime()

BeatPosition tracktion::engine::TrackItem::getBeatOfRelativeTime ( TimeDuration  t) const

Returns an Edit beat point for a given number of seconds from the start of this item.

Definition at line 143 of file tracktion_TrackItem.cpp.

◆ getContentStartBeat()

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)

Definition at line 137 of file tracktion_TrackItem.cpp.

◆ getEditBeatRange()

BeatRange tracktion::engine::TrackItem::getEditBeatRange ( ) const

Returns the beat range of this item.

Definition at line 135 of file tracktion_TrackItem.cpp.

◆ getEditTimeRange()

TimeRange tracktion::engine::TrackItem::getEditTimeRange ( ) const

Returns the time range of this item.

Definition at line 84 of file tracktion_TrackItem.h.

◆ getEndBeat()

BeatPosition tracktion::engine::TrackItem::getEndBeat ( ) const

Returns the end beat in the Edit of this item.

Definition at line 141 of file tracktion_TrackItem.cpp.

◆ getGroupParent()

virtual TrackItem * tracktion::engine::TrackItem::getGroupParent ( ) const
virtual

If this clip is part of a group, this should return the parent item it belongs to.

Reimplemented in tracktion::engine::Clip.

Definition at line 77 of file tracktion_TrackItem.h.

◆ getLengthInBeats()

BeatDuration tracktion::engine::TrackItem::getLengthInBeats ( ) const

Returns the duration in beats the of this item.

Definition at line 138 of file tracktion_TrackItem.cpp.

◆ getOffsetInBeats()

BeatDuration tracktion::engine::TrackItem::getOffsetInBeats ( ) const

Returns an the offset of this item in beats.

Definition at line 139 of file tracktion_TrackItem.cpp.

◆ getPosition()

virtual ClipPosition tracktion::engine::TrackItem::getPosition ( ) const
pure virtual

◆ getStartBeat()

BeatPosition tracktion::engine::TrackItem::getStartBeat ( ) const

Returns the start beat in the Edit of this item.

Definition at line 136 of file tracktion_TrackItem.cpp.

◆ getSuggestedNameForNewItem()

juce::String tracktion::engine::TrackItem::getSuggestedNameForNewItem ( Type  t)
static

Returns a text string for a new clip of the given type.

E.g. "New Audio Clip" for Type::wave

Definition at line 102 of file tracktion_TrackItem.cpp.

◆ getTimeOfRelativeBeat()

TimePosition tracktion::engine::TrackItem::getTimeOfRelativeBeat ( BeatDuration  b) const

Returns an Edit time point for a given number of beats from the start of this item.

Definition at line 142 of file tracktion_TrackItem.cpp.

◆ getTrack()

virtual Track * tracktion::engine::TrackItem::getTrack ( ) const
pure virtual

◆ getTrackID()

EditItemID tracktion::engine::TrackItem::getTrackID ( ) const

Returns the ID of the Track this item lives on.

Definition at line 126 of file tracktion_TrackItem.cpp.

◆ isGrouped()

virtual bool tracktion::engine::TrackItem::isGrouped ( ) const
virtual

Should return true if this clip is part of a group.

Reimplemented in tracktion::engine::Clip.

Definition at line 74 of file tracktion_TrackItem.h.

◆ sortByTime()

template<typename ArrayType >
static void tracktion::engine::TrackItem::sortByTime ( ArrayType &  items)
static

Helper function to sort an array of TrackItem[s] by their start time.

Definition at line 121 of file tracktion_TrackItem.h.

◆ stableSortByTime()

template<typename ArrayType >
static void tracktion::engine::TrackItem::stableSortByTime ( ArrayType &  items)
static

Helper function to sort an array of TrackItem[s] by their start time without changing the order of items at the same time.

Definition at line 131 of file tracktion_TrackItem.h.

◆ stringToType()

TrackItem::Type tracktion::engine::TrackItem::stringToType ( const juce::String s)
static

Returns the TrackItem::Type of a type string.

Definition at line 45 of file tracktion_TrackItem.cpp.

◆ typeToString()

const char * tracktion::engine::TrackItem::typeToString ( TrackItem::Type  t)
static

Returns the string version of a TrackItem::Type.

Definition at line 23 of file tracktion_TrackItem.cpp.

◆ xmlTagToType()

TrackItem::Type tracktion::engine::TrackItem::xmlTagToType ( juce::StringRef  tag)
static

Returns the TrackItem::Type of a type string.

Definition at line 87 of file tracktion_TrackItem.cpp.

Member Data Documentation

◆ type

const Type tracktion::engine::TrackItem::type

The type of this item.

Definition at line 116 of file tracktion_TrackItem.h.


The documentation for this class was generated from the following files: