TracktionEngine
Classes | Public Member Functions | List of all members
tracktion::engine::EngineBehaviour Class Reference

Provides custom handlers to control various aspects of the engine's behaviour. More...

Classes

struct  ClipDefaults
 Determines the default properties of clips. More...
 
struct  ControlSurfaces
 
struct  LevelMeterSettings
 

Public Member Functions

 EngineBehaviour ()=default
 
virtual ~EngineBehaviour ()=default
 
virtual juce::ReferenceCountedObjectPtr< RackTypecreatePresetRackType (int, Edit &)
 
virtual Plugin::Ptr createCustomPlugin (PluginCreationInfo)
 This will be called if the PluginManager doesn't know how to create a Plugin for the given info. More...
 
virtual std::unique_ptr< juce::PluginDescription > findDescriptionForFileOrID (const juce::String &)
 Gives an opportunity to load custom plugins for those that have been registered as custom formats but not added to the list. More...
 
virtual bool isPluginDisabled (const juce::String &)
 Should return if the given plugin is disabled or not. More...
 
virtual void setPluginDisabled (const juce::String &, bool)
 Should implement a way of saving if plugin is disabled or not. More...
 
virtual bool shouldLoadPlugin (ExternalPlugin &p)
 Should the plugin be loaded. More...
 
virtual void doAdditionalInitialisation (ExternalPlugin &)
 Gives the host a chance to do any extra configuration after a plugin is loaded. More...
 
virtual juce::Array< Exportable::ReferencedItemgetReferencedItems (ExternalPlugin &)
 If you have any special VST plugins that access items in the Edit, you need to return them. More...
 
virtual void reassignReferencedItem (ExternalPlugin &, const Exportable::ReferencedItem &, ProjectItemID, double)
 If you have any special VST plugins that access items in the Edit, you need to reassign them. More...
 
virtual bool shouldBypassedPluginsBeRemovedFromPlaybackGraph ()
 Should return if plugins which have been bypassed should be included in the playback graph. More...
 
virtual bool shouldProcessAuxSendWhenTrackIsMuted (AuxSendPlugin &)
 Whether or not to include muted track contents in aux send plugins. More...
 
virtual void saveCustomPluginProperties (juce::ValueTree &, juce::AudioPluginInstance &, juce::UndoManager *)
 Gives plugins an opportunity to save custom data when the plugin state gets flushed. More...
 
virtual bool canScanPluginsOutOfProcess ()
 Return true if your application supports scanning plugins out of process. More...
 
virtual bool autoInitialiseDeviceManager ()
 You may want to disable auto initialisation of the device manager if you are using the engine in a plugin. More...
 
virtual bool addSystemAudioIODeviceTypes ()
 In plugin builds, you might want to avoid adding the system audio devices and only use the host inputs. More...
 
virtual int getMiddleCOctave ()
 
virtual void setMiddleCOctave (int)
 
virtual int getDefaultNoteColour ()
 
virtual void editHasBeenSaved (Edit &, juce::File)
 
virtual bool isMidiDriverUsedForIncommingMessageTiming ()
 Should return true if the incoming timestamp for MIDI messages should be used. More...
 
virtual void setMidiDriverUsedForIncommingMessageTiming (bool)
 
virtual bool shouldPlayMidiGuideNotes ()
 
virtual int getNumberOfCPUsToUseForAudio ()
 
virtual bool shouldProcessMutedTracks ()
 Should muted tracks processing be disabled to save CPU. More...
 
virtual bool monitorAudioInputsWithoutRecordEnable ()
 Should audio inputs be audible when monitor-enabled but not record enabled. More...
 
virtual bool areAudioClipsRemappedWhenTempoChanges ()
 
virtual void setAudioClipsRemappedWhenTempoChanges (bool)
 
virtual bool areAutoTempoClipsRemappedWhenTempoChanges ()
 
virtual void setAutoTempoClipsRemappedWhenTempoChanges (bool)
 
virtual bool areMidiClipsRemappedWhenTempoChanges ()
 
virtual void setMidiClipsRemappedWhenTempoChanges (bool)
 
virtual bool arePluginsRemappedWhenTempoChanges ()
 
virtual void setPluginsRemappedWhenTempoChanges (bool)
 
virtual EditLimits getEditLimits ()
 Should return the maximum number of elements that can be added to an Edit. More...
 
virtual bool lengthOfOneBeatDependsOnTimeSignature ()
 If this returns true, it means that the length (in seconds) of one "beat" at any point in an edit is considered to be the length of one division in the current bar's time signature. More...
 
virtual LevelMeterSettings getLevelMeterSettings ()
 
virtual void setLevelMeterSettings (LevelMeterSettings)
 
virtual void setProcessPriority (int)
 
virtual bool isDescriptionOfWaveDevicesSupported ()
 If this returns true, you must implement describeWaveDevices to determine the wave devices for a given device. More...
 
virtual void describeWaveDevices (std::vector< WaveDeviceDescription > &, juce::AudioIODevice &, bool)
 If isDescriptionOfWaveDevicesSupported returns true, this should be implemented to describe the wave devices for a given audio device. More...
 
virtual juce::MidiMessageSequence createPlaybackMidiSequence (const MidiList &list, MidiClip &clip, MidiList::TimeBase tb, bool generateMPE)
 Called by the MidiList to create a MidiMessageSequence for playback. More...
 
virtual int getDefaultLoopedSequenceType ()
 Must return the default looped sequence type to use. More...
 
virtual bool autoAddClipEdgeFades ()
 If this returns true, it means that newly inserted clips will automatically have a fade-in and fade-out of 3ms applied. More...
 
virtual ClipDefaults getClipDefaults ()
 Returns the defaults to be applied to new clips. More...
 
virtual void newClipAdded (Clip &, [[maybe_unused]] bool fromRecording)
 Returns the defaults to be applied to new clips. More...
 
virtual ControlSurfaces getDesiredControlSurfaces ()
 Return the control surfaces you want enabled in the engine. More...
 
virtual ControlSurfacegetCustomControlSurfaceForXML (ExternalControllerManager &, const juce::XmlElement &)
 Restore a custom control surface from custom XML. More...
 

Detailed Description

Provides custom handlers to control various aspects of the engine's behaviour.

Create a subclass of EngineBehaviour to customise how the engine operates

Constructor & Destructor Documentation

◆ EngineBehaviour()

tracktion::engine::EngineBehaviour::EngineBehaviour ( )
default

◆ ~EngineBehaviour()

virtual tracktion::engine::EngineBehaviour::~EngineBehaviour ( )
virtualdefault

Member Function Documentation

◆ createPresetRackType()

virtual juce::ReferenceCountedObjectPtr<RackType> tracktion::engine::EngineBehaviour::createPresetRackType ( int  ,
Edit  
)
virtual

◆ createCustomPlugin()

virtual Plugin::Ptr tracktion::engine::EngineBehaviour::createCustomPlugin ( PluginCreationInfo  )
virtual

This will be called if the PluginManager doesn't know how to create a Plugin for the given info.

◆ findDescriptionForFileOrID()

virtual std::unique_ptr<juce::PluginDescription> tracktion::engine::EngineBehaviour::findDescriptionForFileOrID ( const juce::String &  )
virtual

Gives an opportunity to load custom plugins for those that have been registered as custom formats but not added to the list.


◆ isPluginDisabled()

virtual bool tracktion::engine::EngineBehaviour::isPluginDisabled ( const juce::String &  )
virtual

Should return if the given plugin is disabled or not.

ExternalPlugins will use this to determine if they should load themselves or not. This can be called often so should be quick to execute.

◆ setPluginDisabled()

virtual void tracktion::engine::EngineBehaviour::setPluginDisabled ( const juce::String &  ,
bool   
)
virtual

Should implement a way of saving if plugin is disabled or not.

N.B. only in use for ExternalPlugins at the moment.

◆ shouldLoadPlugin()

virtual bool tracktion::engine::EngineBehaviour::shouldLoadPlugin ( ExternalPlugin p)
virtual

Should the plugin be loaded.

Normally plugins aren't loaded when Edit is for exporting or examining. Override this if you always need a plugin loaded

◆ doAdditionalInitialisation()

virtual void tracktion::engine::EngineBehaviour::doAdditionalInitialisation ( ExternalPlugin )
virtual

Gives the host a chance to do any extra configuration after a plugin is loaded.

◆ getReferencedItems()

virtual juce::Array<Exportable::ReferencedItem> tracktion::engine::EngineBehaviour::getReferencedItems ( ExternalPlugin )
virtual

If you have any special VST plugins that access items in the Edit, you need to return them.

◆ reassignReferencedItem()

virtual void tracktion::engine::EngineBehaviour::reassignReferencedItem ( ExternalPlugin ,
const Exportable::ReferencedItem ,
ProjectItemID  ,
double   
)
virtual

If you have any special VST plugins that access items in the Edit, you need to reassign them.

◆ shouldBypassedPluginsBeRemovedFromPlaybackGraph()

virtual bool tracktion::engine::EngineBehaviour::shouldBypassedPluginsBeRemovedFromPlaybackGraph ( )
virtual

Should return if plugins which have been bypassed should be included in the playback graph.

By default this is false and bypassed plugins will still call processBypassed and introduce the same latency as if they weren't. But by returning false here, you can opt to remove them from the playback graph entirely which means they won't introduce latency which can be useful for tracking.

◆ shouldProcessAuxSendWhenTrackIsMuted()

virtual bool tracktion::engine::EngineBehaviour::shouldProcessAuxSendWhenTrackIsMuted ( AuxSendPlugin )
virtual

Whether or not to include muted track contents in aux send plugins.

Returning true here enables you to still listen to return busses when send tracks are muted or other tracks are soloed.

◆ saveCustomPluginProperties()

virtual void tracktion::engine::EngineBehaviour::saveCustomPluginProperties ( juce::ValueTree &  ,
juce::AudioPluginInstance &  ,
juce::UndoManager *   
)
virtual

Gives plugins an opportunity to save custom data when the plugin state gets flushed.

◆ canScanPluginsOutOfProcess()

virtual bool tracktion::engine::EngineBehaviour::canScanPluginsOutOfProcess ( )
virtual

Return true if your application supports scanning plugins out of process.

If you want to support scanning out of process, the allowing should be added to you JUCEApplication::initialise() function:

void initialise (const juce::String& commandLine) override { if (PluginManager::startChildProcessPluginScan (commandLine)) return;

continue like normal

◆ autoInitialiseDeviceManager()

virtual bool tracktion::engine::EngineBehaviour::autoInitialiseDeviceManager ( )
virtual

You may want to disable auto initialisation of the device manager if you are using the engine in a plugin.

◆ addSystemAudioIODeviceTypes()

virtual bool tracktion::engine::EngineBehaviour::addSystemAudioIODeviceTypes ( )
virtual

In plugin builds, you might want to avoid adding the system audio devices and only use the host inputs.

◆ getMiddleCOctave()

virtual int tracktion::engine::EngineBehaviour::getMiddleCOctave ( )
virtual

◆ setMiddleCOctave()

virtual void tracktion::engine::EngineBehaviour::setMiddleCOctave ( int  )
virtual

◆ getDefaultNoteColour()

virtual int tracktion::engine::EngineBehaviour::getDefaultNoteColour ( )
virtual

◆ editHasBeenSaved()

virtual void tracktion::engine::EngineBehaviour::editHasBeenSaved ( Edit ,
juce::File   
)
virtual

◆ isMidiDriverUsedForIncommingMessageTiming()

virtual bool tracktion::engine::EngineBehaviour::isMidiDriverUsedForIncommingMessageTiming ( )
virtual

Should return true if the incoming timestamp for MIDI messages should be used.

If this returns false, the current system time will be used (which could be less accurate). N.B. this is called from multiple threads, including the MIDI thread for every incoming message so should be thread safe and quick to return.

◆ setMidiDriverUsedForIncommingMessageTiming()

virtual void tracktion::engine::EngineBehaviour::setMidiDriverUsedForIncommingMessageTiming ( bool  )
virtual

◆ shouldPlayMidiGuideNotes()

virtual bool tracktion::engine::EngineBehaviour::shouldPlayMidiGuideNotes ( )
virtual

◆ getNumberOfCPUsToUseForAudio()

virtual int tracktion::engine::EngineBehaviour::getNumberOfCPUsToUseForAudio ( )
virtual

◆ shouldProcessMutedTracks()

virtual bool tracktion::engine::EngineBehaviour::shouldProcessMutedTracks ( )
virtual

Should muted tracks processing be disabled to save CPU.

Referenced by tracktion::engine::AudioTrack::processAudioNodesWhileMuted().

◆ monitorAudioInputsWithoutRecordEnable()

virtual bool tracktion::engine::EngineBehaviour::monitorAudioInputsWithoutRecordEnable ( )
virtual

Should audio inputs be audible when monitor-enabled but not record enabled.


◆ areAudioClipsRemappedWhenTempoChanges()

virtual bool tracktion::engine::EngineBehaviour::areAudioClipsRemappedWhenTempoChanges ( )
virtual

◆ setAudioClipsRemappedWhenTempoChanges()

virtual void tracktion::engine::EngineBehaviour::setAudioClipsRemappedWhenTempoChanges ( bool  )
virtual

◆ areAutoTempoClipsRemappedWhenTempoChanges()

virtual bool tracktion::engine::EngineBehaviour::areAutoTempoClipsRemappedWhenTempoChanges ( )
virtual

◆ setAutoTempoClipsRemappedWhenTempoChanges()

virtual void tracktion::engine::EngineBehaviour::setAutoTempoClipsRemappedWhenTempoChanges ( bool  )
virtual

◆ areMidiClipsRemappedWhenTempoChanges()

virtual bool tracktion::engine::EngineBehaviour::areMidiClipsRemappedWhenTempoChanges ( )
virtual

◆ setMidiClipsRemappedWhenTempoChanges()

virtual void tracktion::engine::EngineBehaviour::setMidiClipsRemappedWhenTempoChanges ( bool  )
virtual

◆ arePluginsRemappedWhenTempoChanges()

virtual bool tracktion::engine::EngineBehaviour::arePluginsRemappedWhenTempoChanges ( )
virtual

◆ setPluginsRemappedWhenTempoChanges()

virtual void tracktion::engine::EngineBehaviour::setPluginsRemappedWhenTempoChanges ( bool  )
virtual

◆ getEditLimits()

virtual EditLimits tracktion::engine::EngineBehaviour::getEditLimits ( )
virtual

Should return the maximum number of elements that can be added to an Edit.

◆ lengthOfOneBeatDependsOnTimeSignature()

virtual bool tracktion::engine::EngineBehaviour::lengthOfOneBeatDependsOnTimeSignature ( )
virtual

If this returns true, it means that the length (in seconds) of one "beat" at any point in an edit is considered to be the length of one division in the current bar's time signature.

So for example at 120BPM, in a bar of 4/4, one beat would be the length of a quarter-note (0.5s), but in a bar of 4/8, one beat would be the length of an eighth-note (0.25s)

If false, then the length of one beat always depends only the current BPM at that point in the edit, so where the BPM = 120, one beat is always 0.5s, regardless of the time-sig.

You shouldn't dynamically change this function's return value - just implement a function that always returns true or false.

◆ getLevelMeterSettings()

virtual LevelMeterSettings tracktion::engine::EngineBehaviour::getLevelMeterSettings ( )
virtual

◆ setLevelMeterSettings()

virtual void tracktion::engine::EngineBehaviour::setLevelMeterSettings ( LevelMeterSettings  )
virtual

◆ setProcessPriority()

virtual void tracktion::engine::EngineBehaviour::setProcessPriority ( int  )
virtual

◆ isDescriptionOfWaveDevicesSupported()

virtual bool tracktion::engine::EngineBehaviour::isDescriptionOfWaveDevicesSupported ( )
virtual

If this returns true, you must implement describeWaveDevices to determine the wave devices for a given device.

If it's false, a standard, stereo pair layout will be automatically generated.

◆ describeWaveDevices()

virtual void tracktion::engine::EngineBehaviour::describeWaveDevices ( std::vector< WaveDeviceDescription > &  ,
juce::AudioIODevice &  ,
bool   
)
virtual

If isDescriptionOfWaveDevicesSupported returns true, this should be implemented to describe the wave devices for a given audio device.

◆ createPlaybackMidiSequence()

virtual juce::MidiMessageSequence tracktion::engine::EngineBehaviour::createPlaybackMidiSequence ( const MidiList list,
MidiClip clip,
MidiList::TimeBase  tb,
bool  generateMPE 
)
virtual

Called by the MidiList to create a MidiMessageSequence for playback.

You can override this to add your own messages but should generally follow the procedure in MidiList::createDefaultPlaybackMidiSequence.

References tracktion::engine::MidiList::createDefaultPlaybackMidiSequence().

◆ getDefaultLoopedSequenceType()

virtual int tracktion::engine::EngineBehaviour::getDefaultLoopedSequenceType ( )
virtual

Must return the default looped sequence type to use.

Current options are: 0: loopRangeDefinesAllRepetitions // The looped sequence is the same for all repetitions including the first. 1: loopRangeDefinesSubsequentRepetitions // The first section is the whole sequence, subsequent repitions are determined by the loop range.

◆ autoAddClipEdgeFades()

virtual bool tracktion::engine::EngineBehaviour::autoAddClipEdgeFades ( )
virtual

If this returns true, it means that newly inserted clips will automatically have a fade-in and fade-out of 3ms applied.

◆ getClipDefaults()

virtual ClipDefaults tracktion::engine::EngineBehaviour::getClipDefaults ( )
virtual

Returns the defaults to be applied to new clips.

◆ newClipAdded()

virtual void tracktion::engine::EngineBehaviour::newClipAdded ( Clip ,
[[ maybe_unused ] ] bool  fromRecording 
)
virtual

Returns the defaults to be applied to new clips.

◆ getDesiredControlSurfaces()

virtual ControlSurfaces tracktion::engine::EngineBehaviour::getDesiredControlSurfaces ( )
virtual

Return the control surfaces you want enabled in the engine.

◆ getCustomControlSurfaceForXML()

virtual ControlSurface* tracktion::engine::EngineBehaviour::getCustomControlSurfaceForXML ( ExternalControllerManager ,
const juce::XmlElement &   
)
virtual

Restore a custom control surface from custom XML.


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