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 | Protected Member Functions | Protected Attributes | List of all members
tracktion::engine::CompManager Class Referenceabstract
Inheritance diagram for tracktion::engine::CompManager:
juce::SingleThreadedReferenceCountedObject juce::ValueTree::Listener tracktion::engine::MidiCompManager tracktion::engine::WaveCompManager

Classes

struct  RenderTrigger
 

Public Types

using Ptr = juce::ReferenceCountedObjectPtr< CompManager >
 

Public Member Functions

 CompManager (Clip &, const juce::ValueTree &)
 Creates a CompManager for a given clip.
 
 ~CompManager () override
 Destructor.
 
virtual void initialise ()
 
virtual HashCode getBaseTakeHash (int takeIndex) const =0
 
virtual double getTakeLength (int takeIndex) const =0
 
virtual double getOffset () const =0
 
virtual double getLoopLength () const =0
 
virtual bool getAutoTempo ()=0
 
virtual double getSourceTempo ()=0
 
virtual juce::String getWarning ()
 
virtual float getRenderProgress () const
 
virtual void discardCachedData ()
 
virtual void triggerCompRender ()=0
 Triggers the render of the comp.
 
virtual void flattenTake (int takeIndex, bool deleteSourceFiles)=0
 Should flatten the comp and remove all other takes.
 
virtual juce::ValueTree pasteComp (const juce::ValueTree &)
 Pastes an existing comp to this manager and returns the newly added tree.
 
ClipgetClip () const noexcept
 
virtual void setStripToUpdate (juce::Component *)
 Sets a component to be updated during render processes.
 
bool shouldDisplayWarning () const noexcept
 Returns true if the source should display a warning about using multi-tempo changes.
 
juce::ValueTree getSection (int takeIndex, int sectionIndex) const
 Returns the section at the given index of a given take.
 
juce::ValueTree findSectionAtTime (double time)
 Returns either the section for the current comp at a given time or if a whole take is being used the take.
 
int findSectionWithEndTime (juce::Range< double > range, int takeIndex, bool &timeFoundAtStartOfSection) const
 Returns the index of the section whose end lies within the given time range.
 
juce::Range< doublegetSectionTimes (const juce::ValueTree &) const
 Returns the time range a given section occupies for a given take.
 
juce::ValueTree getTakesTree ()
 
void setActiveTakeIndex (int index)
 Sets the active take index.
 
int getActiveTakeIndex () const
 Returns the active take index.
 
juce::ValueTree getActiveTakeTree () const
 Returns the active take tree.
 
int getNumTakes () const
 Returns the number of takes that are not comps.
 
int getNumComps () const
 Returns the number of comps that are comps.
 
int getTotalNumTakes () const
 Returns the total number of takes including comp takes.
 
bool isTakeComp (int takeIndex) const
 Returns true if the given take at an index is a comp.
 
bool isTakeComp (const juce::ValueTree &takeTree) const
 Returns true if the given take is a comp.
 
bool isCurrentTakeComp () const
 Returns true if the current take is a comp.
 
juce::String getTakeName (int index) const
 Returns the name of a take.
 
virtual juce::ValueTree addNewComp ()=0
 Adds a new comp to the end of the takes list optionally making it active.
 
double getMaxCompLength () const
 Returns the maximum length that a comp can be.
 
juce::Range< doublegetCompRange () const
 Returns the time range available for comping i.e.
 
double getSpeedRatio () const
 Returns the effective speed ratio used for displaying waveforms.
 
double getSourceTimeMultiplier () const
 Returns the current time multiplier in use by the source, either the speed ratio or auto tempo ratio.
 
HashCode getTakeHash (int takeIndex) const
 Returns a hash code representing a take.
 
void changeSectionIndexAtTime (double time, int takeIndex)
 Changes the index of the active comp's section at a given time.
 
void removeSectionIndexAtTime (double time, int takeIndex)
 Removes a section from the comp at the given time if the section is at the given take index.
 
void moveSectionEndTime (juce::ValueTree &section, double newTime)
 Moves a section's end time to the new time specified.
 
void moveSection (juce::ValueTree &section, double timeDelta)
 Moves a section by the specified time delta also moving the previous section's end time by the same ammount.
 
void moveSectionToEndAt (juce::ValueTree &section, double newEndTime)
 Moves a section to an absolute end time also moving the previous section's end time by the same ammount.
 
juce::ValueTree addSection (int takeIndex, double endTime)
 Adds a new section at a given time and returns the index of it.
 
void removeSection (const juce::ValueTree &sectionToRemove)
 Removes a section from the active comp if it is within range.
 
juce::ValueTree splitSectionAtTime (double time)
 Find the current section at the given time and splits it in two ready for a new comp section.
 
void removeSectionsWithinRange (juce::Range< double > timeRange, const juce::ValueTree &sectionToKeep)
 Removes all sections which lie within the given time range.
 
- Public Member Functions inherited from juce::SingleThreadedReferenceCountedObject
void incReferenceCount () noexcept
 
void decReferenceCount () noexcept
 
bool decReferenceCountWithoutDeleting () noexcept
 
int getReferenceCount () const noexcept
 

Protected Member Functions

juce::UndoManagergetUndoManager () const
 
void keepSectionsSortedAndInRange ()
 
juce::ValueTree getNewCompTree () const
 
- Protected Member Functions inherited from juce::SingleThreadedReferenceCountedObject
 SingleThreadedReferenceCountedObject (const SingleThreadedReferenceCountedObject &)
 
 SingleThreadedReferenceCountedObject (SingleThreadedReferenceCountedObject &&)
 
SingleThreadedReferenceCountedObjectoperator= (const SingleThreadedReferenceCountedObject &)
 
SingleThreadedReferenceCountedObjectoperator= (SingleThreadedReferenceCountedObject &&)
 

Protected Attributes

juce::ValueTree takesTree
 
int lastRenderedTake
 
HashCode lastHash
 
double maxCompLength
 
double effectiveTimeMultiplier
 
double lastOffset
 
double lastTimeRatio
 

Detailed Description

Definition at line 17 of file tracktion_CompManager.h.

Member Typedef Documentation

◆ Ptr

Definition at line 27 of file tracktion_CompManager.h.

Constructor & Destructor Documentation

◆ CompManager()

tracktion::engine::CompManager::CompManager ( Clip c,
const juce::ValueTree v 
)

Creates a CompManager for a given clip.

Definition at line 43 of file tracktion_CompManager.cpp.

◆ ~CompManager()

tracktion::engine::CompManager::~CompManager ( )
override

Destructor.

Definition at line 54 of file tracktion_CompManager.cpp.

Member Function Documentation

◆ addNewComp()

virtual juce::ValueTree tracktion::engine::CompManager::addNewComp ( )
pure virtual

Adds a new comp to the end of the takes list optionally making it active.

This is essentially a new take with a new ProjectItemID and a single blank section.

Implemented in tracktion::engine::WaveCompManager, and tracktion::engine::MidiCompManager.

◆ addSection()

juce::ValueTree tracktion::engine::CompManager::addSection ( int  takeIndex,
double  endTime 
)

Adds a new section at a given time and returns the index of it.

Definition at line 326 of file tracktion_CompManager.cpp.

◆ changeSectionIndexAtTime()

void tracktion::engine::CompManager::changeSectionIndexAtTime ( double  time,
int  takeIndex 
)

Changes the index of the active comp's section at a given time.

If the active comp is just a normal take this will change the active take.

Definition at line 218 of file tracktion_CompManager.cpp.

◆ discardCachedData()

virtual void tracktion::engine::CompManager::discardCachedData ( )
virtual

Definition at line 40 of file tracktion_CompManager.h.

◆ findSectionAtTime()

juce::ValueTree tracktion::engine::CompManager::findSectionAtTime ( double  time)

Returns either the section for the current comp at a given time or if a whole take is being used the take.

Check the type to find out which this is.

Definition at line 83 of file tracktion_CompManager.cpp.

◆ findSectionWithEndTime()

int tracktion::engine::CompManager::findSectionWithEndTime ( juce::Range< double range,
int  takeIndex,
bool &  timeFoundAtStartOfSection 
) const

Returns the index of the section whose end lies within the given time range.

This is useful when finding out what edges to drag etc. If no section is found then -1 is returned.

Definition at line 104 of file tracktion_CompManager.cpp.

◆ flattenTake()

virtual void tracktion::engine::CompManager::flattenTake ( int  takeIndex,
bool  deleteSourceFiles 
)
pure virtual

Should flatten the comp and remove all other takes.

Implemented in tracktion::engine::WaveCompManager, and tracktion::engine::MidiCompManager.

◆ getActiveTakeIndex()

int tracktion::engine::CompManager::getActiveTakeIndex ( ) const

Returns the active take index.

Definition at line 87 of file tracktion_CompManager.h.

◆ getActiveTakeTree()

juce::ValueTree tracktion::engine::CompManager::getActiveTakeTree ( ) const

Returns the active take tree.

Definition at line 90 of file tracktion_CompManager.h.

◆ getClip()

Clip & tracktion::engine::CompManager::getClip ( ) const
noexcept

Definition at line 52 of file tracktion_CompManager.h.

◆ getCompRange()

juce::Range< double > tracktion::engine::CompManager::getCompRange ( ) const

Returns the time range available for comping i.e.

taking into account any offset or looped regions.

Definition at line 176 of file tracktion_CompManager.cpp.

◆ getMaxCompLength()

double tracktion::engine::CompManager::getMaxCompLength ( ) const

Returns the maximum length that a comp can be.

This is effectively the length of the longest take.

Definition at line 120 of file tracktion_CompManager.h.

◆ getNewCompTree()

juce::ValueTree tracktion::engine::CompManager::getNewCompTree ( ) const
protected

Definition at line 472 of file tracktion_CompManager.cpp.

◆ getNumComps()

int tracktion::engine::CompManager::getNumComps ( ) const

Returns the number of comps that are comps.

Definition at line 96 of file tracktion_CompManager.h.

◆ getNumTakes()

int tracktion::engine::CompManager::getNumTakes ( ) const

Returns the number of takes that are not comps.

Definition at line 160 of file tracktion_CompManager.cpp.

◆ getRenderProgress()

virtual float tracktion::engine::CompManager::getRenderProgress ( ) const
virtual

Definition at line 39 of file tracktion_CompManager.h.

◆ getSection()

juce::ValueTree tracktion::engine::CompManager::getSection ( int  takeIndex,
int  sectionIndex 
) const

Returns the section at the given index of a given take.

Definition at line 78 of file tracktion_CompManager.cpp.

◆ getSectionTimes()

juce::Range< double > tracktion::engine::CompManager::getSectionTimes ( const juce::ValueTree section) const

Returns the time range a given section occupies for a given take.

If there is no segment at the indexes this will return an empty range.

Definition at line 137 of file tracktion_CompManager.cpp.

◆ getSourceTimeMultiplier()

double tracktion::engine::CompManager::getSourceTimeMultiplier ( ) const

Returns the current time multiplier in use by the source, either the speed ratio or auto tempo ratio.

Definition at line 131 of file tracktion_CompManager.h.

◆ getSpeedRatio()

double tracktion::engine::CompManager::getSpeedRatio ( ) const

Returns the effective speed ratio used for displaying waveforms.

If the source is using auto-tempo with tempo changes this will use an averaged version of this.

Definition at line 183 of file tracktion_CompManager.cpp.

◆ getTakeHash()

HashCode tracktion::engine::CompManager::getTakeHash ( int  takeIndex) const

Returns a hash code representing a take.

This can be used to check if a comp has changed since it was last generated.

Definition at line 191 of file tracktion_CompManager.cpp.

◆ getTakeName()

juce::String tracktion::engine::CompManager::getTakeName ( int  index) const

Returns the name of a take.

Definition at line 170 of file tracktion_CompManager.cpp.

◆ getTakesTree()

juce::ValueTree tracktion::engine::CompManager::getTakesTree ( )

Definition at line 81 of file tracktion_CompManager.h.

◆ getTotalNumTakes()

int tracktion::engine::CompManager::getTotalNumTakes ( ) const

Returns the total number of takes including comp takes.

Definition at line 99 of file tracktion_CompManager.h.

◆ getUndoManager()

juce::UndoManager * tracktion::engine::CompManager::getUndoManager ( ) const
protected

Definition at line 415 of file tracktion_CompManager.cpp.

◆ getWarning()

virtual juce::String tracktion::engine::CompManager::getWarning ( )
virtual

Definition at line 38 of file tracktion_CompManager.h.

◆ initialise()

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

Definition at line 61 of file tracktion_CompManager.cpp.

◆ isCurrentTakeComp()

bool tracktion::engine::CompManager::isCurrentTakeComp ( ) const

Returns true if the current take is a comp.

Definition at line 108 of file tracktion_CompManager.h.

◆ isTakeComp() [1/2]

bool tracktion::engine::CompManager::isTakeComp ( const juce::ValueTree takeTree) const

Returns true if the given take is a comp.

Definition at line 105 of file tracktion_CompManager.h.

◆ isTakeComp() [2/2]

bool tracktion::engine::CompManager::isTakeComp ( int  takeIndex) const

Returns true if the given take at an index is a comp.

Definition at line 102 of file tracktion_CompManager.h.

◆ keepSectionsSortedAndInRange()

void tracktion::engine::CompManager::keepSectionsSortedAndInRange ( )
protected

Definition at line 420 of file tracktion_CompManager.cpp.

◆ moveSection()

void tracktion::engine::CompManager::moveSection ( juce::ValueTree section,
double  timeDelta 
)

Moves a section by the specified time delta also moving the previous section's end time by the same ammount.

If this covers up another section the covered section will be removed. If this drags a section at either end either a new blank section will be created or the drag will be limited by the take's bounds. If any sections are removed due to an overlap this will return the new section index that this represents.

Definition at line 294 of file tracktion_CompManager.cpp.

◆ moveSectionEndTime()

void tracktion::engine::CompManager::moveSectionEndTime ( juce::ValueTree section,
double  newTime 
)

Moves a section's end time to the new time specified.

If this crosses the boundry of another section the two sections will be merged.

Returns
the index of the section that was being dragged

Definition at line 280 of file tracktion_CompManager.cpp.

◆ moveSectionToEndAt()

void tracktion::engine::CompManager::moveSectionToEndAt ( juce::ValueTree section,
double  newEndTime 
)

Moves a section to an absolute end time also moving the previous section's end time by the same ammount.

If this covers up another section the covered section will be removed. If this drags a section at either end either a new blank section will be created or the drag will be limited by the take's bounds. If any sections are removed due to an overlap this will return the new section index that this represents.

Definition at line 300 of file tracktion_CompManager.cpp.

◆ pasteComp()

virtual juce::ValueTree tracktion::engine::CompManager::pasteComp ( const juce::ValueTree )
virtual

Pastes an existing comp to this manager and returns the newly added tree.

Reimplemented in tracktion::engine::WaveCompManager.

Definition at line 49 of file tracktion_CompManager.h.

◆ removeSection()

void tracktion::engine::CompManager::removeSection ( const juce::ValueTree sectionToRemove)

Removes a section from the active comp if it is within range.

Definition at line 359 of file tracktion_CompManager.cpp.

◆ removeSectionIndexAtTime()

void tracktion::engine::CompManager::removeSectionIndexAtTime ( double  time,
int  takeIndex 
)

Removes a section from the comp at the given time if the section is at the given take index.

Definition at line 233 of file tracktion_CompManager.cpp.

◆ removeSectionsWithinRange()

void tracktion::engine::CompManager::removeSectionsWithinRange ( juce::Range< double timeRange,
const juce::ValueTree sectionToKeep 
)

Removes all sections which lie within the given time range.

Useful when performing drag operations.

Returns
the number of sections removed removed.

Definition at line 365 of file tracktion_CompManager.cpp.

◆ setActiveTakeIndex()

void tracktion::engine::CompManager::setActiveTakeIndex ( int  index)

Sets the active take index.

This will also update the source.

Definition at line 146 of file tracktion_CompManager.cpp.

◆ setStripToUpdate()

virtual void tracktion::engine::CompManager::setStripToUpdate ( juce::Component )
virtual

Sets a component to be updated during render processes.

Reimplemented in tracktion::engine::WaveCompManager.

Definition at line 55 of file tracktion_CompManager.h.

◆ shouldDisplayWarning()

bool tracktion::engine::CompManager::shouldDisplayWarning ( ) const
noexcept

Returns true if the source should display a warning about using multi-tempo changes.

Definition at line 58 of file tracktion_CompManager.h.

◆ splitSectionAtTime()

juce::ValueTree tracktion::engine::CompManager::splitSectionAtTime ( double  time)

Find the current section at the given time and splits it in two ready for a new comp section.

Definition at line 397 of file tracktion_CompManager.cpp.

◆ triggerCompRender()

virtual void tracktion::engine::CompManager::triggerCompRender ( )
pure virtual

Triggers the render of the comp.

Call this when you change the comp in some way.

Implemented in tracktion::engine::WaveCompManager, and tracktion::engine::MidiCompManager.

Member Data Documentation

◆ effectiveTimeMultiplier

double tracktion::engine::CompManager::effectiveTimeMultiplier
protected

Definition at line 187 of file tracktion_CompManager.h.

◆ lastHash

HashCode tracktion::engine::CompManager::lastHash
protected

Definition at line 186 of file tracktion_CompManager.h.

◆ lastOffset

double tracktion::engine::CompManager::lastOffset
protected

Definition at line 188 of file tracktion_CompManager.h.

◆ lastRenderedTake

int tracktion::engine::CompManager::lastRenderedTake
protected

Definition at line 185 of file tracktion_CompManager.h.

◆ lastTimeRatio

double tracktion::engine::CompManager::lastTimeRatio
protected

Definition at line 188 of file tracktion_CompManager.h.

◆ maxCompLength

double tracktion::engine::CompManager::maxCompLength
protected

Definition at line 187 of file tracktion_CompManager.h.

◆ takesTree

juce::ValueTree tracktion::engine::CompManager::takesTree
protected

Definition at line 184 of file tracktion_CompManager.h.


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