11namespace tracktion {
inline namespace engine
54 void incReferenceCount() noexcept { ++refCount; }
55 bool decReferenceCountWithoutDeleting() noexcept;
56 int getReferenceCount() const noexcept {
return refCount.
get(); }
66 void addListener (
Listener* l) { listeners.add (l); }
67 void removeListener (Listener* l) { listeners.remove (l); }
107 UpdateMessage (Type t) : type (t) {}
111 if (
auto um =
dynamic_cast<const UpdateMessage*
> (&message))
123 enum { messageRetryTimeout = 50 };
130 bool isInitialised =
false, hasFinished =
false;
132 void sendCompletionMessages (
bool success);
135 void timerCallback()
override;
142 ~RenderManager()
override;
181 Job::Ptr findJob (
const AudioFile&)
noexcept;
182 void addJobInternal (Job*)
noexcept;
183 void removeJobInternal (Job*)
noexcept;
184 void addJobToPool (Job*)
noexcept;
185 void deleteJob (Job*);
187 void handleAsyncUpdate()
override;
The Engine is the central class for all tracktion sessions.
The base class that all generator jobs derive from.
virtual bool completeRender()=0
This is called once after all the render blocks have completed.
virtual bool renderNextBlock()=0
During a render process this will be repeatedly called.
void cleanUpDanglingJob()
Called during app shutdown by the manager on any jobs that haven't had a chance to recieve their asyn...
float getCurrentTaskProgress() override
Returns the progress of the job.
JobStatus runJob() override
Performs the render.
void cancelJob()
Cancels the current job safely making sure any listeners are called appropriately.
virtual bool setUpRender()=0
Subclasses should override this to set-up their render process.
Manages a set of reference counted render jobs and can be used to retrieve matching jobs or create ne...
void cleanUp()
Cleans up any remaining jobs - should be called before the manager is deleted.
static juce::StringRef getFileRenderPrefix()
Returns the prefix used for render files.
static AudioFile getAudioFileForHash(Engine &, const juce::File &directory, HashCode hash)
Returns the AudioFile for a particular hash.
Job::Ptr getRenderJobWithoutCreating(const AudioFile &audioFile)
This will return a Ptr to an existing render job for an audio file or nullptr if no job is in progres...
juce::ReferenceCountedArray< Job > getRenderJobsWithoutCreating(const AudioFile &)
Returns all the jobs that may be processing the given file.
int getNumJobs() noexcept
Returns the number of jobs in the pool.
bool isProxyBeingGenerated(const AudioFile &proxyFile) noexcept
Returns true if a render is currently being performed for this AudioFile.
float getProportionComplete(const AudioFile &proxyFile, float defaultVal) noexcept
Returns true if a render is currently being performed for this AudioFile.
Type get() const noexcept