TracktionEngine
Public Types | Public Member Functions | Public Attributes | List of all members
tracktion::engine::WarpTimeManager Class Reference

A WarpTimeManager contains a list of WarpMarkers and some source material and maps times from a linear "view" time to a "wapred" source time. More...

Inheritance diagram for tracktion::engine::WarpTimeManager:

Public Types

using Ptr = juce::ReferenceCountedObjectPtr< WarpTimeManager >
 

Public Member Functions

 WarpTimeManager (AudioClipBase &)
 Creates a WarpTimeManager to warp a clip. More...
 
 WarpTimeManager (Edit &, const AudioFile &sourceFile, juce::ValueTree parentTree)
 Creates a WarpTimeManager to warp an audio file. More...
 
 ~WarpTimeManager () override
 Destructor. More...
 
void setSourceFile (const AudioFile &)
 Sets a source fiel to warp. More...
 
AudioFile getSourceFile () const
 Returns the current source file. More...
 
TimeDuration getSourceLength () const
 Returns the length of the source file. More...
 
bool isWarpEndMarkerEnabled () const noexcept
 Returns true if the end marker is being used as the end of the source material. More...
 
bool areEndMarkersLimited () const noexcept
 Returns true if the markers are limited to the end of the source length. More...
 
const juce::Array< WarpMarker * > & getMarkers () const
 Returns a list of the current WarpMarkers. More...
 
int insertMarker (WarpMarker)
 Inserts a new WarpMarker. More...
 
void removeMarker (int index)
 Removes a WarpMarker at a given index. More...
 
void removeAllMarkers ()
 Removes all WarpMarkers. More...
 
TimePosition moveMarker (int index, TimePosition newWarpTime)
 Moves a WarpMarker at a given index to a new time. More...
 
void setWarpEndMarkerTime (TimePosition endTime)
 Sets the end time of the source material. More...
 
juce::Array< TimeRange > getWarpTimeRegions (TimeRange overallTimeRegion) const
 Time region can be longer than the clip and the returned array will loop over the clip to match the length. More...
 
std::pair< bool, juce::Array< TimePosition > > getTransientTimes () const
 Returns an array of transient times that have been detected from the source file. More...
 
TimePosition warpTimeToSourceTime (TimePosition warpTime) const
 Converts a warp time (i.e. More...
 
TimePosition sourceTimeToWarpTime (TimePosition sourceTime) const
 Converts a source time (i.e. More...
 
TimePosition getWarpedStart () const
 Returns the start time of the warped region (can be -ve) More...
 
TimePosition getWarpedEnd () const
 Returns the endTime of the entire warped region. More...
 
TimePosition getWarpEndMarkerTime () const
 Sets position in warped region of the redered file end point. More...
 
HashCode getHash () const
 Returns a hash representing this warp list. More...
 
void editFinishedLoading ()
 
- Public Member Functions inherited from tracktion::engine::RenderManager::Job::Listener
virtual ~Listener ()
 
virtual void jobStarted (RenderManager::Job &)
 

Public Attributes

Editedit
 
juce::ValueTree state
 

Detailed Description

A WarpTimeManager contains a list of WarpMarkers and some source material and maps times from a linear "view" time to a "wapred" source time.

Once created this can be used to generate an AudioSegmentList to play the source material back warped.

Member Typedef Documentation

◆ Ptr

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

Constructor & Destructor Documentation

◆ WarpTimeManager() [1/2]

tracktion::engine::WarpTimeManager::WarpTimeManager ( AudioClipBase )

Creates a WarpTimeManager to warp a clip.

◆ WarpTimeManager() [2/2]

tracktion::engine::WarpTimeManager::WarpTimeManager ( Edit ,
const AudioFile sourceFile,
juce::ValueTree  parentTree 
)

Creates a WarpTimeManager to warp an audio file.

The WarpMarker state will get added to the parentTree as a child.

◆ ~WarpTimeManager()

tracktion::engine::WarpTimeManager::~WarpTimeManager ( )
override

Destructor.

Member Function Documentation

◆ setSourceFile()

void tracktion::engine::WarpTimeManager::setSourceFile ( const AudioFile )

Sets a source fiel to warp.

◆ getSourceFile()

AudioFile tracktion::engine::WarpTimeManager::getSourceFile ( ) const

Returns the current source file.

◆ getSourceLength()

TimeDuration tracktion::engine::WarpTimeManager::getSourceLength ( ) const

Returns the length of the source file.

◆ isWarpEndMarkerEnabled()

bool tracktion::engine::WarpTimeManager::isWarpEndMarkerEnabled ( ) const
noexcept

Returns true if the end marker is being used as the end of the source material.

See also
setWarpEndMarkerTime

◆ areEndMarkersLimited()

bool tracktion::engine::WarpTimeManager::areEndMarkersLimited ( ) const
noexcept

Returns true if the markers are limited to the end of the source length.

See also
getSourceLength

◆ getMarkers()

const juce::Array<WarpMarker*>& tracktion::engine::WarpTimeManager::getMarkers ( ) const

Returns a list of the current WarpMarkers.

◆ insertMarker()

int tracktion::engine::WarpTimeManager::insertMarker ( WarpMarker  )

Inserts a new WarpMarker.

◆ removeMarker()

void tracktion::engine::WarpTimeManager::removeMarker ( int  index)

Removes a WarpMarker at a given index.

◆ removeAllMarkers()

void tracktion::engine::WarpTimeManager::removeAllMarkers ( )

Removes all WarpMarkers.

◆ moveMarker()

TimePosition tracktion::engine::WarpTimeManager::moveMarker ( int  index,
TimePosition  newWarpTime 
)

Moves a WarpMarker at a given index to a new time.

◆ setWarpEndMarkerTime()

void tracktion::engine::WarpTimeManager::setWarpEndMarkerTime ( TimePosition  endTime)

Sets the end time of the source material.

Only functional if isWarpEndMarkerEnabled returns true.

◆ getWarpTimeRegions()

juce::Array<TimeRange> tracktion::engine::WarpTimeManager::getWarpTimeRegions ( TimeRange  overallTimeRegion) const

Time region can be longer than the clip and the returned array will loop over the clip to match the length.

◆ getTransientTimes()

std::pair<bool, juce::Array<TimePosition> > tracktion::engine::WarpTimeManager::getTransientTimes ( ) const

Returns an array of transient times that have been detected from the source file.

The bool here will be false if the detection job hasn't finished running yet so call it again peridically until it is true.

◆ warpTimeToSourceTime()

TimePosition tracktion::engine::WarpTimeManager::warpTimeToSourceTime ( TimePosition  warpTime) const

Converts a warp time (i.e.

a linear time) to the time in the source file after warping has been applied.

◆ sourceTimeToWarpTime()

TimePosition tracktion::engine::WarpTimeManager::sourceTimeToWarpTime ( TimePosition  sourceTime) const

Converts a source time (i.e.

time in the file) to a linear time after warping has been applied.

◆ getWarpedStart()

TimePosition tracktion::engine::WarpTimeManager::getWarpedStart ( ) const

Returns the start time of the warped region (can be -ve)

◆ getWarpedEnd()

TimePosition tracktion::engine::WarpTimeManager::getWarpedEnd ( ) const

Returns the endTime of the entire warped region.

◆ getWarpEndMarkerTime()

TimePosition tracktion::engine::WarpTimeManager::getWarpEndMarkerTime ( ) const

Sets position in warped region of the redered file end point.

◆ getHash()

HashCode tracktion::engine::WarpTimeManager::getHash ( ) const

Returns a hash representing this warp list.

◆ editFinishedLoading()

void tracktion::engine::WarpTimeManager::editFinishedLoading ( )

Member Data Documentation

◆ edit

Edit& tracktion::engine::WarpTimeManager::edit

◆ state

juce::ValueTree tracktion::engine::WarpTimeManager::state

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