TracktionEngine
Loading...
Searching...
No Matches
Classes | Functions
engine::ProjectUtilities Namespace Reference

Utilities for consolidating Projects and Edits. More...

Classes

struct  EditReferences
 Holds a mixed list of Edit pointers and owned Edits. More...
 

Functions

template<typename EditContainer >
void saveEdits (const EditContainer &edits)
 Force saves a container of Edits.
 
EditReferences getEditsInProject (Project &project)
 Returns a list of all Edits in a Project.
 
int importExternalFiles (Project &proj, juce::Array< ProjectItemRef > refsToImport)
 Looks through the given list of ProjectItemRefs for ProjectItems that have source files outside the project folder and copies these in, updating the ProjectItem to reference the new source files.
 
int importExternalReferences (Project &proj, juce::Array< ProjectItemRef > refsToImport)
 Looks through the given list of ProjectItemRefs for ProjectItems that are in a Project other than this Project, and creates new ProjectItems for them in this Project.
 
std::pair< int, juce::String > consolidateEdit (Edit &edit)
 Looks for clips that have source files outside of the project folder, and copies them in, updating the ProjectItem references.
 
bool canConsolidateEdit (Edit &edit)
 Returns true if the Edit has any ProjectItem references to files outside the project directory.
 
std::pair< int, juce::String > consolidateProject (Project &project)
 Looks for clips that have source files outside of the project folder, and copies them in, updating the ProjectItem references.
 
bool canConsolidateProject (Project &project)
 Returns true if the Project has any ProjectItem references to files outside the project directory.
 
bool isConsolidated (Edit &edit)
 Returns true if the Edit is fully consolidated (no external file refs).
 
bool isConsolidated (Project &project)
 Returns true if the Project is fully consolidated.
 
void consolidateEditInteractive (Edit &edit, std::function< void()> completionCallback=nullptr)
 Consolidates an Edit showing a confirmation dialog box first and a completion dialog afterwards.
 
void consolidateProjectInteractive (Project &project, std::function< void()> completionCallback=nullptr)
 Consolidates a Project showing a confirmation dialog box first and a completion dialog afterwards.
 

Detailed Description

Utilities for consolidating Projects and Edits.

Function Documentation

◆ saveEdits()

template<typename EditContainer >
void engine::ProjectUtilities::saveEdits ( const EditContainer &  edits)

Force saves a container of Edits.

References engine::EditFileOperations::save(), and saveEdits().

Referenced by saveEdits().

◆ getEditsInProject()

EditReferences engine::ProjectUtilities::getEditsInProject ( Project project)

Returns a list of all Edits in a Project.

If some Edits are already open, this will return those, closed Edits will be opened for examining so they can be edited.

References getEditsInProject().

Referenced by getEditsInProject().

◆ importExternalFiles()

int engine::ProjectUtilities::importExternalFiles ( Project proj,
juce::Array< ProjectItemRef refsToImport 
)

Looks through the given list of ProjectItemRefs for ProjectItems that have source files outside the project folder and copies these in, updating the ProjectItem to reference the new source files.

References importExternalFiles().

Referenced by importExternalFiles().

◆ importExternalReferences()

int engine::ProjectUtilities::importExternalReferences ( Project proj,
juce::Array< ProjectItemRef refsToImport 
)

Looks through the given list of ProjectItemRefs for ProjectItems that are in a Project other than this Project, and creates new ProjectItems for them in this Project.

Additionally this updates all the Edits in the Project to point at these new ProjectItems.

N.B. Running this and then importExternalFiles should fully consolidate an Edit. Running this for all Edits in a Project should fully consolidate the Project.

Returns
the number of ProjectItems imported.

References importExternalReferences().

Referenced by importExternalReferences().

◆ consolidateEdit()

std::pair< int, juce::String > engine::ProjectUtilities::consolidateEdit ( Edit edit)

Looks for clips that have source files outside of the project folder, and copies them in, updating the ProjectItem references.

If items have references to other Projects, this will create new Project items for them. Additionally, this will update references in other Edits belonging to this project with the new Project refs.

Returns
The number of files copied imported and an error message if one occured

References consolidateEdit().

Referenced by consolidateEdit().

◆ canConsolidateEdit()

bool engine::ProjectUtilities::canConsolidateEdit ( Edit edit)

Returns true if the Edit has any ProjectItem references to files outside the project directory.

References canConsolidateEdit().

Referenced by canConsolidateEdit().

◆ consolidateProject()

std::pair< int, juce::String > engine::ProjectUtilities::consolidateProject ( Project project)

Looks for clips that have source files outside of the project folder, and copies them in, updating the ProjectItem references.

If items have references to other Projects, this will create new Project items for them. Additionally, this will update references in all Edits belonging to this project with the new Project refs.

Returns
The number of files copied imported and an error message if one occured

References consolidateProject().

Referenced by consolidateProject().

◆ canConsolidateProject()

bool engine::ProjectUtilities::canConsolidateProject ( Project project)

Returns true if the Project has any ProjectItem references to files outside the project directory.

References canConsolidateProject().

Referenced by canConsolidateProject().

◆ isConsolidated() [1/2]

bool engine::ProjectUtilities::isConsolidated ( Edit edit)

Returns true if the Edit is fully consolidated (no external file refs).

References isConsolidated().

Referenced by isConsolidated(), and isConsolidated().

◆ isConsolidated() [2/2]

bool engine::ProjectUtilities::isConsolidated ( Project project)

Returns true if the Project is fully consolidated.

References isConsolidated().

◆ consolidateEditInteractive()

void engine::ProjectUtilities::consolidateEditInteractive ( Edit edit,
std::function< void()>  completionCallback = nullptr 
)

Consolidates an Edit showing a confirmation dialog box first and a completion dialog afterwards.

References consolidateEditInteractive().

Referenced by consolidateEditInteractive().

◆ consolidateProjectInteractive()

void engine::ProjectUtilities::consolidateProjectInteractive ( Project project,
std::function< void()>  completionCallback = nullptr 
)

Consolidates a Project showing a confirmation dialog box first and a completion dialog afterwards.

References consolidateProjectInteractive().

Referenced by consolidateProjectInteractive().