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)
 
 ~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   
)

◆ ~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: