tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_EngineBehaviour.h
Go to the documentation of this file.
1 /*
2 ,--. ,--. ,--. ,--.
3 ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2024
4 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software
5 | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation
6 `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com
7
8 Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details.
9*/
10
11namespace tracktion { inline namespace engine
12{
13
19{
20 int maxNumTracks = 400;
21 int maxClipsInTrack = 1500;
25};
26
32{
33public:
34 EngineBehaviour() = default;
35 virtual ~EngineBehaviour() = default;
36
37 //==============================================================================
38 virtual juce::ReferenceCountedObjectPtr<RackType> createPresetRackType (int /*index*/, Edit&) { return {}; }
39
42
45
50 virtual bool isPluginDisabled (const juce::String& /*idString*/) { return false; }
51
55 virtual void setPluginDisabled (const juce::String& /*idString*/, bool /*shouldBeDisabled*/) {}
56
60 virtual bool shouldLoadPlugin (ExternalPlugin& p);
61
64
67
70
73
76
83 virtual bool shouldBypassedPluginsBeRemovedFromPlaybackGraph() { return false; }
84
89 virtual bool shouldProcessAuxSendWhenTrackIsMuted (AuxSendPlugin&) { return true; }
90
94 virtual bool areClipSlotsEnabled() { return true; }
95
99 virtual bool enableReadAheadForTimeStretchNodes() { return false; }
100
103
117 virtual bool canScanPluginsOutOfProcess() { return false; }
118
122 virtual bool autoInitialiseDeviceManager() { return true; }
123
127 virtual bool addSystemAudioIODeviceTypes() { return true; }
128
129 // some debate surrounds whether middle-C is C3, C4 or C5. In Tracktion we
130 // default this value to 4
131 virtual int getMiddleCOctave() { return 4; }
132 virtual void setMiddleCOctave (int /*newOctave*/) {}
133
134 // Default colour for notes. How this index maps to an actual colour is host dependant.
135 // Waveform uses yellow, green, blue, purple, red, auto (based on key)
136 virtual int getDefaultNoteColour() { return 0; }
137
138 // Notifies the host application that an edit has just been saved
139 virtual void editHasBeenSaved (Edit& /*edit*/, juce::File /*path*/) {}
140
141 //==============================================================================
147 virtual bool isMidiDriverUsedForIncommingMessageTiming() { return true; }
148 virtual void setMidiDriverUsedForIncommingMessageTiming (bool) {}
149
150 virtual bool shouldPlayMidiGuideNotes() { return false; }
151
152 virtual bool ignoreBWavTimestamps() { return false; }
153
154 virtual int getNumberOfCPUsToUseForAudio() { return juce::jmax (1, juce::SystemStats::getNumCpus()); }
155
157 virtual bool shouldProcessMutedTracks() { return false; }
158
160 virtual bool muteTrackContentsWhilstRecording() { return false; }
161
162 virtual bool areAudioClipsRemappedWhenTempoChanges() { return true; }
163 virtual void setAudioClipsRemappedWhenTempoChanges (bool) {}
164 virtual bool areAutoTempoClipsRemappedWhenTempoChanges() { return true; }
165 virtual void setAutoTempoClipsRemappedWhenTempoChanges (bool) {}
166 virtual bool areMidiClipsRemappedWhenTempoChanges() { return true; }
167 virtual void setMidiClipsRemappedWhenTempoChanges (bool) {}
168 virtual bool arePluginsRemappedWhenTempoChanges() { return true; }
169 virtual void setPluginsRemappedWhenTempoChanges (bool) {}
170
172 virtual EditLimits getEditLimits() { return {}; }
173
188 virtual bool lengthOfOneBeatDependsOnTimeSignature() { return true; }
189
191 {
192 int maxPeakAgeMs = 2000;
193 float decaySpeed = 48.0f;
194 };
195
196 virtual LevelMeterSettings getLevelMeterSettings() { return {}; }
197 virtual void setLevelMeterSettings (LevelMeterSettings) {}
198
199 // 0 = normal, 1 = high, 2 = realtime
200 virtual void setProcessPriority (int /*level*/) {}
201
205 virtual bool isDescriptionOfWaveDevicesSupported() { return false; }
206
211
212 //==============================================================================
218 {
219 return MidiList::createDefaultPlaybackMidiSequence (list, clip, tb, generateMPE);
220 }
221
228 virtual int getDefaultLoopedSequenceType() { return 0; }
229
231 virtual bool autoAddClipEdgeFades() { return false; }
232
234 virtual bool interpolateAutomation() { return true; }
235
242
244 virtual ClipDefaults getClipDefaults() { return {}; }
245
247 virtual void newClipAdded (Clip&, [[ maybe_unused ]] bool fromRecording) {}
248
250 {
251 bool mackieMCU = true;
252 bool mackieC4 = true;
253 bool iconProG2 = true;
254 bool tranzport = true;
255 bool alphaTrack = true;
256 bool remoteSL = true;
257 bool remoteSLCompact = true;
258 bool automap = true;
259 };
260
263
269};
270
271}} // namespace tracktion { inline namespace engine
static int getNumCpus() noexcept
A clip in an edit.
Base class for types of control surface.
The Tracktion Edit class!
Provides custom handlers to control various aspects of the engine's behaviour.
virtual bool isPluginDisabled(const juce::String &)
Should return if the given plugin is disabled or not.
virtual void reassignReferencedItem(Clip &, const Exportable::ReferencedItem &, ProjectItemID, double)
If you have any special plugins that access items in the Edit, you need to reassign them.
virtual bool areClipSlotsEnabled()
If this returns false, ClipSlot Clips won't be included in the playback graph and arranger track clip...
virtual bool shouldLoadPlugin(ExternalPlugin &p)
Should the plugin be loaded.
virtual EditLimits getEditLimits()
Should return the maximum number of elements that can be added to an Edit.
virtual bool isMidiDriverUsedForIncommingMessageTiming()
Should return true if the incoming timestamp for MIDI messages should be used.
virtual juce::Array< Exportable::ReferencedItem > getReferencedItems(ExternalPlugin &)
If you have any special plugins that access items in the Edit, you need to return them.
virtual bool shouldProcessAuxSendWhenTrackIsMuted(AuxSendPlugin &)
Whether or not to include muted track contents in aux send plugins.
virtual Plugin::Ptr createCustomPlugin(PluginCreationInfo)
This will be called if the PluginManager doesn't know how to create a Plugin for the given info.
virtual ControlSurface * getCustomControlSurfaceForXML(ExternalControllerManager &, const juce::XmlElement &)
Restore a custom control surface from custom XML.
virtual bool canScanPluginsOutOfProcess()
Return true if your application supports scanning plugins out of process.
virtual bool interpolateAutomation()
Interpolate automation at 10ms intervals (faster) or calculate actual value (slower)
virtual bool enableReadAheadForTimeStretchNodes()
TEMPORARY: If enabled, real-time time-stretch Nodes will use a larger buffer and background thread to...
virtual bool lengthOfOneBeatDependsOnTimeSignature()
If this returns true, it means that the length (in seconds) of one "beat" at any point in an edit is ...
virtual bool isDescriptionOfWaveDevicesSupported()
If this returns true, you must implement describeWaveDevices to determine the wave devices for a give...
virtual void setPluginDisabled(const juce::String &, bool)
Should implement a way of saving if plugin is disabled or not.
virtual bool autoInitialiseDeviceManager()
You may want to disable auto initialisation of the device manager if you are using the engine in a pl...
virtual ControlSurfaces getDesiredControlSurfaces()
Return the control surfaces you want enabled in the engine.
virtual bool shouldProcessMutedTracks()
Should muted tracks processing be disabled to save CPU.
virtual void saveCustomPluginProperties(juce::ValueTree &, juce::AudioPluginInstance &, juce::UndoManager *)
Gives plugins an opportunity to save custom data when the plugin state gets flushed.
virtual bool muteTrackContentsWhilstRecording()
Should track contents be audible whilst a recording is in progress.
virtual void newClipAdded(Clip &, bool fromRecording)
Returns the defaults to be applied to new clips.
virtual juce::Array< Exportable::ReferencedItem > getReferencedItems(Clip &)
If you have any special clips that access items in the Edit, you need to return them.
virtual void reassignReferencedItem(ExternalPlugin &, const Exportable::ReferencedItem &, ProjectItemID, double)
If you have any special clips that access items in the Edit, you need to reassign them.
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...
virtual bool shouldBypassedPluginsBeRemovedFromPlaybackGraph()
Should return if plugins which have been bypassed should be included in the playback graph.
virtual int getDefaultLoopedSequenceType()
Must return the default looped sequence type to use.
virtual bool addSystemAudioIODeviceTypes()
In plugin builds, you might want to avoid adding the system audio devices and only use the host input...
virtual juce::MidiMessageSequence createPlaybackMidiSequence(const MidiList &list, MidiClip &clip, MidiList::TimeBase tb, bool generateMPE)
Called by the MidiList to create a MidiMessageSequence for playback.
virtual ClipDefaults getClipDefaults()
Returns the defaults to be applied to new clips.
virtual bool autoAddClipEdgeFades()
If this returns true, it means that newly inserted clips will automatically have a fade-in and fade-o...
virtual void doAdditionalInitialisation(ExternalPlugin &)
Gives the host a chance to do any extra configuration after a plugin is loaded.
virtual void describeWaveDevices(std::vector< WaveDeviceDescription > &, juce::AudioIODevice &, bool)
If isDescriptionOfWaveDevicesSupported returns true, this should be implemented to describe the wave ...
Determines the default properties of clips.
Keeps a list of external controllers and keeps them connected to the right MIDI in/out devices.
TimeBase
Determines MIDI event timing.
static juce::MidiMessageSequence createDefaultPlaybackMidiSequence(const MidiList &, MidiClip &, TimeBase, bool generateMPE)
Creates the default MIDI playback sequence.
An ID representing one of the items in a Project.
constexpr Type jmax(Type a, Type b)
int maxPluginsOnTrack
The maximum number of Plugin[s] a Track can contain.
ResamplingQuality
Specifies a number of resampling qualities that can be used.
@ lagrange
Lagrange interpolation.
int maxPluginsOnClip
The maximum number of Plugin[s] a Clip can contain.
int maxNumMasterPlugins
The maximum number of master Plugin[s] and Edit can contain.
int maxNumTracks
The maximum number of Track[s] an Edit can contain.
int maxClipsInTrack
The maximum number of Clip[s] a Track can contain.
Contains the limits of the various elements that can be added to an Edit.