TracktionEngine
Loading...
Searching...
No Matches
engine::RenderOptions Class Reference

Represents a set of user properties used to control a render operation, using a ValueTree to hold them so that they can be saved and reloaded. More...

#include <tracktion_RenderOptions.h>

Inherits juce::ValueTree::Listener.

Public Types

enum  TargetFileFormat {
  wav = 0 , aiff , flac , ogg ,
  mp3 , midi , numFormats
}
enum  AddRenderOptions {
  addTrack = 0 , replaceTrack = 1 , nextTrack = 2 , thisTrack = 3 ,
  replaceClips = 4 , none = 5
}
 Enum to set the options for renders. More...
enum class  RenderType {
  editClip = 0 , clip , track , midi ,
  allExport
}
 Enum to determine the type of UI this RenderOptions represents. More...

Public Member Functions

 RenderOptions (Engine &)
 RenderOptions (const RenderOptions &, juce::UndoManager *)
 RenderOptions (Engine &, const juce::ValueTree &, juce::UndoManager *)
 ~RenderOptions () override
 RenderOptions ()=delete
 RenderOptions (const RenderOptions &)=delete
 RenderOptions (RenderOptions &&)=delete
RenderOptions operator= (const RenderOptions &)=delete
RenderOptions operator= (RenderOptions &&)=delete
void loadFromUserSettings ()
void saveToUserSettings ()
void setToDefault ()
RenderManager::Job::Ptr performBackgroundRender (Edit &, SelectionManager *, TimeRange timeRangeToRender)
 Performs the render operation on a background thread.
HashCode getHash () const noexcept
 Returns a hash representing the current set of render options.
Renderer::Parameters getRenderParameters (Edit &, SelectionManager *, TimeRange markedRegion)
 Returns a set of renderer parameters which can be used to describe a render operation.
Renderer::Parameters getRenderParameters (Edit &)
Renderer::Parameters getRenderParameters (EditClip &)
Renderer::Parameters getRenderParameters (MidiClip &)
juce::AudioFormat * getAudioFormat ()
 Returns an AudioFormat to use for the current render properties.
Clip::Ptr applyRenderToEdit (Edit &, ProjectItem::Ptr, TimeRange time, SelectionManager *) const
 Adds the given ProjectItem to the Edit using the render properties for positioning info.
bool getUINeedsRefresh ()
 If you've chnaged a property that will cause the UI configuration to change this will return true which you should rebuild the property set from.
void setUINeedsRefresh ()
bool isEditClipRender () const
bool isClipRender () const
bool isTrackRender () const
bool isMidiRender () const
bool isExportAll () const
bool isRender () const
TargetFileFormat setFormat (TargetFileFormat)
void setFormatType (const juce::String &typeString)
juce::String getFormatTypeName (TargetFileFormat)
juce::Array< EditItemID > getTrackIDs () const
void setTrackIDs (const juce::Array< EditItemID > &)
HashCode getTracksHash () const
void setSampleRate (int)
void setBitDepth (int depth)
juce::StringArray getQualitiesList () const
int getQualityIndex () const
void setQualityIndex (int q)
juce::File getDestFile () const noexcept
juce::String getFileExtension () const
juce::String getCurrentFileExtension ()
TargetFileFormat getFormat () const noexcept
int getBitDepth () const
ChannelConfiguration getChannelConfiguration () const
void setChannelConfiguration (const ChannelConfiguration &)
double getSampleRate () const
bool shouldAddMetadata () const
bool shouldAddAcidMetadata () const
juce::BigInteger getTrackIndexes (const Edit &) const
bool getRemoveSilence () const noexcept
bool getMarkedRegion () const noexcept
int getNumTracks () const noexcept
void setSelected (bool onlySelectedTrackAndClips)
void setMarkedRegion (bool onlyMarked)
void setIncludePlugins (bool includePlugins)
void setAddRenderOption (AddRenderOptions options)
void setEndAllowance (TimeDuration time)
void setFilename (juce::String, bool canPromptToOverwriteExisting, std::function< void()> onComplete=nullptr)
 Sets the destination file.
void updateHash ()
juce::StringArray getFormatTypes ()
juce::StringArray getAddRenderOptionText ()

Static Public Member Functions

static std::unique_ptr< RenderOptions > forGeneralExporter (Edit &)
 Creates a default RenderOptions object for a general purpose exporter.
static std::unique_ptr< RenderOptions > forTrackRender (juce::Array< Track * > tracks, AddRenderOptions addOption)
static std::unique_ptr< RenderOptions > forClipRender (juce::Array< Clip * > clips, bool midiNotes)
static std::unique_ptr< RenderOptions > forEditClip (Clip &editClip)
static TimeDuration findEndAllowance (Edit &, juce::Array< EditItemID > *tracks, juce::Array< Clip * > *)
static bool isMarkedRegionBigEnough (TimeRange)

Public Attributes

Engine & engine
juce::CachedValue< RenderType > type
juce::CachedValue< juce::String > tracksProperty
juce::CachedValue< bool > createMidiFile
juce::CachedValue< TargetFileFormat > format
juce::CachedValue< juce::String > channelConfigStr
juce::CachedValue< double > sampleRate
juce::CachedValue< int > bitDepth
juce::CachedValue< int > qualityIndex
juce::CachedValue< double > rmsLevelDb
juce::CachedValue< double > peakLevelDb
juce::CachedValue< bool > removeSilence
juce::CachedValue< bool > normalise
juce::CachedValue< bool > dither
juce::CachedValue< bool > adjustBasedOnRMS
juce::CachedValue< bool > markedRegion
juce::CachedValue< bool > selectedTracks
juce::CachedValue< bool > selectedClips
juce::CachedValue< bool > tracksToSeparateFiles
juce::CachedValue< bool > realTime
juce::CachedValue< bool > usePlugins
juce::CachedValue< AddRenderOptions > addRenderOptions
juce::CachedValue< bool > addRenderToLibrary
juce::CachedValue< bool > reverseRender
juce::CachedValue< bool > addMetadata
juce::CachedValue< bool > addAcidMetadata
std::function< void(AudioClipBase &)> offerToAddClipToLibrary
std::function< void(const juce::File &)> offerToAddFileToLibrary

Detailed Description

Represents a set of user properties used to control a render operation, using a ValueTree to hold them so that they can be saved and reloaded.

They can also be converted into a set of Renderer::Properties.

Member Enumeration Documentation

◆ TargetFileFormat

Enumerator
wav 
aiff 
flac 
ogg 
mp3 
midi 
numFormats 

◆ AddRenderOptions

Enum to set the options for renders.

Enumerator
addTrack 
replaceTrack 
nextTrack 
thisTrack 
replaceClips 
none 

◆ RenderType

Enum to determine the type of UI this RenderOptions represents.

Enumerator
editClip 
clip 
track 
midi 
allExport 

Constructor & Destructor Documentation

◆ RenderOptions() [1/6]

engine::RenderOptions::RenderOptions ( Engine & )

◆ RenderOptions() [2/6]

engine::RenderOptions::RenderOptions ( const RenderOptions & ,
juce::UndoManager *  )

References RenderOptions().

◆ RenderOptions() [3/6]

engine::RenderOptions::RenderOptions ( Engine & ,
const juce::ValueTree & ,
juce::UndoManager *  )

◆ ~RenderOptions()

engine::RenderOptions::~RenderOptions ( )
override

◆ RenderOptions() [4/6]

engine::RenderOptions::RenderOptions ( )
delete

◆ RenderOptions() [5/6]

engine::RenderOptions::RenderOptions ( const RenderOptions & )
delete

References RenderOptions().

◆ RenderOptions() [6/6]

engine::RenderOptions::RenderOptions ( RenderOptions && )
delete

References RenderOptions().

Member Function Documentation

◆ operator=() [1/2]

RenderOptions engine::RenderOptions::operator= ( const RenderOptions & )
delete

References RenderOptions().

◆ operator=() [2/2]

RenderOptions engine::RenderOptions::operator= ( RenderOptions && )
delete

References RenderOptions().

◆ loadFromUserSettings()

void engine::RenderOptions::loadFromUserSettings ( )

◆ saveToUserSettings()

void engine::RenderOptions::saveToUserSettings ( )

◆ setToDefault()

void engine::RenderOptions::setToDefault ( )

◆ performBackgroundRender()

RenderManager::Job::Ptr engine::RenderOptions::performBackgroundRender ( Edit & ,
SelectionManager * ,
TimeRange timeRangeToRender )

Performs the render operation on a background thread.

◆ getHash()

HashCode engine::RenderOptions::getHash ( ) const
noexcept

Returns a hash representing the current set of render options.

◆ getRenderParameters() [1/4]

Renderer::Parameters engine::RenderOptions::getRenderParameters ( Edit & ,
SelectionManager * ,
TimeRange markedRegion )

Returns a set of renderer parameters which can be used to describe a render operation.

References markedRegion.

◆ getRenderParameters() [2/4]

Renderer::Parameters engine::RenderOptions::getRenderParameters ( Edit & )

◆ getRenderParameters() [3/4]

Renderer::Parameters engine::RenderOptions::getRenderParameters ( EditClip & )

◆ getRenderParameters() [4/4]

Renderer::Parameters engine::RenderOptions::getRenderParameters ( MidiClip & )

◆ getAudioFormat()

juce::AudioFormat * engine::RenderOptions::getAudioFormat ( )

Returns an AudioFormat to use for the current render properties.

◆ applyRenderToEdit()

Clip::Ptr engine::RenderOptions::applyRenderToEdit ( Edit & ,
ProjectItem::Ptr ,
TimeRange time,
SelectionManager *  ) const

Adds the given ProjectItem to the Edit using the render properties for positioning info.

◆ forGeneralExporter()

std::unique_ptr< RenderOptions > engine::RenderOptions::forGeneralExporter ( Edit & )
static

Creates a default RenderOptions object for a general purpose exporter.

◆ forTrackRender()

std::unique_ptr< RenderOptions > engine::RenderOptions::forTrackRender ( juce::Array< Track * > tracks,
AddRenderOptions addOption )
static

◆ forClipRender()

std::unique_ptr< RenderOptions > engine::RenderOptions::forClipRender ( juce::Array< Clip * > clips,
bool midiNotes )
static

◆ forEditClip()

std::unique_ptr< RenderOptions > engine::RenderOptions::forEditClip ( Clip & editClip)
static

◆ getUINeedsRefresh()

bool engine::RenderOptions::getUINeedsRefresh ( )

If you've chnaged a property that will cause the UI configuration to change this will return true which you should rebuild the property set from.

◆ setUINeedsRefresh()

void engine::RenderOptions::setUINeedsRefresh ( )

◆ isEditClipRender()

bool engine::RenderOptions::isEditClipRender ( ) const

References editClip, and type.

◆ isClipRender()

bool engine::RenderOptions::isClipRender ( ) const

References clip, and type.

Referenced by isRender().

◆ isTrackRender()

bool engine::RenderOptions::isTrackRender ( ) const

References track, and type.

Referenced by isRender().

◆ isMidiRender()

bool engine::RenderOptions::isMidiRender ( ) const

References midi, and type.

Referenced by isRender().

◆ isExportAll()

bool engine::RenderOptions::isExportAll ( ) const

References allExport, and type.

◆ isRender()

bool engine::RenderOptions::isRender ( ) const

◆ setFormat()

TargetFileFormat engine::RenderOptions::setFormat ( TargetFileFormat )

◆ setFormatType()

void engine::RenderOptions::setFormatType ( const juce::String & typeString)

◆ getFormatTypeName()

juce::String engine::RenderOptions::getFormatTypeName ( TargetFileFormat )

◆ getTrackIDs()

juce::Array< EditItemID > engine::RenderOptions::getTrackIDs ( ) const

◆ setTrackIDs()

void engine::RenderOptions::setTrackIDs ( const juce::Array< EditItemID > & )

◆ getTracksHash()

HashCode engine::RenderOptions::getTracksHash ( ) const

◆ setSampleRate()

void engine::RenderOptions::setSampleRate ( int )

◆ setBitDepth()

void engine::RenderOptions::setBitDepth ( int depth)

References bitDepth.

◆ getQualitiesList()

juce::StringArray engine::RenderOptions::getQualitiesList ( ) const

◆ getQualityIndex()

int engine::RenderOptions::getQualityIndex ( ) const

References qualityIndex.

◆ setQualityIndex()

void engine::RenderOptions::setQualityIndex ( int q)

References qualityIndex.

◆ getDestFile()

juce::File engine::RenderOptions::getDestFile ( ) const
noexcept

◆ getFileExtension()

juce::String engine::RenderOptions::getFileExtension ( ) const

◆ getCurrentFileExtension()

juce::String engine::RenderOptions::getCurrentFileExtension ( )

◆ getFormat()

TargetFileFormat engine::RenderOptions::getFormat ( ) const
noexcept

References format.

◆ getBitDepth()

int engine::RenderOptions::getBitDepth ( ) const

References bitDepth.

◆ getChannelConfiguration()

ChannelConfiguration engine::RenderOptions::getChannelConfiguration ( ) const

◆ setChannelConfiguration()

void engine::RenderOptions::setChannelConfiguration ( const ChannelConfiguration & )

◆ getSampleRate()

double engine::RenderOptions::getSampleRate ( ) const

References sampleRate.

◆ shouldAddMetadata()

bool engine::RenderOptions::shouldAddMetadata ( ) const

References addMetadata.

◆ shouldAddAcidMetadata()

bool engine::RenderOptions::shouldAddAcidMetadata ( ) const

References addAcidMetadata.

◆ getTrackIndexes()

juce::BigInteger engine::RenderOptions::getTrackIndexes ( const Edit & ) const

◆ getRemoveSilence()

bool engine::RenderOptions::getRemoveSilence ( ) const
noexcept

References removeSilence.

◆ getMarkedRegion()

bool engine::RenderOptions::getMarkedRegion ( ) const
noexcept

References markedRegion.

◆ getNumTracks()

int engine::RenderOptions::getNumTracks ( ) const
noexcept

◆ setSelected()

void engine::RenderOptions::setSelected ( bool onlySelectedTrackAndClips)

◆ setMarkedRegion()

void engine::RenderOptions::setMarkedRegion ( bool onlyMarked)

References markedRegion.

◆ setIncludePlugins()

void engine::RenderOptions::setIncludePlugins ( bool includePlugins)

References usePlugins.

◆ setAddRenderOption()

void engine::RenderOptions::setAddRenderOption ( AddRenderOptions options)

References addRenderOptions.

◆ setEndAllowance()

void engine::RenderOptions::setEndAllowance ( TimeDuration time)

◆ setFilename()

void engine::RenderOptions::setFilename ( juce::String ,
bool canPromptToOverwriteExisting,
std::function< void()> onComplete = nullptr )

Sets the destination file.

As this may need to asynchronously prompt to overwrite an existing file, the optional callback is invoked once the filename has actually been updated.

◆ updateHash()

void engine::RenderOptions::updateHash ( )

◆ getFormatTypes()

juce::StringArray engine::RenderOptions::getFormatTypes ( )

◆ getAddRenderOptionText()

juce::StringArray engine::RenderOptions::getAddRenderOptionText ( )

◆ findEndAllowance()

TimeDuration engine::RenderOptions::findEndAllowance ( Edit & ,
juce::Array< EditItemID > * tracks,
juce::Array< Clip * > *  )
static

◆ isMarkedRegionBigEnough()

bool engine::RenderOptions::isMarkedRegionBigEnough ( TimeRange )
static

Member Data Documentation

◆ engine

Engine& engine::RenderOptions::engine

◆ type

juce::CachedValue<RenderType> engine::RenderOptions::type

◆ tracksProperty

juce::CachedValue<juce::String> engine::RenderOptions::tracksProperty

◆ createMidiFile

juce::CachedValue<bool> engine::RenderOptions::createMidiFile

◆ format

juce::CachedValue<TargetFileFormat> engine::RenderOptions::format

Referenced by getFormat().

◆ channelConfigStr

juce::CachedValue<juce::String> engine::RenderOptions::channelConfigStr

◆ sampleRate

juce::CachedValue<double> engine::RenderOptions::sampleRate

Referenced by getSampleRate().

◆ bitDepth

juce::CachedValue<int> engine::RenderOptions::bitDepth

Referenced by getBitDepth(), and setBitDepth().

◆ qualityIndex

juce::CachedValue<int> engine::RenderOptions::qualityIndex

Referenced by getQualityIndex(), and setQualityIndex().

◆ rmsLevelDb

juce::CachedValue<double> engine::RenderOptions::rmsLevelDb

◆ peakLevelDb

juce::CachedValue<double> engine::RenderOptions::peakLevelDb

◆ removeSilence

juce::CachedValue<bool> engine::RenderOptions::removeSilence

Referenced by getRemoveSilence().

◆ normalise

juce::CachedValue<bool> engine::RenderOptions::normalise

◆ dither

juce::CachedValue<bool> engine::RenderOptions::dither

◆ adjustBasedOnRMS

juce::CachedValue<bool> engine::RenderOptions::adjustBasedOnRMS

◆ markedRegion

juce::CachedValue<bool> engine::RenderOptions::markedRegion

◆ selectedTracks

juce::CachedValue<bool> engine::RenderOptions::selectedTracks

◆ selectedClips

juce::CachedValue<bool> engine::RenderOptions::selectedClips

◆ tracksToSeparateFiles

juce::CachedValue<bool> engine::RenderOptions::tracksToSeparateFiles

◆ realTime

juce::CachedValue<bool> engine::RenderOptions::realTime

◆ usePlugins

juce::CachedValue<bool> engine::RenderOptions::usePlugins

Referenced by setIncludePlugins().

◆ addRenderOptions

juce::CachedValue<AddRenderOptions> engine::RenderOptions::addRenderOptions

Referenced by setAddRenderOption().

◆ addRenderToLibrary

juce::CachedValue<bool> engine::RenderOptions::addRenderToLibrary

◆ reverseRender

juce::CachedValue<bool> engine::RenderOptions::reverseRender

◆ addMetadata

juce::CachedValue<bool> engine::RenderOptions::addMetadata

Referenced by shouldAddMetadata().

◆ addAcidMetadata

juce::CachedValue<bool> engine::RenderOptions::addAcidMetadata

Referenced by shouldAddAcidMetadata().

◆ offerToAddClipToLibrary

std::function<void(AudioClipBase&)> engine::RenderOptions::offerToAddClipToLibrary

◆ offerToAddFileToLibrary

std::function<void(const juce::File&)> engine::RenderOptions::offerToAddFileToLibrary

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