TracktionEngine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
engine::ArchiveJob Class Reference

Job that archives a Project or single Edit into a standard zip file. More...

#include <tracktion_Archive.h>

Inheritance diagram for engine::ArchiveJob:

Public Types

enum class  CompressionLevel {
  uncompressed = 0 , fastest = 1 , normal = 6 , best = 9 ,
  defaultLevel = -1
}
 Compression level for the zip archive (maps to zlib levels 0-9, -1 = default). More...
 
using Source = std::variant< Project *, ProjectItem * >
 What to archive.
 

Public Member Functions

 ArchiveJob (Source source, const juce::File &destZipFile, CompressionLevel, bool includeClips=true)
 Creates a job to archive a Project or single Edit.
 
 ~ArchiveJob () override
 
JobStatus runJob () override
 
float getCurrentTaskProgress () override
 
bool canCancel () const override
 
bool runSynchronously ()
 Runs the archive process synchronously on the calling thread.
 
juce::String getError () const
 After runJob(), returns error message (empty on success).
 
- Public Member Functions inherited from engine::ThreadPoolJobWithProgress
 ThreadPoolJobWithProgress (const juce::String &name)
 
 ~ThreadPoolJobWithProgress ()
 
void setManager (BackgroundJobManager &)
 
void setName (const juce::String &newName)
 Sets the job's name but also updates the manager so the list will reflect it.
 
void prepareForJobDeletion ()
 Call this in your sub-class destructor to to remvoe it from the manager queue before this class's destructor is called which can result in a pure virtual call.
 

Detailed Description

Job that archives a Project or single Edit into a standard zip file.

For folder-based projects: consolidates then zips. For file-based projects: converts to folder-based in a temp dir first, then consolidates and zips.

Member Typedef Documentation

◆ Source

What to archive.

Member Enumeration Documentation

◆ CompressionLevel

Compression level for the zip archive (maps to zlib levels 0-9, -1 = default).

Enumerator
uncompressed 
fastest 
normal 
best 
defaultLevel 

Constructor & Destructor Documentation

◆ ArchiveJob()

engine::ArchiveJob::ArchiveJob ( Source  source,
const juce::File &  destZipFile,
CompressionLevel  ,
bool  includeClips = true 
)

Creates a job to archive a Project or single Edit.

If includeClips is false, the Edit's clips are stripped before its referenced material is collected, so the archive contains the Edit's structure but none of its audio. Video and marker clips are kept.

N.B. includeClips is only honoured for a single-Edit (ProjectItem) source - a whole-Project archive always includes the clips.

◆ ~ArchiveJob()

engine::ArchiveJob::~ArchiveJob ( )
override

Member Function Documentation

◆ runJob()

JobStatus engine::ArchiveJob::runJob ( )
override

◆ getCurrentTaskProgress()

float engine::ArchiveJob::getCurrentTaskProgress ( )
overridevirtual

◆ canCancel()

bool engine::ArchiveJob::canCancel ( ) const
overridevirtual

Reimplemented from engine::ThreadPoolJobWithProgress.

◆ runSynchronously()

bool engine::ArchiveJob::runSynchronously ( )

Runs the archive process synchronously on the calling thread.

Useful when already on the message thread (avoids MessageManager::callSync deadlock). Returns true on success. Call getError() for details on failure.

◆ getError()

juce::String engine::ArchiveJob::getError ( ) const

After runJob(), returns error message (empty on success).


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