TracktionEngine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
engine::Renderer::RenderTask Class Reference

Task that actually performs the render operation in blocks. More...

#include <tracktion_Renderer.h>

Inheritance diagram for engine::Renderer::RenderTask:

Public Types

using CancellationCheck = std::function< bool()>
 A predicate polled to find out whether the render should stop.
 

Public Member Functions

 RenderTask (const juce::String &taskDescription, const Renderer::Parameters &, std::atomic< float > *progressToUpdate, juce::AudioFormatWriter::ThreadedWriter::IncomingDataReceiver *)
 Constructs a RenderTask for a set of parameters.
 
 RenderTask (const juce::String &taskDescription, const Renderer::Parameters &, std::unique_ptr< tracktion::graph::Node >, std::unique_ptr< tracktion::graph::PlayHead >, std::unique_ptr< tracktion::graph::PlayHeadState >, std::unique_ptr< ProcessState >, std::atomic< float > *progressToUpdate, juce::AudioFormatWriter::ThreadedWriter::IncomingDataReceiver *)
 Constructs a RenderTask for a set of parameters and existing graph.
 
 ~RenderTask () override
 Destructor.
 
JobStatus runJob () override
 Call until this returns jobHasFinished to perform the render.
 
float getCurrentTaskProgress () override
 Returns the current progress of the render.
 
void setCancellationCheck (CancellationCheck)
 Sets an additional predicate used to cancel this render.
 
bool shouldCancel () const
 Returns true if the render should stop.
 
bool performNormalisingAndTrimming (const Renderer::Parameters &target, const Renderer::Parameters &intermediate)
 
bool foldWrapRemainder (const Renderer::Parameters &target, const Renderer::Parameters &intermediate)
 
- Public Member Functions inherited from engine::ThreadPoolJobWithProgress
 ThreadPoolJobWithProgress (const juce::String &name)
 
 ~ThreadPoolJobWithProgress ()
 
virtual bool canCancel () const
 
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.
 

Static Public Member Functions

static CancellationCheck getDefaultCancellationCheck ()
 Returns a predicate which polls whichever of the standard exit mechanisms the calling thread happens to be using.
 
static void flushAllPlugins (const Plugin::Array &, double sampleRate, int samplesPerBlock)
 
static void setAllPluginsRealtime (const Plugin::Array &, bool realtime)
 
static bool addMidiMetaDataAndWriteToFile (juce::File, juce::MidiMessageSequence, const TempoSequence &)
 

Public Attributes

Renderer::Parameters params
 The Parameters being used.
 
juce::String errorMessage
 An error message if the render failed to start.
 

Detailed Description

Task that actually performs the render operation in blocks.

You should continually call the runJob method until it returns jobHasFinished.

Member Typedef Documentation

◆ CancellationCheck

using engine::Renderer::RenderTask::CancellationCheck = std::function<bool()>

A predicate polled to find out whether the render should stop.

This is called from whichever thread is driving runJob(), around once per block, so it must be cheap and mustn't block.

Constructor & Destructor Documentation

◆ RenderTask() [1/2]

engine::Renderer::RenderTask::RenderTask ( const juce::String &  taskDescription,
const Renderer::Parameters ,
std::atomic< float > *  progressToUpdate,
juce::AudioFormatWriter::ThreadedWriter::IncomingDataReceiver *   
)

Constructs a RenderTask for a set of parameters.

◆ RenderTask() [2/2]

engine::Renderer::RenderTask::RenderTask ( const juce::String &  taskDescription,
const Renderer::Parameters ,
std::unique_ptr< tracktion::graph::Node >  ,
std::unique_ptr< tracktion::graph::PlayHead >  ,
std::unique_ptr< tracktion::graph::PlayHeadState >  ,
std::unique_ptr< ProcessState ,
std::atomic< float > *  progressToUpdate,
juce::AudioFormatWriter::ThreadedWriter::IncomingDataReceiver *   
)

Constructs a RenderTask for a set of parameters and existing graph.

◆ ~RenderTask()

engine::Renderer::RenderTask::~RenderTask ( )
override

Destructor.

Member Function Documentation

◆ runJob()

JobStatus engine::Renderer::RenderTask::runJob ( )
override

Call until this returns jobHasFinished to perform the render.

◆ getCurrentTaskProgress()

float engine::Renderer::RenderTask::getCurrentTaskProgress ( )
overridevirtual

Returns the current progress of the render.

Implements engine::ThreadPoolJobWithProgress.

◆ setCancellationCheck()

void engine::Renderer::RenderTask::setCancellationCheck ( CancellationCheck  )

Sets an additional predicate used to cancel this render.

The standard thread and pool-job exit flags are always checked as well, so this only needs to supply a caller's own flag.

◆ shouldCancel()

bool engine::Renderer::RenderTask::shouldCancel ( ) const

Returns true if the render should stop.

◆ getDefaultCancellationCheck()

static CancellationCheck engine::Renderer::RenderTask::getDefaultCancellationCheck ( )
static

Returns a predicate which polls whichever of the standard exit mechanisms the calling thread happens to be using.

Safe to call from any thread.

◆ flushAllPlugins()

static void engine::Renderer::RenderTask::flushAllPlugins ( const Plugin::Array ,
double  sampleRate,
int  samplesPerBlock 
)
static

◆ setAllPluginsRealtime()

static void engine::Renderer::RenderTask::setAllPluginsRealtime ( const Plugin::Array ,
bool  realtime 
)
static

◆ addMidiMetaDataAndWriteToFile()

static bool engine::Renderer::RenderTask::addMidiMetaDataAndWriteToFile ( juce::File  ,
juce::MidiMessageSequence  ,
const TempoSequence  
)
static

◆ performNormalisingAndTrimming()

bool engine::Renderer::RenderTask::performNormalisingAndTrimming ( const Renderer::Parameters target,
const Renderer::Parameters intermediate 
)

◆ foldWrapRemainder()

bool engine::Renderer::RenderTask::foldWrapRemainder ( const Renderer::Parameters target,
const Renderer::Parameters intermediate 
)

Member Data Documentation

◆ params

Renderer::Parameters engine::Renderer::RenderTask::params

The Parameters being used.

◆ errorMessage

juce::String engine::Renderer::RenderTask::errorMessage

An error message if the render failed to start.


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