TracktionEngine
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Attributes | List of all members
tracktion::engine::EditInsertPoint Class Reference

An EditInsertPoint is like a "paste location". More...

#include <tracktion_EditInsertPoint.h>

Classes

struct  Placement
 A struct representing a resolved insertion point. More...
 

Public Member Functions

 EditInsertPoint (Edit &)
 Creates an EditInsertPoint for a given Edit.
 
virtual ~EditInsertPoint ()=default
 Destructor.
 
bool setNextInsertPoint (ClipOwner *, std::optional< TimePosition >)
 Sets the next insertion point to a given ClipOwner and Time (if provided).
 
void setNextInsertPoint (TimePosition, const juce::ReferenceCountedObjectPtr< Track > &)
 Sets the next insertion point to a given time and track.
 
void setNextInsertPoint (TimePosition)
 Updates the time but not the track.
 
void setNextInsertPointAfterSelected ()
 Sets a flag to signify chooseInsertPoint should use the selected track as the insertion point.
 
void lockInsertPoint (bool lock) noexcept
 Locks the insert point so calls to setNextInsertPoint won't have any effect.
 
virtual void chooseInsertPoint (juce::ReferenceCountedObjectPtr< Track > &, TimePosition &start, bool pasteAfterSelection, SelectionManager *)
 Returns the track and time position content should be pasted at.
 
void chooseInsertPoint (juce::ReferenceCountedObjectPtr< Track > &, TimePosition &start, bool pasteAfterSelection, SelectionManager *, std::function< bool(Track &)> allowedTrackPredicate)
 This is the same as the other overload except you can supply a predicate to determine if tracks are allowed to be considered or not.
 
virtual Placement chooseInsertPoint (bool pasteAfterSelection, SelectionManager *, std::function< bool(Track &)> allowedTrackPredicate)
 Returns a Placement representing where content should be pasted at.
 

Protected Attributes

Editedit
 
TimePosition nextInsertPointTime
 
EditItemID nextInsertPointTrack
 
EditItemID nextInsertPointClipOwner
 
int lockInsertPointCount = 0
 
bool nextInsertIsAfterSelected = false
 

Detailed Description

An EditInsertPoint is like a "paste location".

It can be updated as user iteraction warrents e.g. by selecting tracks/plugins/clips etc. and calling setNextInsertPoint. Then when new content is added, it can use the insert point to find the track and time position where content should be placed

See also
chooseInsertPoint This is used by some other classes such as the Clipboard.

Constructor & Destructor Documentation

◆ EditInsertPoint()

tracktion::engine::EditInsertPoint::EditInsertPoint ( Edit )

Creates an EditInsertPoint for a given Edit.

◆ ~EditInsertPoint()

virtual tracktion::engine::EditInsertPoint::~EditInsertPoint ( )
virtualdefault

Destructor.

Member Function Documentation

◆ setNextInsertPoint() [1/3]

bool tracktion::engine::EditInsertPoint::setNextInsertPoint ( ClipOwner ,
std::optional< TimePosition >   
)

Sets the next insertion point to a given ClipOwner and Time (if provided).

N.B. This will only be updated of the ClipOwner provides a valid EditItemID.

Parameters
ClipOwnerThe ClipOwner to insert in to
std::optional<TimePosition>An optional time position to insert at
Returns
If the insert point has been changed, this will return true, false otherwise.

◆ setNextInsertPoint() [2/3]

void tracktion::engine::EditInsertPoint::setNextInsertPoint ( TimePosition  ,
const juce::ReferenceCountedObjectPtr< Track > &   
)

Sets the next insertion point to a given time and track.

◆ setNextInsertPoint() [3/3]

void tracktion::engine::EditInsertPoint::setNextInsertPoint ( TimePosition  )

Updates the time but not the track.

◆ setNextInsertPointAfterSelected()

void tracktion::engine::EditInsertPoint::setNextInsertPointAfterSelected ( )

Sets a flag to signify chooseInsertPoint should use the selected track as the insertion point.

◆ lockInsertPoint()

void tracktion::engine::EditInsertPoint::lockInsertPoint ( bool  lock)
noexcept

Locks the insert point so calls to setNextInsertPoint won't have any effect.

◆ chooseInsertPoint() [1/3]

virtual void tracktion::engine::EditInsertPoint::chooseInsertPoint ( juce::ReferenceCountedObjectPtr< Track > &  ,
TimePosition &  start,
bool  pasteAfterSelection,
SelectionManager  
)
virtual

Returns the track and time position content should be pasted at.

Returns
Track The track to insert in to
start The time at which to insert at
Parameters
pasteAfterSelectionWhether to ignore the previously set Track and use the SelectionManager to set the insert point
SelectionMangerThe SelectionManager to use

◆ chooseInsertPoint() [2/3]

void tracktion::engine::EditInsertPoint::chooseInsertPoint ( juce::ReferenceCountedObjectPtr< Track > &  ,
TimePosition &  start,
bool  pasteAfterSelection,
SelectionManager ,
std::function< bool(Track &)>  allowedTrackPredicate 
)

This is the same as the other overload except you can supply a predicate to determine if tracks are allowed to be considered or not.

Useful for when they are hidden etc.

Parameters
allowedTrackPredicateA predicate to determine if the track can be pasted in to

◆ chooseInsertPoint() [3/3]

virtual Placement tracktion::engine::EditInsertPoint::chooseInsertPoint ( bool  pasteAfterSelection,
SelectionManager ,
std::function< bool(Track &)>  allowedTrackPredicate 
)
virtual

Returns a Placement representing where content should be pasted at.

Parameters
pasteAfterSelectionWhether to ignore the previously set Track and use the SelectionManager to set the insert point
SelectionMangerThe SelectionManager to use
Returns
Placement Where to insert content

Member Data Documentation

◆ edit

Edit& tracktion::engine::EditInsertPoint::edit
protected

◆ nextInsertPointTime

TimePosition tracktion::engine::EditInsertPoint::nextInsertPointTime
protected

◆ nextInsertPointTrack

EditItemID tracktion::engine::EditInsertPoint::nextInsertPointTrack
protected

◆ nextInsertPointClipOwner

EditItemID tracktion::engine::EditInsertPoint::nextInsertPointClipOwner
protected

◆ lockInsertPointCount

int tracktion::engine::EditInsertPoint::lockInsertPointCount = 0
protected

◆ nextInsertIsAfterSelected

bool tracktion::engine::EditInsertPoint::nextInsertIsAfterSelected = false
protected

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