TracktionEngine
Public Member Functions | Public Attributes | List of all members
tracktion::engine::ClipPosition Struct Reference

Represents the position of a clip on a timeline. More...

Public Member Functions

TimePosition getStart () const
 Returns the start time. More...
 
TimePosition getEnd () const
 Returns the end time. More...
 
TimeDuration getLength () const
 Returns the length. More...
 
TimeDuration getOffset () const
 Returns the offset. More...
 
TimePosition getStartOfSource () const
 Returns what would be the the start of the source material in the timeline. More...
 
bool operator== (const ClipPosition &other) const
 Compares two ClipPositions. More...
 
bool operator!= (const ClipPosition &other) const
 Compares two ClipPositions. More...
 
ClipPosition rescaled (TimePosition anchorTime, double factor) const
 Returns a ClipPosition scaled around an anchor point. More...
 

Public Attributes

TimeRange time
 The TimeRange this ClipPosition occupies. More...
 
TimeDuration offset = {}
 The offset this ClipPosition has. More...
 

Detailed Description

Represents the position of a clip on a timeline.

Member Function Documentation

◆ getStart()

TimePosition tracktion::engine::ClipPosition::getStart ( ) const

Returns the start time.

References time.

◆ getEnd()

TimePosition tracktion::engine::ClipPosition::getEnd ( ) const

Returns the end time.

References time.

◆ getLength()

TimeDuration tracktion::engine::ClipPosition::getLength ( ) const

Returns the length.

References time.

◆ getOffset()

TimeDuration tracktion::engine::ClipPosition::getOffset ( ) const

Returns the offset.

References offset.

◆ getStartOfSource()

TimePosition tracktion::engine::ClipPosition::getStartOfSource ( ) const

Returns what would be the the start of the source material in the timeline.

References offset, and time.

◆ operator==()

bool tracktion::engine::ClipPosition::operator== ( const ClipPosition other) const

Compares two ClipPositions.

References offset, and time.

Referenced by operator!=().

◆ operator!=()

bool tracktion::engine::ClipPosition::operator!= ( const ClipPosition other) const

Compares two ClipPositions.

References operator==().

◆ rescaled()

ClipPosition tracktion::engine::ClipPosition::rescaled ( TimePosition  anchorTime,
double  factor 
) const

Returns a ClipPosition scaled around an anchor point.

Useful for stretching a clip.

References offset, and time.

Member Data Documentation

◆ time

TimeRange tracktion::engine::ClipPosition::time

◆ offset

TimeDuration tracktion::engine::ClipPosition::offset = {}

The offset this ClipPosition has.

Offset is a bit unintuitive as the position this relates to in the source material will depend on lots of factors including looping and any time-stretching. It can generally be thought of as an offset from either the start of the file or the loop start position, scaled by any time-stretching.

Referenced by getOffset(), getStartOfSource(), operator==(), and rescaled().


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