TracktionEngine
Loading...
Searching...
No Matches
engine::EditSnapshot Class Reference

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

#include <tracktion_EditSnapshot.h>

Inherits juce::ReferenceCountedObject.

Classes

struct  Marker
struct  Listener

Public Types

using Ptr = juce::ReferenceCountedObjectPtr<EditSnapshot>

Public Member Functions

 ~EditSnapshot ()
juce::File getFile () const
 Returns the File if this was created from one.
juce::ValueTree getState () noexcept
 Returns the source Xml.
void setState (juce::ValueTree, TimeDuration editLength)
 Sets the Edit XML that the XmlEdit should refer to.
bool isValid () const
 Returns true if the current source is a valid Edit.
void refreshCacheAndNotifyListeners ()
 Refreshes the cached properties and calls any listeners.
void refresh ()
 Full refresh reloading from the source file.
juce::ReferenceCountedArray< EditSnapshot > getNestedEditObjects ()
 deals only with snapshots so it's relatively fast.
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< juce::File > & getEditClips () const
const juce::Array< juce::File > & getClipsSourceRefs () const
HashCode getHash () const
void addListener (Listener *l)
void removeListener (Listener *l)

Static Public Member Functions

static Ptr getEditSnapshot (Engine &, juce::File)

Public Attributes

Engine & engine

Detailed Description

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

Member Typedef Documentation

◆ Ptr

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

Constructor & Destructor Documentation

◆ ~EditSnapshot()

engine::EditSnapshot::~EditSnapshot ( )

Member Function Documentation

◆ getEditSnapshot()

Ptr engine::EditSnapshot::getEditSnapshot ( Engine & ,
juce::File  )
static

◆ getFile()

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

Returns the File if this was created from one.

◆ getState()

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

Returns the source Xml.

◆ setState()

void 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 engine::EditSnapshot::isValid ( ) const

Returns true if the current source is a valid Edit.

◆ refreshCacheAndNotifyListeners()

void engine::EditSnapshot::refreshCacheAndNotifyListeners ( )

Refreshes the cached properties and calls any listeners.

◆ refresh()

void engine::EditSnapshot::refresh ( )

Full refresh reloading from the source file.

◆ getNestedEditObjects()

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

deals only with snapshots so it's relatively fast.

◆ getName()

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

◆ getNumTracks()

int engine::EditSnapshot::getNumTracks ( ) const

◆ getNumAudioTracks()

int engine::EditSnapshot::getNumAudioTracks ( ) const

◆ getIndexOfTrackID()

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

Referenced by getTrackNameFromID().

◆ getTrackName()

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

◆ getTrackNameFromID()

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

References getIndexOfTrackID().

◆ isAudioTrack()

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

◆ isTrackMuted()

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

◆ isTrackSoloed()

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

◆ isTrackSoloIsolated()

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

◆ audioToGlobalTrackIndex()

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

◆ getLength()

TimeDuration engine::EditSnapshot::getLength ( ) const

◆ getMarkIn()

TimePosition engine::EditSnapshot::getMarkIn ( ) const

◆ getMarkOut()

TimePosition engine::EditSnapshot::getMarkOut ( ) const

◆ areMarksActive()

bool engine::EditSnapshot::areMarksActive ( ) const

◆ getTempo()

double engine::EditSnapshot::getTempo ( ) const

◆ getTimeSigNumerator()

int engine::EditSnapshot::getTimeSigNumerator ( ) const

◆ getTimeSigDenominator()

int engine::EditSnapshot::getTimeSigDenominator ( ) const

◆ getPitch()

int engine::EditSnapshot::getPitch ( ) const

◆ getMarkers()

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

◆ getTracks()

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

◆ getEditClips()

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

◆ getClipsSourceRefs()

const juce::Array< juce::File > & engine::EditSnapshot::getClipsSourceRefs ( ) const

◆ getHash()

HashCode engine::EditSnapshot::getHash ( ) const

◆ addListener()

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

◆ removeListener()

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

Member Data Documentation

◆ engine

Engine& engine::EditSnapshot::engine

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