TracktionEngine
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
tracktion::engine::Clip Class Referenceabstract

A clip in an edit. More...

Inheritance diagram for tracktion::engine::Clip:

Classes

struct  Listener
 Listener interface to be notified of recorded MIDI being sent to the plugins. More...
 

Public Types

enum  SyncType { syncBarsBeats = 0 , syncAbsolute }
 Determines the clip sync type. More...
 
using Ptr = juce::ReferenceCountedObjectPtr< Clip >
 
using Array = juce::ReferenceCountedArray< Clip >
 
- Public Types inherited from tracktion::engine::TrackItem
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

 Clip (const juce::ValueTree &, ClipOwner &, EditItemID, Type)
 Creates a clip of a given type from a ValueTree state. More...
 
 ~Clip () override
 Destructor. More...
 
virtual void initialise ()
 Initialises the Clip. More...
 
virtual void flushStateToValueTree ()
 Can be overridden to ensure any state (e.g. More...
 
virtual void sourceMediaChanged ()
 Called when the source media file reference (attribute "source") has changed - i.e. More...
 
virtual void pitchTempoTrackChanged ()
 Called when there are pitch or tempo changes made which might require clips to adjust timing information. More...
 
virtual juce::String getName () const override
 Returns the name of the clip. More...
 
void setName (const juce::String &newName)
 Sets a new name for a clip. More...
 
virtual bool isMidi () const =0
 Returns true if this is a MidiClip. More...
 
virtual bool canBeAddedTo (ClipOwner &)=0
 Tests whether this clip can go on the given parent. More...
 
virtual bool usesSourceFile () const
 True if it references a source file - i.e. More...
 
SourceFileReferencegetSourceFileReference ()
 Returns the SourceFileReference of the Clip. More...
 
juce::File getCurrentSourceFile () const
 Returns the current source file, this is different to the SourceFileReference as it could be a temporary comp file, clipFX, reverse render etc. More...
 
juce::Array< ReferencedItemgetReferencedItems () override
 Returns an array of any ReferencedItem[s] e.g. More...
 
void reassignReferencedItem (const ReferencedItem &, ProjectItemID, double) override
 Should be implemented to change the underlying source to a new ProjectItemID. More...
 
ClipPosition getPosition () const override
 Returns the ClipPosition on the parent Track. More...
 
BeatPosition getContentBeatAtTime (TimePosition) const
 Returns the beat number (with offset) at the given time. More...
 
TimePosition getTimeOfContentBeat (BeatPosition) const
 Returns time of a beat number. More...
 
virtual TimeDuration getMaximumLength ()
 Returns the maximum length this clip can have. More...
 
virtual juce::Array< TimePosition > getInterestingTimes ()
 Returns times for snapping to, relative to the Edit. More...
 
TimePosition getSpottingPoint () const
 Returns the first marked time in the source file which can be used for syncronising newly added clips. More...
 
virtual bool canLoop () const
 Returns true if this clip is capable of looping. More...
 
virtual bool isLooping () const
 Returns true if this clip is currently looping. More...
 
virtual bool beatBasedLooping () const
 Returns true if this clip's looping is based on beats or false if absolute time. More...
 
virtual void setNumberOfLoops (int)
 Sets the clip looping a number of times. More...
 
virtual void disableLooping ()
 Disables all looping. More...
 
virtual BeatPosition getLoopStartBeats () const
 Returns the beat position of the loop start point. More...
 
virtual TimePosition getLoopStart () const
 Returns the start time of the loop start point. More...
 
virtual BeatDuration getLoopLengthBeats () const
 Returns the length of loop in beats. More...
 
virtual TimeDuration getLoopLength () const
 Returns the length of loop in seconds. More...
 
TimeRange getLoopRange () const
 Returns the loop range in seconds. More...
 
BeatRange getLoopRangeBeats () const
 Returns the loop range in beats. More...
 
virtual void setLoopRange (TimeRange)
 Sets the loop range the clip should use in seconds. More...
 
virtual void setLoopRangeBeats (BeatRange)
 Sets the loop range the clip should use in beats. More...
 
virtual bool isMuted () const =0
 Returns true if the clip is muted. More...
 
virtual void setMuted (bool)
 Mutes or unmutes the clip. More...
 
virtual void setSyncType (SyncType sync)
 Sets the sync type for the clip. More...
 
SyncType getSyncType () const
 Returns the sync type clip is using. More...
 
void setPosition (ClipPosition newPosition)
 Sets the position of the clip. More...
 
void setStart (TimePosition newStart, bool preserveSync, bool keepLength)
 Sets the start time of the clip. More...
 
void setLength (TimeDuration newLength, bool preserveSync)
 Sets the length of the clip. More...
 
void setEnd (TimePosition newEnd, bool preserveSync)
 Sets the end of the clip. More...
 
void setOffset (TimeDuration newOffset)
 Sets the offset of the clip, i.e. More...
 
void trimAwayOverlap (TimeRange editRangeToTrim)
 Trims away any part of the clip that overlaps this region. More...
 
void removeFromParent ()
 Removes this clip from the parent track or container clip. More...
 
bool moveTo (ClipOwner &)
 Moves the clip to a new parent (if possible). More...
 
double getSpeedRatio () const noexcept
 Returns the speed ratio i.e. More...
 
virtual void setSpeedRatio (double)
 Sets a speed ratio i.e. More...
 
virtual void rescale (TimePosition pivotTimeInEdit, double factor)
 stretches and scales this clip relative to a fixed point in the edit. More...
 
bool isGrouped () const override
 Returns true if the clip is part of a group. More...
 
TrackItemgetGroupParent () const override
 Returns the parent TrackItem if part of a group. More...
 
void setGroup (EditItemID newGroupID)
 Sets the clip to be part of a group. More...
 
EditItemID getGroupID () const noexcept
 Returns the ID of the group. More...
 
CollectionClipgetGroupClip () const
 Returns this as a CollectionClip if it is one. More...
 
bool isLinked () const
 Returns true if this clip is linked with any others. More...
 
void setLinkGroupID (juce::String newLinkID)
 Sets the link ID to link this clip with others. More...
 
juce::String getLinkGroupID () const
 Returns the link ID of this clip. More...
 
ClipOwnergetParent () const
 Returns the parent ClipOwner this clip is on. More...
 
ClipTrackgetClipTrack () const
 Returns the parent ClipTrack this clip is on (if any). More...
 
TrackgetTrack () const override
 Returns the parent Track this clip is on (if any). More...
 
virtual juce::Colour getColour () const
 Returns the colour property of this clip. More...
 
void setColour (juce::Colour col)
 Sets the colour property of this clip. More...
 
virtual void removePlugin (const Plugin::Ptr &)
 Removes the given plugin from the clip if the clip supports plugins. More...
 
virtual bool addClipPlugin (const Plugin::Ptr &, SelectionManager &)
 Adds a plugin to the clip. More...
 
virtual Plugin::Array getAllPlugins ()
 Returns all the plugins on the clip. More...
 
virtual void sendMirrorUpdateToAllPlugins (Plugin &) const
 Sends an update to all plugins mirroing the one passed in. More...
 
virtual PluginListgetPluginList ()
 Returns the PluginList for this clip if it has one. More...
 
virtual juce::Colour getDefaultColour () const =0
 Returns the default colour for this clip. More...
 
virtual void clearTakes ()
 Clears any takes this clip has. More...
 
virtual bool hasAnyTakes () const
 Returns true if this clip has any takes. More...
 
virtual juce::StringArray getTakeDescriptions () const
 Returns the descriptions of any takes. More...
 
virtual void setCurrentTake (int)
 Sets a given take index to be the current take. More...
 
virtual int getCurrentTake () const
 Returns the current take index. More...
 
virtual int getNumTakes (bool)
 Returns the total number of takes. More...
 
virtual bool isCurrentTakeComp ()
 Returns true if the current take is a comp. More...
 
virtual void setShowingTakes (bool shouldShow)
 Sets whether the clip should be showing takes. More...
 
virtual bool isShowingTakes () const
 Returns true if the clip is showing takes. More...
 
virtual Clip::Array unpackTakes (bool)
 Attempts to unpack the takes to new clips. More...
 
virtual void cloneFrom (Clip *)
 Clones the given clip to this clip. More...
 
void updateLinkedClips ()
 Triggers a call to cloneFrom for all clips with the same linkID. More...
 
virtual PatternGeneratorgetPatternGenerator ()
 Returns the PatternGenerator for this clip if it has one. More...
 
void addListener (Listener *)
 Adds a Listener. More...
 
void removeListener (Listener *)
 Removes a Listener. More...
 
juce::ListenerList< Listener > & getListeners ()
 Returns the listener list so Nodes can manually call them. More...
 
void changed () override
 
juce::UndoManager * getUndoManager () const
 Returns the UndoManager. More...
 
virtual void setParent (ClipOwner *)
 
- Public Member Functions inherited from tracktion::engine::TrackItem
 TrackItem (Edit &, EditItemID, Type)
 Creates a TrackItem with an ID and type. More...
 
 ~TrackItem ()
 Destructor. More...
 
TimeRange getEditTimeRange () const
 Returns the time range of this item. More...
 
BeatRange getEditBeatRange () const
 Returns the beat range of this item. More...
 
BeatPosition getStartBeat () const
 Returns the start beat in the Edit of this item. More...
 
BeatPosition getContentStartBeat () const
 Returns the start beat of the content in the Edit of this item. More...
 
BeatPosition getEndBeat () const
 Returns the end beat in the Edit of this item. More...
 
BeatDuration getLengthInBeats () const
 Returns the duration in beats the of this item. More...
 
TimePosition getTimeOfRelativeBeat (BeatDuration) const
 Returns an Edit time point for a given number of beats from the start of this item. More...
 
BeatPosition getBeatOfRelativeTime (TimeDuration) const
 Returns an Edit beat point for a given number of seconds from the start of this item. More...
 
BeatDuration getOffsetInBeats () const
 Returns an the offset of this item in beats. More...
 
EditItemID getTrackID () const
 Returns the ID of the Track this item lives on. More...
 
- Public Member Functions inherited from tracktion::engine::EditItem
 EditItem (EditItemID, Edit &)
 
virtual ~EditItem ()=default
 
- Public Member Functions inherited from tracktion::engine::Selectable
 Selectable ()
 
virtual ~Selectable ()
 
virtual juce::String getSelectableDescription ()=0
 Subclasses must return a description of what they are. More...
 
virtual void selectionStatusChanged (bool isNowSelected)
 Can be overridden to tell this object that it has just been selected or deselected. 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 Member Functions inherited from tracktion::engine::Exportable
virtual ~Exportable ()=default
 

Static Public Member Functions

static bool isClipState (const juce::ValueTree &)
 Checks whether a ValueTree is some kind of clip state. More...
 
static bool isClipState (const juce::Identifier &)
 Checks whether a ValueTree type is some kind of clip state. More...
 
static Ptr createClipForState (const juce::ValueTree &, ClipOwner &targetParent)
 Creates a clip for a given ValueTree representation. More...
 
- Static Public Member Functions inherited from tracktion::engine::TrackItem
static const char * typeToString (Type)
 Returns the string version of a TrackItem::Type. More...
 
static juce::Identifier clipTypeToXMLType (Type)
 Returns an Identifier version of a TrackItem::Type. More...
 
static TrackItem::Type xmlTagToType (juce::StringRef)
 Returns the TrackItem::Type of a type string. More...
 
static TrackItem::Type stringToType (const juce::String &)
 Returns the TrackItem::Type of a type string. More...
 
static juce::String getSuggestedNameForNewItem (Type)
 Returns a text string for a new clip of the given type. More...
 
template<typename ArrayType >
static void sortByTime (ArrayType &items)
 Helper function to sort an array of TrackItem[s] by their start time. More...
 
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. More...
 
- 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...
 
- Static Public Member Functions inherited from tracktion::engine::Exportable
static juce::Array< Exportable * > addAllExportables (Edit &)
 Returns all the Exportables contained in an Edit. More...
 

Public Attributes

juce::ValueTree state
 The ValueTree of the Clip state. More...
 
juce::CachedValue< juce::Colour > colour
 The colour property. More...
 
- Public Attributes inherited from tracktion::engine::TrackItem
const Type type
 The type of this item. More...
 
- Public Attributes inherited from tracktion::engine::EditItem
Editedit
 
const EditItemID itemID
 Every EditItem has an ID which is unique within the edit. More...
 
- Public Attributes inherited from tracktion::engine::Selectable
WeakRef::Master masterReference
 

Protected Member Functions

void setCurrentSourceFile (const juce::File &)
 Sets a new source file for this clip. More...
 
virtual juce::Array< TimePosition > getRescaledMarkPoints () const
 Returns the mark points relative to the start of the clip, rescaled to the current speed. More...
 
void valueTreePropertyChanged (juce::ValueTree &, const juce::Identifier &) override
 
void valueTreeParentChanged (juce::ValueTree &) override
 

Protected Attributes

bool isInitialised = false
 
bool cloneInProgress = false
 
juce::CachedValue< juce::String > clipName
 
ClipOwnerparent = nullptr
 
juce::CachedValue< TimePosition > clipStart
 
juce::CachedValue< TimeDuration > length
 
juce::CachedValue< TimeDuration > offset
 
juce::CachedValue< double > speedRatio
 
SourceFileReference sourceFileReference
 
juce::CachedValue< EditItemIDgroupID
 
juce::CachedValue< juce::String > linkID
 
juce::File currentSourceFile
 
juce::CachedValue< SyncTypesyncType
 
juce::CachedValue< bool > showingTakes
 
std::unique_ptr< PatternGeneratorpatternGenerator
 
AsyncCaller updateLinkedClipsCaller
 
juce::ListenerList< Listenerlisteners
 

Detailed Description

A clip in an edit.

This is the base class for various clip types

Member Typedef Documentation

◆ Ptr

using tracktion::engine::Clip::Ptr = juce::ReferenceCountedObjectPtr<Clip>

◆ Array

using tracktion::engine::Clip::Array = juce::ReferenceCountedArray<Clip>

Member Enumeration Documentation

◆ SyncType

Determines the clip sync type.

Enumerator
syncBarsBeats 

Sync to beats.

syncAbsolute 

Sync to abslute time.

Constructor & Destructor Documentation

◆ Clip()

tracktion::engine::Clip::Clip ( const juce::ValueTree &  ,
ClipOwner ,
EditItemID  ,
Type   
)

Creates a clip of a given type from a ValueTree state.

Clip's have to have a parent ClipOwner and unique EditItemID

See also
Edit::createNewItemID You would usually create a clip using ClipOwner::insertNewClip

◆ ~Clip()

tracktion::engine::Clip::~Clip ( )
override

Destructor.

Member Function Documentation

◆ initialise()

virtual void tracktion::engine::Clip::initialise ( )
virtual

◆ isClipState() [1/2]

static bool tracktion::engine::Clip::isClipState ( const juce::ValueTree &  )
static

Checks whether a ValueTree is some kind of clip state.

◆ isClipState() [2/2]

static bool tracktion::engine::Clip::isClipState ( const juce::Identifier &  )
static

Checks whether a ValueTree type is some kind of clip state.

◆ createClipForState()

static Ptr tracktion::engine::Clip::createClipForState ( const juce::ValueTree &  ,
ClipOwner targetParent 
)
static

Creates a clip for a given ValueTree representation.

This may return a previously-existing clip with the same ID.

◆ flushStateToValueTree()

virtual void tracktion::engine::Clip::flushStateToValueTree ( )
virtual

Can be overridden to ensure any state (e.g.

clip plugins) is flushed to the ValueTree ready for saving.

Reimplemented in tracktion::engine::ContainerClip, and tracktion::engine::AudioClipBase.

◆ sourceMediaChanged()

virtual void tracktion::engine::Clip::sourceMediaChanged ( )
virtual

Called when the source media file reference (attribute "source") has changed - i.e.

when the clip has a new ProjectItemID assigned, not when the file itself changes.

Reimplemented in tracktion::engine::WaveAudioClip, and tracktion::engine::EditClip.

◆ pitchTempoTrackChanged()

virtual void tracktion::engine::Clip::pitchTempoTrackChanged ( )
virtual

Called when there are pitch or tempo changes made which might require clips to adjust timing information.

Reimplemented in tracktion::engine::MidiClip, tracktion::engine::ContainerClip, tracktion::engine::ChordClip, and tracktion::engine::AudioClipBase.

◆ getName()

virtual juce::String tracktion::engine::Clip::getName ( ) const
overridevirtual

Returns the name of the clip.

Implements tracktion::engine::EditItem.

References clipName.

◆ setName()

void tracktion::engine::Clip::setName ( const juce::String &  newName)

Sets a new name for a clip.

◆ isMidi()

virtual bool tracktion::engine::Clip::isMidi ( ) const
pure virtual

◆ canBeAddedTo()

virtual bool tracktion::engine::Clip::canBeAddedTo ( ClipOwner )
pure virtual

◆ usesSourceFile()

virtual bool tracktion::engine::Clip::usesSourceFile ( ) const
virtual

True if it references a source file - i.e.

audio clips do, midi doesn't.

Reimplemented in tracktion::engine::WaveAudioClip, and tracktion::engine::EditClip.

◆ getSourceFileReference()

SourceFileReference& tracktion::engine::Clip::getSourceFileReference ( )

Returns the SourceFileReference of the Clip.

References sourceFileReference.

◆ getCurrentSourceFile()

juce::File tracktion::engine::Clip::getCurrentSourceFile ( ) const

Returns the current source file, this is different to the SourceFileReference as it could be a temporary comp file, clipFX, reverse render etc.

References currentSourceFile.

Referenced by tracktion::engine::AudioClipBase::getAudioFile().

◆ getReferencedItems()

juce::Array<ReferencedItem> tracktion::engine::Clip::getReferencedItems ( )
overridevirtual

Returns an array of any ReferencedItem[s] e.g.

audio files.

Implements tracktion::engine::Exportable.

◆ reassignReferencedItem()

void tracktion::engine::Clip::reassignReferencedItem ( const ReferencedItem ,
ProjectItemID  ,
double   
)
overridevirtual

Should be implemented to change the underlying source to a new ProjectItemID.

Implements tracktion::engine::Exportable.

Reimplemented in tracktion::engine::WaveAudioClip.

◆ getPosition()

ClipPosition tracktion::engine::Clip::getPosition ( ) const
overridevirtual

Returns the ClipPosition on the parent Track.

Implements tracktion::engine::TrackItem.

◆ getContentBeatAtTime()

BeatPosition tracktion::engine::Clip::getContentBeatAtTime ( TimePosition  ) const

Returns the beat number (with offset) at the given time.

◆ getTimeOfContentBeat()

TimePosition tracktion::engine::Clip::getTimeOfContentBeat ( BeatPosition  ) const

Returns time of a beat number.

◆ getMaximumLength()

virtual TimeDuration tracktion::engine::Clip::getMaximumLength ( )
virtual

Returns the maximum length this clip can have.

Reimplemented in tracktion::engine::AudioClipBase.

References tracktion::engine::Edit::getMaximumEditEnd().

◆ getInterestingTimes()

virtual juce::Array<TimePosition> tracktion::engine::Clip::getInterestingTimes ( )
virtual

Returns times for snapping to, relative to the Edit.

Base class adds start and end time.

◆ getSpottingPoint()

TimePosition tracktion::engine::Clip::getSpottingPoint ( ) const

Returns the first marked time in the source file which can be used for syncronising newly added clips.

◆ canLoop()

virtual bool tracktion::engine::Clip::canLoop ( ) const
virtual

Returns true if this clip is capable of looping.

Reimplemented in tracktion::engine::MidiClip, and tracktion::engine::AudioClipBase.

◆ isLooping()

virtual bool tracktion::engine::Clip::isLooping ( ) const
virtual

Returns true if this clip is currently looping.

Reimplemented in tracktion::engine::MidiClip, and tracktion::engine::AudioClipBase.

◆ beatBasedLooping()

virtual bool tracktion::engine::Clip::beatBasedLooping ( ) const
virtual

Returns true if this clip's looping is based on beats or false if absolute time.

Reimplemented in tracktion::engine::StepClip, tracktion::engine::MidiClip, and tracktion::engine::AudioClipBase.

◆ setNumberOfLoops()

virtual void tracktion::engine::Clip::setNumberOfLoops ( int  )
virtual

Sets the clip looping a number of times.

Reimplemented in tracktion::engine::MidiClip, and tracktion::engine::AudioClipBase.

◆ disableLooping()

virtual void tracktion::engine::Clip::disableLooping ( )
virtual

Disables all looping.

Reimplemented in tracktion::engine::MidiClip, and tracktion::engine::AudioClipBase.

◆ getLoopStartBeats()

virtual BeatPosition tracktion::engine::Clip::getLoopStartBeats ( ) const
virtual

Returns the beat position of the loop start point.

Reimplemented in tracktion::engine::MidiClip, and tracktion::engine::AudioClipBase.

Referenced by getLoopRangeBeats().

◆ getLoopStart()

virtual TimePosition tracktion::engine::Clip::getLoopStart ( ) const
virtual

Returns the start time of the loop start point.

Reimplemented in tracktion::engine::MidiClip, and tracktion::engine::AudioClipBase.

Referenced by getLoopRange().

◆ getLoopLengthBeats()

virtual BeatDuration tracktion::engine::Clip::getLoopLengthBeats ( ) const
virtual

Returns the length of loop in beats.

Reimplemented in tracktion::engine::MidiClip, and tracktion::engine::AudioClipBase.

Referenced by getLoopRangeBeats().

◆ getLoopLength()

virtual TimeDuration tracktion::engine::Clip::getLoopLength ( ) const
virtual

Returns the length of loop in seconds.

Reimplemented in tracktion::engine::MidiClip, and tracktion::engine::AudioClipBase.

Referenced by getLoopRange().

◆ getLoopRange()

TimeRange tracktion::engine::Clip::getLoopRange ( ) const

Returns the loop range in seconds.

References getLoopLength(), and getLoopStart().

◆ getLoopRangeBeats()

BeatRange tracktion::engine::Clip::getLoopRangeBeats ( ) const

Returns the loop range in beats.

References getLoopLengthBeats(), and getLoopStartBeats().

◆ setLoopRange()

virtual void tracktion::engine::Clip::setLoopRange ( TimeRange  )
virtual

Sets the loop range the clip should use in seconds.

Reimplemented in tracktion::engine::MidiClip, and tracktion::engine::AudioClipBase.

◆ setLoopRangeBeats()

virtual void tracktion::engine::Clip::setLoopRangeBeats ( BeatRange  )
virtual

Sets the loop range the clip should use in beats.

Reimplemented in tracktion::engine::MidiClip, tracktion::engine::ContainerClip, and tracktion::engine::AudioClipBase.

◆ isMuted()

virtual bool tracktion::engine::Clip::isMuted ( ) const
pure virtual

◆ setMuted()

virtual void tracktion::engine::Clip::setMuted ( bool  )
virtual

◆ setSyncType()

virtual void tracktion::engine::Clip::setSyncType ( SyncType  sync)
virtual

Sets the sync type for the clip.

References syncType.

◆ getSyncType()

SyncType tracktion::engine::Clip::getSyncType ( ) const

Returns the sync type clip is using.

References syncType.

◆ setPosition()

void tracktion::engine::Clip::setPosition ( ClipPosition  newPosition)

Sets the position of the clip.

◆ setStart()

void tracktion::engine::Clip::setStart ( TimePosition  newStart,
bool  preserveSync,
bool  keepLength 
)

Sets the start time of the clip.

Parameters
newStartThe start time in seconds
preserveSyncWhether the source material position should be kept static in relation to the Edit's timeline.
keepLengthWhether the end should be moved to keep the same length.

◆ setLength()

void tracktion::engine::Clip::setLength ( TimeDuration  newLength,
bool  preserveSync 
)

Sets the length of the clip.

Parameters
newLengthThe length in seconds
preserveSyncWhether the source material position should be kept static in relation to the Edit's timeline.

◆ setEnd()

void tracktion::engine::Clip::setEnd ( TimePosition  newEnd,
bool  preserveSync 
)

Sets the end of the clip.

Parameters
newEndThe end time in seconds
preserveSyncWhether the source material position should be kept static in relation to the Edit's timeline.

◆ setOffset()

void tracktion::engine::Clip::setOffset ( TimeDuration  newOffset)

Sets the offset of the clip, i.e.

how much the clip's content should be shifted within the clip boundary.

Parameters
newOffsetThe offset in seconds

◆ trimAwayOverlap()

void tracktion::engine::Clip::trimAwayOverlap ( TimeRange  editRangeToTrim)

Trims away any part of the clip that overlaps this region.

◆ removeFromParent()

void tracktion::engine::Clip::removeFromParent ( )

Removes this clip from the parent track or container clip.

◆ moveTo()

bool tracktion::engine::Clip::moveTo ( ClipOwner )

Moves the clip to a new parent (if possible).

Returns
true if the clip could be moved.

◆ getSpeedRatio()

double tracktion::engine::Clip::getSpeedRatio ( ) const
noexcept

Returns the speed ratio i.e.

how quickly the clip plays back.

References speedRatio.

◆ setSpeedRatio()

virtual void tracktion::engine::Clip::setSpeedRatio ( double  )
virtual

Sets a speed ratio i.e.

how quickly the clip plays back.

Reimplemented in tracktion::engine::AudioClipBase.

◆ rescale()

virtual void tracktion::engine::Clip::rescale ( TimePosition  pivotTimeInEdit,
double  factor 
)
virtual

stretches and scales this clip relative to a fixed point in the edit.

Parameters
pivotTimeInEditThe time to keep fixed
factorThe scale factor

Reimplemented in tracktion::engine::MidiClip.

◆ isGrouped()

bool tracktion::engine::Clip::isGrouped ( ) const
overridevirtual

Returns true if the clip is part of a group.

Reimplemented from tracktion::engine::TrackItem.

References groupID.

◆ getGroupParent()

TrackItem* tracktion::engine::Clip::getGroupParent ( ) const
overridevirtual

Returns the parent TrackItem if part of a group.

Reimplemented from tracktion::engine::TrackItem.

◆ setGroup()

void tracktion::engine::Clip::setGroup ( EditItemID  newGroupID)

Sets the clip to be part of a group.

◆ getGroupID()

EditItemID tracktion::engine::Clip::getGroupID ( ) const
noexcept

Returns the ID of the group.

References groupID.

◆ getGroupClip()

CollectionClip* tracktion::engine::Clip::getGroupClip ( ) const

Returns this as a CollectionClip if it is one.

◆ isLinked()

bool tracktion::engine::Clip::isLinked ( ) const

Returns true if this clip is linked with any others.

References linkID.

◆ setLinkGroupID()

void tracktion::engine::Clip::setLinkGroupID ( juce::String  newLinkID)

Sets the link ID to link this clip with others.

References linkID.

◆ getLinkGroupID()

juce::String tracktion::engine::Clip::getLinkGroupID ( ) const

Returns the link ID of this clip.

References linkID.

◆ getParent()

ClipOwner* tracktion::engine::Clip::getParent ( ) const

Returns the parent ClipOwner this clip is on.

◆ getClipTrack()

ClipTrack* tracktion::engine::Clip::getClipTrack ( ) const

Returns the parent ClipTrack this clip is on (if any).

◆ getTrack()

Track* tracktion::engine::Clip::getTrack ( ) const
overridevirtual

Returns the parent Track this clip is on (if any).

Implements tracktion::engine::TrackItem.

◆ getColour()

virtual juce::Colour tracktion::engine::Clip::getColour ( ) const
virtual

Returns the colour property of this clip.

Reimplemented in tracktion::engine::MarkerClip, and tracktion::engine::ChordClip.

◆ setColour()

void tracktion::engine::Clip::setColour ( juce::Colour  col)

Sets the colour property of this clip.

References colour.

◆ removePlugin()

virtual void tracktion::engine::Clip::removePlugin ( const Plugin::Ptr )
virtual

Removes the given plugin from the clip if the clip supports plugins.

◆ addClipPlugin()

virtual bool tracktion::engine::Clip::addClipPlugin ( const Plugin::Ptr ,
SelectionManager  
)
virtual

Adds a plugin to the clip.

Returns
false if the clip contain plugins.

Reimplemented in tracktion::engine::AudioClipBase.

◆ getAllPlugins()

virtual Plugin::Array tracktion::engine::Clip::getAllPlugins ( )
virtual

Returns all the plugins on the clip.

Reimplemented in tracktion::engine::AudioClipBase.

◆ sendMirrorUpdateToAllPlugins()

virtual void tracktion::engine::Clip::sendMirrorUpdateToAllPlugins ( Plugin ) const
virtual

Sends an update to all plugins mirroing the one passed in.

Reimplemented in tracktion::engine::AudioClipBase.

◆ getPluginList()

virtual PluginList* tracktion::engine::Clip::getPluginList ( )
virtual

Returns the PluginList for this clip if it has one.

Reimplemented in tracktion::engine::AudioClipBase.

◆ getDefaultColour()

virtual juce::Colour tracktion::engine::Clip::getDefaultColour ( ) const
pure virtual

◆ clearTakes()

virtual void tracktion::engine::Clip::clearTakes ( )
virtual

Clears any takes this clip has.

Reimplemented in tracktion::engine::WaveAudioClip, and tracktion::engine::MidiClip.

◆ hasAnyTakes()

virtual bool tracktion::engine::Clip::hasAnyTakes ( ) const
virtual

Returns true if this clip has any takes.

Reimplemented in tracktion::engine::WaveAudioClip, and tracktion::engine::MidiClip.

◆ getTakeDescriptions()

virtual juce::StringArray tracktion::engine::Clip::getTakeDescriptions ( ) const
virtual

Returns the descriptions of any takes.

Reimplemented in tracktion::engine::WaveAudioClip, and tracktion::engine::MidiClip.

◆ setCurrentTake()

virtual void tracktion::engine::Clip::setCurrentTake ( int  )
virtual

Sets a given take index to be the current take.

Reimplemented in tracktion::engine::WaveAudioClip, and tracktion::engine::MidiClip.

◆ getCurrentTake()

virtual int tracktion::engine::Clip::getCurrentTake ( ) const
virtual

Returns the current take index.

Reimplemented in tracktion::engine::WaveAudioClip, and tracktion::engine::MidiClip.

Referenced by tracktion::engine::CompManager::getActiveTakeIndex().

◆ getNumTakes()

virtual int tracktion::engine::Clip::getNumTakes ( bool  )
virtual

Returns the total number of takes.

Parameters
includeCompsWhether comps should be included in the count

Reimplemented in tracktion::engine::WaveAudioClip, and tracktion::engine::MidiClip.

◆ isCurrentTakeComp()

virtual bool tracktion::engine::Clip::isCurrentTakeComp ( )
virtual

Returns true if the current take is a comp.

Reimplemented in tracktion::engine::WaveAudioClip, and tracktion::engine::MidiClip.

◆ setShowingTakes()

virtual void tracktion::engine::Clip::setShowingTakes ( bool  shouldShow)
virtual

Sets whether the clip should be showing takes.

References showingTakes.

◆ isShowingTakes()

virtual bool tracktion::engine::Clip::isShowingTakes ( ) const
virtual

Returns true if the clip is showing takes.

References showingTakes.

◆ unpackTakes()

virtual Clip::Array tracktion::engine::Clip::unpackTakes ( bool  )
virtual

Attempts to unpack the takes to new clips.

Parameters
toNewTracksIf true this will create new tracks for the new clips, otherwise they'll be placed on existing tracks

Reimplemented in tracktion::engine::WaveAudioClip, and tracktion::engine::MidiClip.

◆ cloneFrom()

virtual void tracktion::engine::Clip::cloneFrom ( Clip )
virtual

◆ updateLinkedClips()

void tracktion::engine::Clip::updateLinkedClips ( )

Triggers a call to cloneFrom for all clips with the same linkID.

See also
setLinkGroupID

◆ getPatternGenerator()

virtual PatternGenerator* tracktion::engine::Clip::getPatternGenerator ( )
virtual

Returns the PatternGenerator for this clip if it has one.

See also
MidiClip

Reimplemented in tracktion::engine::MidiClip, tracktion::engine::ChordClip, and tracktion::engine::AudioClipBase.

◆ addListener()

void tracktion::engine::Clip::addListener ( Listener )

Adds a Listener.

◆ removeListener()

void tracktion::engine::Clip::removeListener ( Listener )

Removes a Listener.

◆ getListeners()

juce::ListenerList<Listener>& tracktion::engine::Clip::getListeners ( )

Returns the listener list so Nodes can manually call them.

References listeners.

◆ changed()

void tracktion::engine::Clip::changed ( )
overridevirtual

Reimplemented from tracktion::engine::Selectable.

Reimplemented in tracktion::engine::EditClip.

◆ getUndoManager()

juce::UndoManager* tracktion::engine::Clip::getUndoManager ( ) const

Returns the UndoManager.

See also
Edit::getUndoManager.

◆ setParent()

virtual void tracktion::engine::Clip::setParent ( ClipOwner )
virtual

. Not intended for public use!

Reimplemented in tracktion::engine::AudioClipBase.

◆ setCurrentSourceFile()

void tracktion::engine::Clip::setCurrentSourceFile ( const juce::File &  )
protected

Sets a new source file for this clip.

◆ getRescaledMarkPoints()

virtual juce::Array<TimePosition> tracktion::engine::Clip::getRescaledMarkPoints ( ) const
protectedvirtual

Returns the mark points relative to the start of the clip, rescaled to the current speed.

Reimplemented in tracktion::engine::AudioClipBase.

◆ valueTreePropertyChanged()

void tracktion::engine::Clip::valueTreePropertyChanged ( juce::ValueTree &  ,
const juce::Identifier &   
)
overrideprotected

◆ valueTreeParentChanged()

void tracktion::engine::Clip::valueTreeParentChanged ( juce::ValueTree &  )
overrideprotected

Member Data Documentation

◆ state

juce::ValueTree tracktion::engine::Clip::state

The ValueTree of the Clip state.

◆ colour

juce::CachedValue<juce::Colour> tracktion::engine::Clip::colour

The colour property.

Referenced by setColour().

◆ isInitialised

bool tracktion::engine::Clip::isInitialised = false
protected

◆ cloneInProgress

bool tracktion::engine::Clip::cloneInProgress = false
protected

◆ clipName

juce::CachedValue<juce::String> tracktion::engine::Clip::clipName
protected

Referenced by getName().

◆ parent

ClipOwner* tracktion::engine::Clip::parent = nullptr
protected

◆ clipStart

juce::CachedValue<TimePosition> tracktion::engine::Clip::clipStart
protected

◆ length

juce::CachedValue<TimeDuration> tracktion::engine::Clip::length
protected

◆ offset

juce::CachedValue<TimeDuration> tracktion::engine::Clip::offset
protected

◆ speedRatio

juce::CachedValue<double> tracktion::engine::Clip::speedRatio
protected

Referenced by getSpeedRatio().

◆ sourceFileReference

SourceFileReference tracktion::engine::Clip::sourceFileReference
protected

Referenced by getSourceFileReference().

◆ groupID

juce::CachedValue<EditItemID> tracktion::engine::Clip::groupID
protected

Referenced by getGroupID(), and isGrouped().

◆ linkID

juce::CachedValue<juce::String> tracktion::engine::Clip::linkID
protected

◆ currentSourceFile

juce::File tracktion::engine::Clip::currentSourceFile
protected

Referenced by getCurrentSourceFile().

◆ syncType

juce::CachedValue<SyncType> tracktion::engine::Clip::syncType
protected

◆ showingTakes

juce::CachedValue<bool> tracktion::engine::Clip::showingTakes
protected

Referenced by isShowingTakes(), and setShowingTakes().

◆ patternGenerator

std::unique_ptr<PatternGenerator> tracktion::engine::Clip::patternGenerator
protected

◆ updateLinkedClipsCaller

AsyncCaller tracktion::engine::Clip::updateLinkedClipsCaller
protected

◆ listeners

juce::ListenerList<Listener> tracktion::engine::Clip::listeners
protected

Referenced by getListeners().


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