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

Holds a snapshot of an Edit file of the last time it was saved. More...

Inherits juce::ReferenceCountedObject.

Classes

struct  Listener
 
struct  Marker
 

Public Types

using Ptr = juce::ReferenceCountedObjectPtr< EditSnapshot >
 

Public Member Functions

 ~EditSnapshot ()
 
ProjectItemID getID () const noexcept
 Returns the ProjectItemID. More...
 
juce::File getFile () const
 Returns the File if this was created from one. More...
 
juce::ValueTree getState () noexcept
 Returns the source Xml. More...
 
void setState (juce::ValueTree, TimeDuration editLength)
 Sets the Edit XML that the XmlEdit should refer to. More...
 
bool isValid () const
 Returns true if the current source is a valid Edit. More...
 
void refreshFromProjectManager ()
 Looks in the ProjectManager for the relevant ProjectItem and updates it's state to reflect this. More...
 
void refreshCacheAndNotifyListeners ()
 Refreshes the cached properties and calls any listeners. More...
 
juce::ReferenceCountedArray< EditSnapshotgetNestedEditObjects ()
 deals only with snapshots so it's relatively fast. More...
 
juce::String getName () const
 
int getNumTracks () const
 
int getNumAudioTracks () const
 
int getIndexOfTrackID (EditItemID trackID) const
 
juce::String getTrackName (int index) const
 
juce::String getTrackNameFromID (EditItemID trackID) const
 
bool isAudioTrack (int trackIndex) const
 
bool isTrackMuted (int trackIndex) const
 
bool isTrackSoloed (int trackIndex) const
 
bool isTrackSoloIsolated (int trackIndex) const
 
int audioToGlobalTrackIndex (int audioIndex) const
 
TimeDuration getLength () const
 
TimePosition getMarkIn () const
 
TimePosition getMarkOut () const
 
bool areMarksActive () const
 
double getTempo () const
 
int getTimeSigNumerator () const
 
int getTimeSigDenominator () const
 
int getPitch () const
 
const juce::Array< Marker > & getMarkers () const
 
const juce::Array< EditItemID > & getTracks () const
 
const juce::Array< ProjectItemID > & getEditClips () const
 
const juce::Array< ProjectItemID > & getClipsSourceIDs () const
 
HashCode getHash () const
 
void addListener (Listener *l)
 
void removeListener (Listener *l)
 

Static Public Member Functions

static Ptr getEditSnapshot (Engine &, ProjectItemID)
 

Public Attributes

Engineengine
 

Detailed Description

Holds a snapshot of an Edit file of the last time it was saved.

Member Typedef Documentation

◆ Ptr

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

Constructor & Destructor Documentation

◆ ~EditSnapshot()

tracktion::engine::EditSnapshot::~EditSnapshot ( )

Member Function Documentation

◆ getEditSnapshot()

static Ptr tracktion::engine::EditSnapshot::getEditSnapshot ( Engine ,
ProjectItemID   
)
static

◆ getID()

ProjectItemID tracktion::engine::EditSnapshot::getID ( ) const
noexcept

Returns the ProjectItemID.

◆ getFile()

juce::File tracktion::engine::EditSnapshot::getFile ( ) const

Returns the File if this was created from one.

◆ getState()

juce::ValueTree tracktion::engine::EditSnapshot::getState ( )
noexcept

Returns the source Xml.

◆ setState()

void tracktion::engine::EditSnapshot::setState ( juce::ValueTree  ,
TimeDuration  editLength 
)

Sets the Edit XML that the XmlEdit should refer to.

This will take ownership of the XmlElement so don't hang on to it. Once this is set you can retrieve the Xml for saving etc. using getXml(). As the length isn't stored in the Xml we need to provide it.

Note that this DOES NOT update the cached properties, once the Xml has been set call refreshCacheAndSave to update these. Although this seems a bit convoluted it's how the temp Edit files work so we need to follow this. It means that this will hold up-to-date Xml but only cached properties of the last save which can be used in things like EditClips.

◆ isValid()

bool tracktion::engine::EditSnapshot::isValid ( ) const

Returns true if the current source is a valid Edit.

◆ refreshFromProjectManager()

void tracktion::engine::EditSnapshot::refreshFromProjectManager ( )

Looks in the ProjectManager for the relevant ProjectItem and updates it's state to reflect this.

◆ refreshCacheAndNotifyListeners()

void tracktion::engine::EditSnapshot::refreshCacheAndNotifyListeners ( )

Refreshes the cached properties and calls any listeners.

◆ getNestedEditObjects()

juce::ReferenceCountedArray<EditSnapshot> tracktion::engine::EditSnapshot::getNestedEditObjects ( )

deals only with snapshots so it's relatively fast.

◆ getName()

juce::String tracktion::engine::EditSnapshot::getName ( ) const

◆ getNumTracks()

int tracktion::engine::EditSnapshot::getNumTracks ( ) const

◆ getNumAudioTracks()

int tracktion::engine::EditSnapshot::getNumAudioTracks ( ) const

◆ getIndexOfTrackID()

int tracktion::engine::EditSnapshot::getIndexOfTrackID ( EditItemID  trackID) const

Referenced by getTrackNameFromID().

◆ getTrackName()

juce::String tracktion::engine::EditSnapshot::getTrackName ( int  index) const

◆ getTrackNameFromID()

juce::String tracktion::engine::EditSnapshot::getTrackNameFromID ( EditItemID  trackID) const

References getIndexOfTrackID().

◆ isAudioTrack()

bool tracktion::engine::EditSnapshot::isAudioTrack ( int  trackIndex) const

◆ isTrackMuted()

bool tracktion::engine::EditSnapshot::isTrackMuted ( int  trackIndex) const

◆ isTrackSoloed()

bool tracktion::engine::EditSnapshot::isTrackSoloed ( int  trackIndex) const

◆ isTrackSoloIsolated()

bool tracktion::engine::EditSnapshot::isTrackSoloIsolated ( int  trackIndex) const

◆ audioToGlobalTrackIndex()

int tracktion::engine::EditSnapshot::audioToGlobalTrackIndex ( int  audioIndex) const

◆ getLength()

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

◆ getMarkIn()

TimePosition tracktion::engine::EditSnapshot::getMarkIn ( ) const

◆ getMarkOut()

TimePosition tracktion::engine::EditSnapshot::getMarkOut ( ) const

◆ areMarksActive()

bool tracktion::engine::EditSnapshot::areMarksActive ( ) const

◆ getTempo()

double tracktion::engine::EditSnapshot::getTempo ( ) const

◆ getTimeSigNumerator()

int tracktion::engine::EditSnapshot::getTimeSigNumerator ( ) const

◆ getTimeSigDenominator()

int tracktion::engine::EditSnapshot::getTimeSigDenominator ( ) const

◆ getPitch()

int tracktion::engine::EditSnapshot::getPitch ( ) const

◆ getMarkers()

const juce::Array<Marker>& tracktion::engine::EditSnapshot::getMarkers ( ) const

◆ getTracks()

const juce::Array<EditItemID>& tracktion::engine::EditSnapshot::getTracks ( ) const

◆ getEditClips()

const juce::Array<ProjectItemID>& tracktion::engine::EditSnapshot::getEditClips ( ) const

◆ getClipsSourceIDs()

const juce::Array<ProjectItemID>& tracktion::engine::EditSnapshot::getClipsSourceIDs ( ) const

◆ getHash()

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

◆ addListener()

void tracktion::engine::EditSnapshot::addListener ( Listener l)

◆ removeListener()

void tracktion::engine::EditSnapshot::removeListener ( Listener l)

Member Data Documentation

◆ engine

Engine& tracktion::engine::EditSnapshot::engine

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