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

« « « Anklang Documentation
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
 
bool nextInsertIsAfterSelected
 

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.

Definition at line 21 of file tracktion_EditInsertPoint.h.


Class Documentation

◆ tracktion::engine::EditInsertPoint::Placement

struct tracktion::engine::EditInsertPoint::Placement

A struct representing a resolved insertion point.

Definition at line 69 of file tracktion_EditInsertPoint.h.

Class Members
ClipOwner * clipOwner The clip owner to insert to (might be the same as track).
optional< TimePosition > time The time to insert at.
ReferenceCountedObjectPtr< Track > track The track to insert in to.

Constructor & Destructor Documentation

◆ EditInsertPoint()

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

Creates an EditInsertPoint for a given Edit.

Definition at line 14 of file tracktion_EditInsertPoint.cpp.

Member Function Documentation

◆ chooseInsertPoint() [1/3]

EditInsertPoint::Placement tracktion::engine::EditInsertPoint::chooseInsertPoint ( bool  pasteAfterSelection,
SelectionManager sm,
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

Definition at line 127 of file tracktion_EditInsertPoint.cpp.

◆ chooseInsertPoint() [2/3]

void tracktion::engine::EditInsertPoint::chooseInsertPoint ( juce::ReferenceCountedObjectPtr< Track > &  track,
TimePosition start,
bool  pasteAfterSelection,
SelectionManager sm 
)
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

Definition at line 70 of file tracktion_EditInsertPoint.cpp.

◆ chooseInsertPoint() [3/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

◆ lockInsertPoint()

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

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

Definition at line 57 of file tracktion_EditInsertPoint.cpp.

◆ setNextInsertPoint() [1/2]

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

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.

Definition at line 19 of file tracktion_EditInsertPoint.cpp.

◆ setNextInsertPoint() [2/2]

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

Updates the time but not the track.

Definition at line 38 of file tracktion_EditInsertPoint.cpp.

◆ setNextInsertPointAfterSelected()

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

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

Definition at line 65 of file tracktion_EditInsertPoint.cpp.

Member Data Documentation

◆ edit

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

Definition at line 86 of file tracktion_EditInsertPoint.h.

◆ lockInsertPointCount

int tracktion::engine::EditInsertPoint::lockInsertPointCount
protected

Definition at line 89 of file tracktion_EditInsertPoint.h.

◆ nextInsertIsAfterSelected

bool tracktion::engine::EditInsertPoint::nextInsertIsAfterSelected
protected

Definition at line 90 of file tracktion_EditInsertPoint.h.

◆ nextInsertPointClipOwner

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

Definition at line 88 of file tracktion_EditInsertPoint.h.

◆ nextInsertPointTime

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

Definition at line 87 of file tracktion_EditInsertPoint.h.

◆ nextInsertPointTrack

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

Definition at line 88 of file tracktion_EditInsertPoint.h.


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