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

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

A clip in an edit. More...

#include "tracktion_Clip.h"

Inheritance diagram for tracktion::engine::Clip:
tracktion::engine::TrackItem tracktion::engine::Exportable juce::ValueTree::Listener tracktion::engine::EditItem tracktion::engine::Selectable juce::ReferenceCountedObject 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

Classes

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

Public Types

enum class  FollowActionDurationType { beats , loops }
 Defines the types of duration follow actions can use. More...
 
enum  SyncType { syncBarsBeats , 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.
 
 ~Clip () override
 Destructor.
 
virtual void initialise ()
 Initialises the Clip.
 
virtual void flushStateToValueTree ()
 Can be overridden to ensure any state (e.g.
 
virtual void sourceMediaChanged ()
 Called when the source media file reference (attribute "source") has changed - i.e.
 
virtual void pitchTempoTrackChanged ()
 Called when there are pitch or tempo changes made which might require clips to adjust timing information.
 
virtual juce::String getName () const override
 Returns the name of the clip.
 
void setName (const juce::String &newName)
 Sets a new name for a clip.
 
virtual bool isMidi () const =0
 Returns true if this is a MidiClip.
 
virtual bool canBeAddedTo (ClipOwner &)=0
 Tests whether this clip can go on the given parent.
 
virtual bool usesSourceFile () const
 True if it references a source file - i.e.
 
SourceFileReferencegetSourceFileReference ()
 Returns the SourceFileReference of the Clip.
 
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.
 
juce::Array< ReferencedItemgetReferencedItems () override
 Returns an array of any ReferencedItem[s] e.g.
 
void reassignReferencedItem (const ReferencedItem &, ProjectItemID, double) override
 Should be implemented to change the underlying source to a new ProjectItemID.
 
virtual std::shared_ptr< LaunchHandlegetLaunchHandle ()
 Some clip types can be launched, if that's possible, this returns a handle to trigger starting/stopping the clip.
 
virtual void setUsesGlobalLaunchQuatisation (bool)
 Some clip types can be launched, if that's possible, this sets whether the clip's quantisation or the global quantisation should be used.
 
virtual bool usesGlobalLaunchQuatisation ()
 Some clip types can be launched, if that's possible, this returns whether the clip's quantisation or the global quantisation should be used.
 
virtual LaunchQuantisationgetLaunchQuantisation ()
 Some clip types can be launched, if that's possible, this returns a quantisation that can be used for this clip.
 
virtual FollowActions * getFollowActions ()
 Some clip types can be launched, if that's possible, this can be used to determine the action to perform after a clip has played.
 
ClipPosition getPosition () const override
 Returns the ClipPosition on the parent Track.
 
BeatPosition getContentBeatAtTime (TimePosition) const
 Returns the beat number (with offset) at the given time.
 
TimePosition getTimeOfContentBeat (BeatPosition) const
 Returns time of a beat number.
 
virtual TimeDuration getMaximumLength ()
 Returns the maximum length this clip can have.
 
virtual juce::Array< TimePositiongetInterestingTimes ()
 Returns times for snapping to, relative to the Edit.
 
TimePosition getSpottingPoint () const
 Returns the first marked time in the source file which can be used for syncronising newly added clips.
 
virtual bool canLoop () const
 Returns true if this clip is capable of looping.
 
virtual bool isLooping () const
 Returns true if this clip is currently looping.
 
virtual bool beatBasedLooping () const
 Returns true if this clip's looping is based on beats or false if absolute time.
 
virtual void setNumberOfLoops (int)
 Sets the clip looping a number of times.
 
virtual void disableLooping ()
 Disables all looping.
 
virtual BeatPosition getLoopStartBeats () const
 Returns the beat position of the loop start point.
 
virtual TimePosition getLoopStart () const
 Returns the start time of the loop start point.
 
virtual BeatDuration getLoopLengthBeats () const
 Returns the length of loop in beats.
 
virtual TimeDuration getLoopLength () const
 Returns the length of loop in seconds.
 
TimeRange getLoopRange () const
 Returns the loop range in seconds.
 
BeatRange getLoopRangeBeats () const
 Returns the loop range in beats.
 
virtual void setLoopRange (TimeRange)
 Sets the loop range the clip should use in seconds.
 
virtual void setLoopRangeBeats (BeatRange)
 Sets the loop range the clip should use in beats.
 
virtual bool isMuted () const =0
 Returns true if the clip is muted.
 
virtual void setMuted (bool)
 Mutes or unmutes the clip.
 
virtual void setSyncType (SyncType sync)
 Sets the sync type for the clip.
 
SyncType getSyncType () const
 Returns the sync type clip is using.
 
void setPosition (ClipPosition newPosition)
 Sets the position of the clip.
 
void setStart (TimePosition newStart, bool preserveSync, bool keepLength)
 Sets the start time of the clip.
 
void setLength (TimeDuration newLength, bool preserveSync)
 Sets the length of the clip.
 
void setEnd (TimePosition newEnd, bool preserveSync)
 Sets the end of the clip.
 
void setOffset (TimeDuration newOffset)
 Sets the offset of the clip, i.e.
 
void trimAwayOverlap (TimeRange editRangeToTrim)
 Trims away any part of the clip that overlaps this region.
 
void removeFromParent ()
 Removes this clip from the parent track or container clip.
 
bool moveTo (ClipOwner &)
 Moves the clip to a new parent (if possible).
 
double getSpeedRatio () const noexcept
 Returns the speed ratio i.e.
 
virtual void setSpeedRatio (double)
 Sets a speed ratio i.e.
 
virtual void rescale (TimePosition pivotTimeInEdit, double factor)
 stretches and scales this clip relative to a fixed point in the edit.
 
bool isGrouped () const override
 Returns true if the clip is part of a group.
 
TrackItemgetGroupParent () const override
 Returns the parent TrackItem if part of a group.
 
void setGroup (EditItemID newGroupID)
 Sets the clip to be part of a group.
 
EditItemID getGroupID () const noexcept
 Returns the ID of the group.
 
CollectionClipgetGroupClip () const
 Returns this as a CollectionClip if it is one.
 
bool isLinked () const
 Returns true if this clip is linked with any others.
 
void setLinkGroupID (juce::String newLinkID)
 Sets the link ID to link this clip with others.
 
juce::String getLinkGroupID () const
 Returns the link ID of this clip.
 
ClipOwnergetParent () const
 Returns the parent ClipOwner this clip is on.
 
ClipTrackgetClipTrack () const
 Returns the parent ClipTrack this clip is on (if any).
 
TrackgetTrack () const override
 Returns the parent Track this clip is on (if any).
 
ClipSlotgetClipSlot () const
 Returns the parent ClipSlot this clip is on (if any).
 
virtual juce::Colour getColour () const
 Returns the colour property of this clip.
 
void setColour (juce::Colour col)
 Sets the colour property of this clip.
 
virtual void removePlugin (const Plugin::Ptr &)
 Removes the given plugin from the clip if the clip supports plugins.
 
virtual bool addClipPlugin (const Plugin::Ptr &, SelectionManager &)
 Adds a plugin to the clip.
 
virtual Plugin::Array getAllPlugins ()
 Returns all the plugins on the clip.
 
virtual void sendMirrorUpdateToAllPlugins (Plugin &) const
 Sends an update to all plugins mirroing the one passed in.
 
virtual PluginListgetPluginList ()
 Returns the PluginList for this clip if it has one.
 
virtual juce::Colour getDefaultColour () const =0
 Returns the default colour for this clip.
 
virtual void clearTakes ()
 Clears any takes this clip has.
 
virtual bool hasAnyTakes () const
 Returns true if this clip has any takes.
 
virtual juce::StringArray getTakeDescriptions () const
 Returns the descriptions of any takes.
 
virtual void setCurrentTake (int)
 Sets a given take index to be the current take.
 
virtual int getCurrentTake () const
 Returns the current take index.
 
virtual int getNumTakes (bool)
 Returns the total number of takes.
 
virtual bool isCurrentTakeComp ()
 Returns true if the current take is a comp.
 
virtual void setShowingTakes (bool shouldShow)
 Sets whether the clip should be showing takes.
 
virtual bool isShowingTakes () const
 Returns true if the clip is showing takes.
 
virtual Clip::Array unpackTakes (bool)
 Attempts to unpack the takes to new clips.
 
virtual void cloneFrom (Clip *)
 Clones the given clip to this clip.
 
void updateLinkedClips ()
 Triggers a call to cloneFrom for all clips with the same linkID.
 
virtual PatternGeneratorgetPatternGenerator ()
 Returns the PatternGenerator for this clip if it has one.
 
void addListener (Listener *)
 Adds a Listener.
 
void removeListener (Listener *)
 Removes a Listener.
 
juce::ListenerList< Listener > & getListeners ()
 Returns the listener list so Nodes can manually call them.
 
void changed () override
 This should be called to send a change notification to any SelectableListeners that are registered with this object.
 
juce::UndoManagergetUndoManager () const
 Returns the UndoManager.
 
virtual void setParent (ClipOwner *)
 
- Public Member Functions inherited from tracktion::engine::TrackItem
 TrackItem (Edit &, EditItemID, Type)
 Creates a TrackItem with an ID and type.
 
 ~TrackItem ()
 Destructor.
 
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 &)
 
- 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 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 bool isClipState (const juce::ValueTree &)
 Checks whether a ValueTree is some kind of clip state.
 
static bool isClipState (const juce::Identifier &)
 Checks whether a ValueTree type is some kind of clip state.
 
static Ptr createClipForState (const juce::ValueTree &, ClipOwner &targetParent)
 Creates a clip for a given ValueTree representation.
 
- Static Public Member Functions inherited from tracktion::engine::TrackItem
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.
 
- Static Public Member Functions inherited from tracktion::engine::Exportable
static juce::Array< Exportable * > addAllExportables (Edit &)
 Returns all the Exportables contained in an Edit.
 

Public Attributes

juce::CachedValue< FollowActionDurationTypefollowActionDurationType
 The type of duration to use for when to trigger the follow action.
 
juce::CachedValue< BeatDurationfollowActionBeats
 Determines the time for which a launched clip will play before a follow action is taken.
 
juce::CachedValue< doublefollowActionNumLoops
 Determines the number of loops for which a launched clip will play before a follow action is taken.
 
juce::ValueTree state
 The ValueTree of the Clip state.
 
juce::CachedValue< juce::Colourcolour
 The colour property.
 
juce::CachedValue< bool > disabled
 Whether the Clip is disabled or not.
 
- Public Attributes inherited from tracktion::engine::TrackItem
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
 

Protected Member Functions

void setCurrentSourceFile (const juce::File &)
 Sets a new source file for this clip.
 
virtual juce::Array< TimePositiongetRescaledMarkPoints () const
 Returns the mark points relative to the start of the clip, rescaled to the current speed.
 
void valueTreePropertyChanged (juce::ValueTree &, const juce::Identifier &) override
 
void valueTreeParentChanged (juce::ValueTree &) override
 
- Protected Member Functions inherited from juce::ReferenceCountedObject
 ReferenceCountedObject (const ReferenceCountedObject &) noexcept
 
 ReferenceCountedObject (ReferenceCountedObject &&) noexcept
 
ReferenceCountedObjectoperator= (const ReferenceCountedObject &) noexcept
 
ReferenceCountedObjectoperator= (ReferenceCountedObject &&) noexcept
 
void resetReferenceCount () noexcept
 
- Protected Member Functions inherited from juce::ValueTree::Listener
virtual void valueTreeChildAdded (ValueTree &parentTree, ValueTree &childWhichHasBeenAdded)
 
virtual void valueTreeChildRemoved (ValueTree &parentTree, ValueTree &childWhichHasBeenRemoved, int indexFromWhichChildWasRemoved)
 
virtual void valueTreeChildOrderChanged (ValueTree &parentTreeWhoseChildrenHaveMoved, int oldIndex, int newIndex)
 
virtual void valueTreeRedirected (ValueTree &treeWhichHasBeenChanged)
 

Protected Attributes

bool isInitialised
 
bool cloneInProgress
 
juce::CachedValue< juce::StringclipName
 
ClipOwnerparent
 
juce::CachedValue< TimePositionclipStart
 
juce::CachedValue< TimeDurationlength
 
juce::CachedValue< TimeDurationoffset
 
juce::CachedValue< doublespeedRatio
 
SourceFileReference sourceFileReference
 
juce::CachedValue< EditItemIDgroupID
 
juce::CachedValue< juce::StringlinkID
 
juce::File currentSourceFile
 
juce::CachedValue< SyncTypesyncType
 
juce::CachedValue< bool > showingTakes
 
std::unique_ptr< PatternGeneratorpatternGenerator
 
AsyncCaller updateLinkedClipsCaller
 
juce::ListenerList< Listenerlisteners
 

Friends

class Track
 
class ClipTrack
 
class CollectionClip
 

Detailed Description

A clip in an edit.

This is the base class for various clip types

Definition at line 67 of file tracktion_Clip.h.

Member Typedef Documentation

◆ Array

Definition at line 86 of file tracktion_Clip.h.

◆ Ptr

Definition at line 85 of file tracktion_Clip.h.

Member Enumeration Documentation

◆ FollowActionDurationType

Defines the types of duration follow actions can use.

Enumerator
beats 

A number of beats.

loops 

A number of loops.

Definition at line 175 of file tracktion_Clip.h.

◆ SyncType

Determines the clip sync type.

Enumerator
syncBarsBeats 

Sync to beats.

syncAbsolute 

Sync to abslute time.

Definition at line 247 of file tracktion_Clip.h.

Constructor & Destructor Documentation

◆ Clip()

tracktion::engine::Clip::Clip ( const juce::ValueTree v,
ClipOwner targetParent,
EditItemID  id,
Type  t 
)

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

Definition at line 15 of file tracktion_Clip.cpp.

◆ ~Clip()

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

Destructor.

Definition at line 53 of file tracktion_Clip.cpp.

Member Function Documentation

◆ 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.

Definition at line 353 of file tracktion_Clip.h.

◆ addListener()

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

Adds a Listener.

Definition at line 642 of file tracktion_Clip.cpp.

◆ 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::AudioClipBase, tracktion::engine::MidiClip, and tracktion::engine::StepClip.

Definition at line 216 of file tracktion_Clip.h.

◆ canBeAddedTo()

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

◆ canLoop()

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

Returns true if this clip is capable of looping.

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

Definition at line 212 of file tracktion_Clip.h.

◆ changed()

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

This should be called to send a change notification to any SelectableListeners that are registered with this object.

Reimplemented from tracktion::engine::Selectable.

Reimplemented in tracktion::engine::EditClip.

Definition at line 273 of file tracktion_Clip.cpp.

◆ clearTakes()

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

Clears any takes this clip has.

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

Definition at line 369 of file tracktion_Clip.h.

◆ cloneFrom()

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

◆ createClipForState()

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

Creates a clip for a given ValueTree representation.

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

Definition at line 159 of file tracktion_Clip.cpp.

◆ disableLooping()

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

Disables all looping.

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

Definition at line 220 of file tracktion_Clip.h.

◆ flushStateToValueTree()

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::AudioClipBase, and tracktion::engine::ContainerClip.

Definition at line 188 of file tracktion_Clip.cpp.

◆ getAllPlugins()

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

Returns all the plugins on the clip.

Reimplemented in tracktion::engine::AudioClipBase.

Definition at line 356 of file tracktion_Clip.h.

◆ getClipSlot()

ClipSlot * tracktion::engine::Clip::getClipSlot ( ) const

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

Definition at line 267 of file tracktion_Clip.cpp.

◆ getClipTrack()

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

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

Definition at line 251 of file tracktion_Clip.cpp.

◆ getColour()

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

Returns the colour property of this clip.

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

Definition at line 636 of file tracktion_Clip.cpp.

◆ getContentBeatAtTime()

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

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

Definition at line 614 of file tracktion_Clip.cpp.

◆ 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.

Definition at line 135 of file tracktion_Clip.h.

◆ getCurrentTake()

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

Returns the current take index.

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

Definition at line 377 of file tracktion_Clip.h.

◆ getDefaultColour()

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

◆ getFollowActions()

virtual FollowActions * tracktion::engine::Clip::getFollowActions ( )
virtual

Some clip types can be launched, if that's possible, this can be used to determine the action to perform after a clip has played.

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

Definition at line 172 of file tracktion_Clip.h.

◆ getGroupClip()

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

Returns this as a CollectionClip if it is one.

Definition at line 464 of file tracktion_Clip.cpp.

◆ getGroupID()

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

Returns the ID of the group.

Definition at line 318 of file tracktion_Clip.h.

◆ getGroupParent()

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

Returns the parent TrackItem if part of a group.

Reimplemented from tracktion::engine::TrackItem.

Definition at line 624 of file tracktion_Clip.cpp.

◆ getInterestingTimes()

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

Returns times for snapping to, relative to the Edit.

Base class adds start and end time.

Definition at line 344 of file tracktion_Clip.cpp.

◆ getLaunchHandle()

virtual std::shared_ptr< LaunchHandle > tracktion::engine::Clip::getLaunchHandle ( )
virtual

Some clip types can be launched, if that's possible, this returns a handle to trigger starting/stopping the clip.

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

Definition at line 148 of file tracktion_Clip.h.

◆ getLaunchQuantisation()

virtual LaunchQuantisation * tracktion::engine::Clip::getLaunchQuantisation ( )
virtual

Some clip types can be launched, if that's possible, this returns a quantisation that can be used for this clip.

N.B. This will always be the clip's LaunchQuantisation, to find out if you should use the Edit's LaunchQuantisation, check usesGlobalLaunchQuatisation first

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

Definition at line 167 of file tracktion_Clip.h.

◆ getLinkGroupID()

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

Returns the link ID of this clip.

Definition at line 328 of file tracktion_Clip.h.

◆ getListeners()

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

Returns the listener list so Nodes can manually call them.

Definition at line 431 of file tracktion_Clip.h.

◆ getLoopLength()

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

Returns the length of loop in seconds.

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

Definition at line 229 of file tracktion_Clip.h.

◆ getLoopLengthBeats()

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

Returns the length of loop in beats.

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

Definition at line 227 of file tracktion_Clip.h.

◆ getLoopRange()

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

Returns the loop range in seconds.

Definition at line 232 of file tracktion_Clip.h.

◆ getLoopRangeBeats()

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

Returns the loop range in beats.

Definition at line 234 of file tracktion_Clip.h.

◆ getLoopStart()

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

Returns the start time of the loop start point.

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

Definition at line 225 of file tracktion_Clip.h.

◆ getLoopStartBeats()

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

Returns the beat position of the loop start point.

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

Definition at line 223 of file tracktion_Clip.h.

◆ getMaximumLength()

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

Returns the maximum length this clip can have.

Reimplemented in tracktion::engine::AudioClipBase.

Definition at line 200 of file tracktion_Clip.h.

◆ getName()

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

Returns the name of the clip.

Implements tracktion::engine::EditItem.

Definition at line 115 of file tracktion_Clip.h.

◆ 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::MidiClip, and tracktion::engine::WaveAudioClip.

Definition at line 381 of file tracktion_Clip.h.

◆ getParent()

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

Returns the parent ClipOwner this clip is on.

Definition at line 246 of file tracktion_Clip.cpp.

◆ 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::AudioClipBase, tracktion::engine::ChordClip, and tracktion::engine::MidiClip.

Definition at line 409 of file tracktion_Clip.h.

◆ getPluginList()

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

Returns the PluginList for this clip if it has one.

Reimplemented in tracktion::engine::AudioClipBase.

Definition at line 361 of file tracktion_Clip.h.

◆ getPosition()

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

Returns the ClipPosition on the parent Track.

Implements tracktion::engine::TrackItem.

Reimplemented in tracktion::engine::StepClip.

Definition at line 608 of file tracktion_Clip.cpp.

◆ getReferencedItems()

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

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

audio files.

Implements tracktion::engine::Exportable.

Definition at line 598 of file tracktion_Clip.cpp.

◆ getRescaledMarkPoints()

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.

Definition at line 359 of file tracktion_Clip.cpp.

◆ getSourceFileReference()

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

Returns the SourceFileReference of the Clip.

Definition at line 130 of file tracktion_Clip.h.

◆ getSpeedRatio()

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

Returns the speed ratio i.e.

how quickly the clip plays back.

Definition at line 299 of file tracktion_Clip.h.

◆ 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.

Definition at line 371 of file tracktion_Clip.cpp.

◆ getSyncType()

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

Returns the sync type clip is using.

Definition at line 256 of file tracktion_Clip.h.

◆ getTakeDescriptions()

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

Returns the descriptions of any takes.

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

Definition at line 373 of file tracktion_Clip.h.

◆ getTimeOfContentBeat()

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

Returns time of a beat number.

Definition at line 619 of file tracktion_Clip.cpp.

◆ getTrack()

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

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

Implements tracktion::engine::TrackItem.

Definition at line 256 of file tracktion_Clip.cpp.

◆ getUndoManager()

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

Returns the UndoManager.

See also
Edit::getUndoManager.

Definition at line 84 of file tracktion_Clip.cpp.

◆ hasAnyTakes()

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

Returns true if this clip has any takes.

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

Definition at line 371 of file tracktion_Clip.h.

◆ initialise()

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

◆ isClipState() [1/2]

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

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

Definition at line 95 of file tracktion_Clip.cpp.

◆ isClipState() [2/2]

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

Checks whether a ValueTree is some kind of clip state.

Definition at line 90 of file tracktion_Clip.cpp.

◆ isCurrentTakeComp()

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

Returns true if the current take is a comp.

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

Definition at line 383 of file tracktion_Clip.h.

◆ isGrouped()

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

Returns true if the clip is part of a group.

Reimplemented from tracktion::engine::TrackItem.

Definition at line 312 of file tracktion_Clip.h.

◆ isLinked()

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

Returns true if this clip is linked with any others.

Definition at line 324 of file tracktion_Clip.h.

◆ isLooping()

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

Returns true if this clip is currently looping.

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

Definition at line 214 of file tracktion_Clip.h.

◆ isMidi()

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

◆ isMuted()

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

◆ isShowingTakes()

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

Returns true if the clip is showing takes.

Definition at line 388 of file tracktion_Clip.h.

◆ moveTo()

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

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

Returns
true if the clip could be moved.

Definition at line 403 of file tracktion_Clip.cpp.

◆ 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::AudioClipBase, tracktion::engine::ChordClip, tracktion::engine::ContainerClip, and tracktion::engine::MidiClip.

Definition at line 111 of file tracktion_Clip.h.

◆ reassignReferencedItem()

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

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

Implements tracktion::engine::Exportable.

Definition at line 603 of file tracktion_Clip.cpp.

◆ removeFromParent()

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

Removes this clip from the parent track or container clip.

Definition at line 397 of file tracktion_Clip.cpp.

◆ removeListener()

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

Removes a Listener.

Definition at line 650 of file tracktion_Clip.cpp.

◆ removePlugin()

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

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

Definition at line 348 of file tracktion_Clip.h.

◆ rescale()

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.

Definition at line 438 of file tracktion_Clip.cpp.

◆ 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.

Definition at line 358 of file tracktion_Clip.h.

◆ setColour()

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

Sets the colour property of this clip.

Definition at line 344 of file tracktion_Clip.h.

◆ setCurrentSourceFile()

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

Sets a new source file for this clip.

Definition at line 473 of file tracktion_Clip.cpp.

◆ setCurrentTake()

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

Sets a given take index to be the current take.

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

Definition at line 375 of file tracktion_Clip.h.

◆ 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.

Definition at line 325 of file tracktion_Clip.cpp.

◆ setGroup()

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

Sets the clip to be part of a group.

Definition at line 629 of file tracktion_Clip.cpp.

◆ 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.

Definition at line 320 of file tracktion_Clip.cpp.

◆ setLinkGroupID()

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

Sets the link ID to link this clip with others.

Definition at line 326 of file tracktion_Clip.h.

◆ setLoopRange()

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

Sets the loop range the clip should use in seconds.

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

Definition at line 237 of file tracktion_Clip.h.

◆ setLoopRangeBeats()

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

Sets the loop range the clip should use in beats.

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

Definition at line 239 of file tracktion_Clip.h.

◆ setMuted()

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

Mutes or unmutes the clip.

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

Definition at line 244 of file tracktion_Clip.h.

◆ setName()

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

Sets a new name for a clip.

Definition at line 195 of file tracktion_Clip.cpp.

◆ setNumberOfLoops()

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

Sets the clip looping a number of times.

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

Definition at line 218 of file tracktion_Clip.h.

◆ 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

Definition at line 337 of file tracktion_Clip.cpp.

◆ setParent()

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

Definition at line 230 of file tracktion_Clip.cpp.

◆ setPosition()

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

Sets the position of the clip.

Definition at line 291 of file tracktion_Clip.cpp.

◆ setShowingTakes()

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

Sets whether the clip should be showing takes.

Definition at line 386 of file tracktion_Clip.h.

◆ setSpeedRatio()

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

Sets a speed ratio i.e.

how quickly the clip plays back.

Reimplemented in tracktion::engine::AudioClipBase.

Definition at line 430 of file tracktion_Clip.cpp.

◆ 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.

Definition at line 304 of file tracktion_Clip.cpp.

◆ setSyncType()

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

Sets the sync type for the clip.

Definition at line 254 of file tracktion_Clip.h.

◆ setUsesGlobalLaunchQuatisation()

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

Some clip types can be launched, if that's possible, this sets whether the clip's quantisation or the global quantisation should be used.

See also
getLaunchQuantisation, Edit::getLaunchQuantisation

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

Definition at line 154 of file tracktion_Clip.h.

◆ sourceMediaChanged()

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::EditClip, and tracktion::engine::WaveAudioClip.

Definition at line 285 of file tracktion_Clip.cpp.

◆ trimAwayOverlap()

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

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

Definition at line 384 of file tracktion_Clip.cpp.

◆ 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::MidiClip, and tracktion::engine::WaveAudioClip.

Definition at line 394 of file tracktion_Clip.h.

◆ updateLinkedClips()

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

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

See also
setLinkGroupID

Definition at line 581 of file tracktion_Clip.cpp.

◆ usesGlobalLaunchQuatisation()

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

Some clip types can be launched, if that's possible, this returns whether the clip's quantisation or the global quantisation should be used.

See also
getLaunchQuantisation, Edit::getLaunchQuantisation

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

Definition at line 160 of file tracktion_Clip.h.

◆ 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::EditClip, and tracktion::engine::WaveAudioClip.

Definition at line 127 of file tracktion_Clip.h.

◆ valueTreeParentChanged()

void tracktion::engine::Clip::valueTreeParentChanged ( juce::ValueTree v)
overrideprotectedvirtual

Reimplemented from juce::ValueTree::Listener.

Definition at line 549 of file tracktion_Clip.cpp.

◆ valueTreePropertyChanged()

void tracktion::engine::Clip::valueTreePropertyChanged ( juce::ValueTree tree,
const juce::Identifier id 
)
overrideprotectedvirtual

Reimplemented from juce::ValueTree::Listener.

Definition at line 483 of file tracktion_Clip.cpp.

Friends And Related Symbol Documentation

◆ ClipTrack

friend class ClipTrack
friend

Definition at line 454 of file tracktion_Clip.h.

◆ CollectionClip

friend class CollectionClip
friend

Definition at line 455 of file tracktion_Clip.h.

◆ Track

friend class Track
friend

Definition at line 453 of file tracktion_Clip.h.

Member Data Documentation

◆ clipName

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

Definition at line 459 of file tracktion_Clip.h.

◆ clipStart

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

Definition at line 461 of file tracktion_Clip.h.

◆ cloneInProgress

bool tracktion::engine::Clip::cloneInProgress
protected

Definition at line 458 of file tracktion_Clip.h.

◆ colour

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

The colour property.

Definition at line 441 of file tracktion_Clip.h.

◆ currentSourceFile

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

Definition at line 467 of file tracktion_Clip.h.

◆ disabled

juce::CachedValue<bool> tracktion::engine::Clip::disabled

Whether the Clip is disabled or not.

Changed to disabled clips won't rebuild the audio graph and they won't get added to playback graph.

Definition at line 442 of file tracktion_Clip.h.

◆ followActionBeats

juce::CachedValue<BeatDuration> tracktion::engine::Clip::followActionBeats

Determines the time for which a launched clip will play before a follow action is taken.

Definition at line 185 of file tracktion_Clip.h.

◆ followActionDurationType

juce::CachedValue<FollowActionDurationType> tracktion::engine::Clip::followActionDurationType

The type of duration to use for when to trigger the follow action.

Definition at line 182 of file tracktion_Clip.h.

◆ followActionNumLoops

juce::CachedValue<double> tracktion::engine::Clip::followActionNumLoops

Determines the number of loops for which a launched clip will play before a follow action is taken.

Definition at line 188 of file tracktion_Clip.h.

◆ groupID

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

Definition at line 465 of file tracktion_Clip.h.

◆ isInitialised

bool tracktion::engine::Clip::isInitialised
protected

Definition at line 457 of file tracktion_Clip.h.

◆ length

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

Definition at line 462 of file tracktion_Clip.h.

◆ linkID

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

Definition at line 466 of file tracktion_Clip.h.

◆ listeners

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

Definition at line 473 of file tracktion_Clip.h.

◆ offset

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

Definition at line 462 of file tracktion_Clip.h.

◆ parent

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

Definition at line 460 of file tracktion_Clip.h.

◆ patternGenerator

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

Definition at line 470 of file tracktion_Clip.h.

◆ showingTakes

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

Definition at line 469 of file tracktion_Clip.h.

◆ sourceFileReference

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

Definition at line 464 of file tracktion_Clip.h.

◆ speedRatio

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

Definition at line 463 of file tracktion_Clip.h.

◆ state

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

The ValueTree of the Clip state.

Definition at line 440 of file tracktion_Clip.h.

◆ syncType

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

Definition at line 468 of file tracktion_Clip.h.

◆ updateLinkedClipsCaller

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

Definition at line 471 of file tracktion_Clip.h.


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