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

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_engine.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
11/*******************************************************************************
12 The block below describes the properties of this module, and is read by
13 the Projucer to automatically generate project code that uses it.
14 For details about the syntax and how to create or use a module, see the
15 JUCE Module Format.txt file.
16
17
18 BEGIN_JUCE_MODULE_DECLARATION
19
20 ID: tracktion_engine
21 vendor: Tracktion Corporation
22 version: 3.0.0
23 name: The Tracktion audio engine
24 description: Classes for manipulating and playing Tracktion projects
25 website: http://www.tracktion.com
26 license: Proprietary
27
28 dependencies: juce_audio_devices juce_audio_utils juce_dsp juce_osc, juce_gui_extra tracktion_graph
29
30 END_JUCE_MODULE_DECLARATION
31
32*******************************************************************************/
33
34#pragma once
35#define TRACKTION_ENGINE_H_INCLUDED
36
37#if ! JUCE_PROJUCER_LIVE_BUILD
38
39#include <memory>
40#include <map>
41#include <set>
42#include <unordered_set>
43#include <unordered_map>
44#include <atomic>
45#include <random>
46#include <optional>
47#include <variant>
48#include <any>
49#include <shared_mutex>
50#include <span>
51
54#include <juce_dsp/juce_dsp.h>
55#include <juce_osc/juce_osc.h>
57
58#if __has_include(<choc/audio/choc_SampleBuffers.h>)
59 #include <choc/audio/choc_SampleBuffers.h>
60 #include <choc/audio/choc_MIDI.h>
61 #include <choc/containers/choc_SingleReaderSingleWriterFIFO.h>
62 #include <choc/containers/choc_NonAllocatingStableSort.h>
63#else
64 #include "../3rd_party/choc/audio/choc_SampleBuffers.h"
65 #include "../3rd_party/choc/audio/choc_MIDI.h"
66 #include "../3rd_party/choc/containers/choc_SingleReaderSingleWriterFIFO.h"
67 #include "../3rd_party/choc/containers/choc_NonAllocatingStableSort.h"
68#endif
69
70#include "../3rd_party/expected/expected.hpp"
71
72#undef __TEXT
73
77#ifndef TRACKTION_ENABLE_SINGLETONS
78 #define TRACKTION_ENABLE_SINGLETONS 0
79#endif
80
85#ifndef TRACKTION_ENABLE_ARA
86 #define TRACKTION_ENABLE_ARA 0
87#endif
88
94#ifndef TRACKTION_ENABLE_CMAJOR
95 #define TRACKTION_ENABLE_CMAJOR 0
96#endif
97
101#ifndef TRACKTION_ENABLE_REWIRE
102 #define TRACKTION_ENABLE_REWIRE 0
103#endif
104
108#ifndef TRACKTION_ENABLE_AUTOMAP
109 #define TRACKTION_ENABLE_AUTOMAP 0
110#endif
111
115#ifndef TRACKTION_ENABLE_VIDEO
116 #define TRACKTION_ENABLE_VIDEO 0
117#endif
118
122#ifndef TRACKTION_ENABLE_REX
123 #define TRACKTION_ENABLE_REX 0
124#endif
125
129#ifndef TRACKTION_ENABLE_CONTROL_SURFACES
130 #define TRACKTION_ENABLE_CONTROL_SURFACES 0
131#endif
132
137#ifndef TRACKTION_ENABLE_CONTROL_SURFACE_MACKIEC4
138 #define TRACKTION_ENABLE_CONTROL_SURFACE_MACKIEC4 0
139#endif
140
145#ifndef TRACKTION_ENABLE_TIMESTRETCH_ELASTIQUE
146 #define TRACKTION_ENABLE_TIMESTRETCH_ELASTIQUE 0
147#endif
148
154#ifndef TRACKTION_ENABLE_TIMESTRETCH_ELASTIQUE_IPP
155 #define TRACKTION_ENABLE_TIMESTRETCH_ELASTIQUE_IPP TRACKTION_ENABLE_TIMESTRETCH_ELASTIQUE
156#endif
157
167#ifndef TRACKTION_ENABLE_TIMESTRETCH_RUBBERBAND
168 #define TRACKTION_ENABLE_TIMESTRETCH_RUBBERBAND 0
169#endif
170
183#ifndef TRACKTION_BUILD_RUBBERBAND
184 #define TRACKTION_BUILD_RUBBERBAND 0
185#endif
186
190#ifndef TRACKTION_ENABLE_TIMESTRETCH_SOUNDTOUCH
191 #define TRACKTION_ENABLE_TIMESTRETCH_SOUNDTOUCH 0
192#endif
193
198#ifndef TRACKTION_ENABLE_ABLETON_LINK
199 #define TRACKTION_ENABLE_ABLETON_LINK 0
200#endif
201
205#ifndef TRACKTION_ENABLE_FFMPEG
206 #define TRACKTION_ENABLE_FFMPEG 0
207#endif
208
213#ifndef TRACKTION_UNIT_TESTS
214 #define TRACKTION_UNIT_TESTS 0
215#endif
216
221#ifndef TRACKTION_BENCHMARKS
222 #define TRACKTION_BENCHMARKS 0
223#endif
224
228#ifndef TRACKTION_CHECK_FOR_SLOW_RENDERING
229 #define TRACKTION_CHECK_FOR_SLOW_RENDERING 0
230#endif
231
235#ifndef TRACKTION_AIR_WINDOWS
236 #define TRACKTION_AIR_WINDOWS 0
237#endif
238
243#ifndef TRACKTION_LOG_DEVICES
244 #define TRACKTION_LOG_DEVICES 1
245#endif
246
247
248//==============================================================================
249#ifndef TRACKTION_LOG_ENABLED
250 #define TRACKTION_LOG_ENABLED 1
251#endif
252
253#if TRACKTION_LOG_ENABLED
254namespace Ase {
255 void trkn_tracktion_log_msg (const juce::String&);
256 void trkn_tracktion_log_error (const juce::String&);
257} // Ase
258 #define TRACKTION_LOG(a) Ase::trkn_tracktion_log_msg (a)
259 #define TRACKTION_LOG_ERROR(a) Ase::trkn_tracktion_log_error (a)
260// #define TRACKTION_LOG(a) juce::Logger::writeToLog(a)
261// #define TRACKTION_LOG_ERROR(a) juce::Logger::writeToLog (juce::String ("*** ERROR: ") + a);
262#else
263 #define TRACKTION_LOG(a) {}
264 #define TRACKTION_LOG_ERROR(a) {}
265#endif
266
267//==============================================================================
268#define TRACKTION_ASSERT_MESSAGE_THREAD \
269 jassert (juce::MessageManager::getInstance()->currentThreadHasLockedMessageManager());
270
271//==============================================================================
272namespace tracktion { inline namespace graph
273{
274 class PlayHead;
275}}
276
277//==============================================================================
278#include "../tracktion_core/tracktion_core.h"
279
280
281//==============================================================================
282namespace tracktion { inline namespace engine
283{
284 class EngineBehaviour;
285 class Engine;
286 class DeviceManager;
287 class GrooveTemplateManager;
288 class Edit;
289 class Track;
290 class Clip;
291 class ClipOwner;
292 class Plugin;
293 struct PluginRenderContext;
294 class AudioFile;
295 class Project;
296 class InputDevice;
297 class OutputDevice;
298 class WaveInputDevice;
299 class MidiInputDevice;
300 class FolderTrack;
301 class ClipTrack;
302 class AutomationTrack;
303 class ArrangerTrack;
304 class ChordTrack;
305 class MarkerTrack;
306 class MasterTrack;
307 class TempoTrack;
308 struct TrackInsertPoint;
309 struct TrackList;
310 class TrackCompManager;
311 class CompFactory;
312 class WarpTimeFactory;
313 class TempoSequence;
314 class WarpTimeManager;
315 class ControlSurface;
316 struct AudioFileInfo;
317 class LoopInfo;
318 class RenderOptions;
319 class AutomatableParameter;
320 class MacroParameterList;
321 class MelodyneFileReader;
322 struct ARADocumentHolder;
323 class ClipEffects;
324 class WaveAudioClip;
325 class CollectionClip;
326 class MidiClip;
327 class EditClip;
328 class MidiList;
329 class MarkerManager;
330 class TransportControl;
331 class AbletonLink;
332 class ParameterControlMappings;
333 class ParameterChangeHandler;
334 class AutomationRecordManager;
335 class RenderManager;
336 class EditPlaybackContext;
337 class EditInputDevices;
338 class InputDeviceInstance;
339 class GrooveTemplate;
340 class MidiOutputDevice;
341 class LevelMeterPlugin;
342 class VolumeAndPanPlugin;
343 class VCAPlugin;
344 class NovationAutomap;
345 class ExternalController;
346 class EditInsertPoint;
347 class AudioFileManager;
348 class AudioClipBase;
349 class AudioTrack;
350 class PluginList;
351 class RackType;
352 class RackInstance;
353 class MidiControllerParser;
354 class MidiInputDeviceInstanceBase;
355 struct RetrospectiveMidiBuffer;
356 class MidiLearnState;
357 struct EditDeleter;
358 struct ActiveEdits;
359 class AudioFileFormatManager;
360 class AutomatableEditItem;
361 class RecordingThumbnailManager;
362 class WaveInputRecordingThread;
363 class ProjectManager;
364 class ExternalAutomatableParameter;
365 class PitchShiftPlugin;
366 struct PluginUnloadInhibitor;
367 class ChordClip;
368 struct TimecodeSnapType;
369 class MidiNote;
370 class AutomationCurveSource;
371 struct Modifier;
372 class MidiTimecodeGenerator;
373 class MidiClockGenerator;
374 class MidiOutputDeviceInstance;
375 class WaveInputDeviceInstance;
376 class WaveOutputDeviceInstance;
377 struct RetrospectiveRecordBuffer;
378 class Clipboard;
379 class PropertyStorage;
380 class ClipSlotList;
381 class ClipSlot;
382 class LaunchHandle;
383 class LaunchQuantisation;
384 class BufferedAudioFileManager;
385}} // namespace tracktion { inline namespace engine
386
387#include <trkn/tracktion_decls.hh> // Forward Decls for Ase
388
389#ifdef __GNUC__
390 #pragma GCC diagnostic push
391 #pragma GCC diagnostic ignored "-Wfloat-equal"
392#endif
393
394//==============================================================================
395#include "../tracktion_graph/utilities/tracktion_PerformanceMeasurement.h"
396
397//==============================================================================
431
433
435
436//==============================================================================
451
453
455
458#include "../tracktion_graph/utilities/tracktion_MidiMessageArray.h"
460
467
472
477
481
483
486
494
509
512
515
522
525
532
534
544
546
550
552
557
561
567
569
584
588
590
602
604
612
614
616
617#if JUCE_ANDROID
618 #include "playback/tracktion_ScopedSteadyLoad.h"
619#endif
620
626
627#if TRACKTION_AIR_WINDOWS
628#include "plugins/airwindows/tracktion_AirWindows.h"
629#endif
630
636
652
654
656
657#if TRACKTION_ENABLE_CONTROL_SURFACES
658 #include "control_surfaces/types/tracktion_NovationAutomap.h"
659#endif
660
662
663#if TRACKTION_ENABLE_CONTROL_SURFACES
664 #include "control_surfaces/types/tracktion_AlphaTrack.h"
665 #include "control_surfaces/types/tracktion_MackieC4.h"
666 #include "control_surfaces/types/tracktion_MackieMCU.h"
667 #include "control_surfaces/types/tracktion_MackieXT.h"
668 #include "control_surfaces/types/tracktion_IconProG2.h"
669 #include "control_surfaces/types/tracktion_NovationRemoteSl.h"
670 #include "control_surfaces/types/tracktion_RemoteSLCompact.h"
671 #include "control_surfaces/types/tracktion_Tranzport.h"
672#endif
673
675
676#ifdef __GNUC__
677 #pragma GCC diagnostic pop
678#endif
679
680#endif