TracktionEngine
Public Types | Public Member Functions | Static Public Member Functions | List of all members
tracktion::engine::WaveCompManager Class Reference
Inheritance diagram for tracktion::engine::WaveCompManager:

Public Types

using Ptr = juce::ReferenceCountedObjectPtr< WaveCompManager >
 
- Public Types inherited from tracktion::engine::CompManager
using Ptr = juce::ReferenceCountedObjectPtr< CompManager >
 

Public Member Functions

 WaveCompManager (WaveAudioClip &)
 
 ~WaveCompManager () override
 
void updateThumbnails (juce::Component &, juce::OwnedArray< SmartThumbnail > &thumbnails) const
 Updates an array of thumbnails so they represent the takes and are in the correct order etc. More...
 
juce::File getCurrentCompFile () const
 Returns the current comp file. More...
 
HashCode getBaseTakeHash (int takeIndex) const override
 
double getTakeLength (int takeIndex) const override
 
double getOffset () const override
 
double getLoopLength () const override
 
bool getAutoTempo () override
 
double getSourceTempo () override
 
juce::String getWarning () override
 
float getRenderProgress () const override
 
void triggerCompRender () override
 Triggers the render of the comp. More...
 
void flattenTake (int takeIndex, bool deleteSourceFiles) override
 Should flatten the comp and remove all other takes. More...
 
juce::ValueTree pasteComp (const juce::ValueTree &compTree) override
 Pastes an existing comp to this manager and returns the newly added tree. More...
 
void setStripToUpdate (juce::Component *strip) override
 Sets a component to be updated during render processes. More...
 
juce::ValueTree addNewComp () override
 Adds a new comp to the end of the takes list optionally making it active. More...
 
CompRenderContext * createRenderContext () const
 Returns a context to render the current taste of this comp. More...
 
- Public Member Functions inherited from tracktion::engine::CompManager
 CompManager (Clip &, const juce::ValueTree &)
 Creates a CompManager for a given clip. More...
 
 ~CompManager () override
 Destructor. More...
 
virtual void initialise ()
 
virtual void discardCachedData ()
 
ClipgetClip () const noexcept
 
bool shouldDisplayWarning () const noexcept
 Returns true if the source should display a warning about using multi-tempo changes. More...
 
juce::ValueTree getSection (int takeIndex, int sectionIndex) const
 Returns the section at the given index of a given take. More...
 
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. More...
 
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. More...
 
juce::Range< double > getSectionTimes (const juce::ValueTree &) const
 Returns the time range a given section occupies for a given take. More...
 
juce::ValueTree getTakesTree ()
 
void setActiveTakeIndex (int index)
 Sets the active take index. More...
 
int getActiveTakeIndex () const
 Returns the active take index. More...
 
juce::ValueTree getActiveTakeTree () const
 Returns the active take tree. More...
 
int getNumTakes () const
 Returns the number of takes that are not comps. More...
 
int getNumComps () const
 Returns the number of comps that are comps. More...
 
int getTotalNumTakes () const
 Returns the total number of takes including comp takes. More...
 
bool isTakeComp (int takeIndex) const
 Returns true if the given take at an index is a comp. More...
 
bool isTakeComp (const juce::ValueTree &takeTree) const
 Returns true if the given take is a comp. More...
 
bool isCurrentTakeComp () const
 Returns true if the current take is a comp. More...
 
juce::String getTakeName (int index) const
 Returns the name of a take. More...
 
double getMaxCompLength () const
 Returns the maximum length that a comp can be. More...
 
juce::Range< double > getCompRange () const
 Returns the time range available for comping i.e. More...
 
double getSpeedRatio () const
 Returns the effective speed ratio used for displaying waveforms. More...
 
double getSourceTimeMultiplier () const
 Returns the current time multiplier in use by the source, either the speed ratio or auto tempo ratio. More...
 
HashCode getTakeHash (int takeIndex) const
 Returns a hash code representing a take. More...
 
void changeSectionIndexAtTime (double time, int takeIndex)
 Changes the index of the active comp's section at a given time. More...
 
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. More...
 
void moveSectionEndTime (juce::ValueTree &section, double newTime)
 Moves a section's end time to the new time specified. More...
 
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. More...
 
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. More...
 
juce::ValueTree addSection (int takeIndex, double endTime)
 Adds a new section at a given time and returns the index of it. More...
 
void removeSection (const juce::ValueTree &sectionToRemove)
 Removes a section from the active comp if it is within range. More...
 
juce::ValueTree splitSectionAtTime (double time)
 Find the current section at the given time and splits it in two ready for a new comp section. More...
 
void removeSectionsWithinRange (juce::Range< double > timeRange, const juce::ValueTree &sectionToKeep)
 Removes all sections which lie within the given time range. More...
 

Static Public Member Functions

static bool renderTake (CompRenderContext &, AudioFileWriter &, juce::ThreadPoolJob &, std::atomic< float > &progress)
 Renders the comp using the given writer and ThreadPoolJob. More...
 

Additional Inherited Members

- Protected Member Functions inherited from tracktion::engine::CompManager
juce::UndoManager * getUndoManager () const
 
void keepSectionsSortedAndInRange ()
 
juce::ValueTree getNewCompTree () const
 
- Protected Attributes inherited from tracktion::engine::CompManager
juce::ValueTree takesTree
 
int lastRenderedTake = -1
 
HashCode lastHash = 0
 
double maxCompLength
 
double effectiveTimeMultiplier
 
double lastOffset = 1.0
 
double lastTimeRatio = 1.0
 

Member Typedef Documentation

◆ Ptr

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

Constructor & Destructor Documentation

◆ WaveCompManager()

tracktion::engine::WaveCompManager::WaveCompManager ( WaveAudioClip )

◆ ~WaveCompManager()

tracktion::engine::WaveCompManager::~WaveCompManager ( )
override

Member Function Documentation

◆ updateThumbnails()

void tracktion::engine::WaveCompManager::updateThumbnails ( juce::Component &  ,
juce::OwnedArray< SmartThumbnail > &  thumbnails 
) const

Updates an array of thumbnails so they represent the takes and are in the correct order etc.

◆ getCurrentCompFile()

juce::File tracktion::engine::WaveCompManager::getCurrentCompFile ( ) const

Returns the current comp file.

◆ getBaseTakeHash()

HashCode tracktion::engine::WaveCompManager::getBaseTakeHash ( int  takeIndex) const
overridevirtual

◆ getTakeLength()

double tracktion::engine::WaveCompManager::getTakeLength ( int  takeIndex) const
overridevirtual

◆ getOffset()

double tracktion::engine::WaveCompManager::getOffset ( ) const
overridevirtual

◆ getLoopLength()

double tracktion::engine::WaveCompManager::getLoopLength ( ) const
overridevirtual

◆ getAutoTempo()

bool tracktion::engine::WaveCompManager::getAutoTempo ( )
overridevirtual

◆ getSourceTempo()

double tracktion::engine::WaveCompManager::getSourceTempo ( )
overridevirtual

◆ getWarning()

juce::String tracktion::engine::WaveCompManager::getWarning ( )
overridevirtual

Reimplemented from tracktion::engine::CompManager.

◆ getRenderProgress()

float tracktion::engine::WaveCompManager::getRenderProgress ( ) const
overridevirtual

Reimplemented from tracktion::engine::CompManager.

◆ triggerCompRender()

void tracktion::engine::WaveCompManager::triggerCompRender ( )
overridevirtual

Triggers the render of the comp.

Call this when you change the comp in some way.

Implements tracktion::engine::CompManager.

◆ flattenTake()

void tracktion::engine::WaveCompManager::flattenTake ( int  takeIndex,
bool  deleteSourceFiles 
)
overridevirtual

Should flatten the comp and remove all other takes.

Implements tracktion::engine::CompManager.

◆ pasteComp()

juce::ValueTree tracktion::engine::WaveCompManager::pasteComp ( const juce::ValueTree &  )
overridevirtual

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

Reimplemented from tracktion::engine::CompManager.

◆ setStripToUpdate()

void tracktion::engine::WaveCompManager::setStripToUpdate ( juce::Component *  )
overridevirtual

Sets a component to be updated during render processes.

Reimplemented from tracktion::engine::CompManager.

◆ addNewComp()

juce::ValueTree tracktion::engine::WaveCompManager::addNewComp ( )
overridevirtual

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.

Implements tracktion::engine::CompManager.

◆ createRenderContext()

CompRenderContext* tracktion::engine::WaveCompManager::createRenderContext ( ) const

Returns a context to render the current taste of this comp.

◆ renderTake()

static bool tracktion::engine::WaveCompManager::renderTake ( CompRenderContext &  ,
AudioFileWriter ,
juce::ThreadPoolJob &  ,
std::atomic< float > &  progress 
)
static

Renders the comp using the given writer and ThreadPoolJob.

This will return true if the comp was successfully completed or false if it failed. Note that this should only be called for comp takes and will simply return true for full takes.


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