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

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_engine_playback.cpp
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#if ! JUCE_PROJUCER_LIVE_BUILD
12
13#include "3rd_party/magic_enum/tracktion_magic_enum.hpp"
14
15#include <shared_mutex>
16
17#if TRACKTION_ENABLE_ABLETON_LINK
19
20 // Ableton Link has to be included here before ReWire as ReWire seems to mess with some Windows defs
21 #if (JUCE_WINDOWS || JUCE_MAC || JUCE_LINUX || JUCE_ANDROID)
22 #if JUCE_MAC
23 #define LINK_PLATFORM_MACOSX 1
24 #endif
25
26 #if JUCE_WINDOWS
27 #define LINK_PLATFORM_WINDOWS 1
28 #endif
29
30 #if JUCE_LINUX || JUCE_ANDROID
31 #define LINK_PLATFORM_LINUX 1
32 #endif
33
34 //==========================================================================
35 // To use Link on desktop and Android, grab the open source repo from github
36 // and add these folders to your project's header search paths:
37 // [relative path from project]/AbletonLink/include
38 // [relative path from project]/AbletonLink/modules/asio-standalone/asio/include
39 //
40 // If you're building on Android, you will also need the ifaddrs header and source
41 // from here: https://github.com/libpd/abl_link/tree/master/external/android-ifaddrs
42 // Add the folder they are in to your header search paths also.
43
44 #if JUCE_CLANG // TODO: Ignore conversion errors on Windows too
45 #pragma clang diagnostic push
46 #pragma clang diagnostic ignored "-Wconversion"
47 #pragma clang diagnostic ignored "-Wshadow"
48 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
49 #endif
50
51 #if JUCE_ANDROID
52 #include <ifaddrs.h>
53 #endif
54
55 #include "../3rd_party/choc/platform/choc_DisableAllWarnings.h"
56 #include <ableton/Link.hpp>
57 #include <ableton/link/HostTimeFilter.hpp>
58 #include "../3rd_party/choc/platform/choc_ReenableAllWarnings.h"
59
60 #if JUCE_ANDROID
61 #include <ifaddrs.cpp>
62 #endif
63
64 #if JUCE_CLANG
65 #pragma clang diagnostic pop
66 #endif
67
68 #undef NOMINMAX
69#endif
70#endif
71
72#if TRACKTION_ENABLE_REWIRE
73extern "C"
74{
75 #define Button CarbonButton
76 #define Component CarbonComponent
77 #define MemoryBlock CarbonMemoryBlock
78
79 #if MAC
80 #pragma clang diagnostic push
81 #pragma clang diagnostic ignored "-Wdeprecated"
82 #pragma clang diagnostic ignored "-Wconversion"
83 #endif
84
85 #include "ReWire/ReWireSDK/ReWire.c"
86 #include "ReWire/ReWireSDK/ReWireAPI.c"
87 #include "ReWire/ReWireSDK/ReWireDeviceAPI.c"
88
89 #if MAC
90 #pragma clang diagnostic pop
91 #endif
92
93 #undef Button
94 #undef Component
95 #undef MemoryBlock
96 #undef check
97}
98#endif
99
100#define JUCE_CORE_INCLUDE_JNI_HELPERS 1 // Required for Ableton Link on Android
101
102#ifdef __GNUC__
103 #pragma GCC diagnostic push
104 #pragma GCC diagnostic ignored "-Wfloat-equal"
105#endif
106
107//==============================================================================
108//==============================================================================
110
112
116
117//==============================================================================
118//==============================================================================
119#include "tracktion_engine.h"
120
121
122//==============================================================================
123//==============================================================================
124#undef VERSION
125#define PACKAGE ""
126#define VERSION "0.2.2"
127#define CPU_CLIPS_NEGATIVE 0
128#define CPU_CLIPS_POSITIVE 0
129
130#define ENABLE_SINC_BEST_CONVERTER
131#define ENABLE_SINC_MEDIUM_CONVERTER
132#define ENABLE_SINC_FAST_CONVERTER
133
134#include "../3rd_party/choc/platform/choc_DisableAllWarnings.h"
135
136#if __GNUC__
137 #pragma GCC diagnostic ignored "-Wpedantic"
138#endif
139
140namespace tracktion
141{
142 namespace src
143 {
144 #include "../3rd_party/libsamplerate/samplerate.h"
145 #include "../3rd_party/libsamplerate/src_linear.c"
146 #include "../3rd_party/libsamplerate/src_sinc.c"
147 #include "../3rd_party/libsamplerate/src_zoh.c"
148 #include "../3rd_party/libsamplerate/samplerate.c"
149 }
150}
151
152#undef PACKAGE
153#undef VERSION
154#undef CPU_CLIPS_NEGATIVE
155#undef CPU_CLIPS_POSITIVE
156
157#undef ENABLE_SINC_BEST_CONVERTER
158#undef ENABLE_SINC_MEDIUM_CONVERTER
159#undef ENABLE_SINC_FAST_CONVERTER
160
161#include "../3rd_party/choc/platform/choc_ReenableAllWarnings.h"
162#include "../3rd_party/crill/seqlock_object.h"
163
164//==============================================================================
165#if JUCE_LINUX || JUCE_WINDOWS
166 #include <cstdarg>
167#endif
168
169#include <thread>
170using namespace std::literals;
171
173
178
180
200
206
217
230//#include "playback/graph/tracktion_LoopingMidiNode.test.cpp"
235
238//#include "playback/graph/tracktion_RackNode.test.cpp"
241//#include "playback/graph/tracktion_PluginNodeBenchmarks.test.cpp"
243
255
258//#include "playback/graph/tracktion_EditNodeBuilder.test.cpp"
259
262
263//#include "playback/graph/tracktion_NodeRendering.test.cpp"
264
265//#include "playback/graph/tracktion_WaveNode.test.cpp"
266//#include "playback/graph/tracktion_MidiNode.test.cpp"
267//#include "playback/graph/tracktion_RackBenchmarks.test.cpp"
268
274//#include "playback/tracktion_TransportControl.test.cpp"
277
285
290
300
302
303#ifdef JUCE_MSVC
304 #pragma warning (disable: 4996)
305#endif
306
307static inline void sprintf (char* dest, size_t maxLength, const char* format, ...) noexcept
308{
310 va_start (list, format);
311
312 #if JUCE_WINDOWS
313 _vsnprintf (dest, maxLength, format, list);
314 #else
315 vsnprintf (dest, maxLength, format, list);
316 #endif
317}
318
323
324#if TRACKTION_ENABLE_CONTROL_SURFACES
325 #if TRACKTION_ENABLE_CONTROL_SURFACE_MACKIEC4
326 namespace tracktion { inline namespace engine
327 {
328 #include "Mackie/C4Translator.h"
329 #include "Mackie/C4Translator.cpp"
330 }} // namespace tracktion { inline namespace engine
331 #endif
332
333 #include "control_surfaces/types/tracktion_AlphaTrack.cpp"
334 #if TRACKTION_ENABLE_CONTROL_SURFACE_MACKIEC4
335 #include "control_surfaces/types/tracktion_MackieC4.cpp"
336 #endif
337 #include "control_surfaces/types/tracktion_MackieMCU.cpp"
338 #include "control_surfaces/types/tracktion_MackieXT.cpp"
339 #include "control_surfaces/types/tracktion_IconProG2.cpp"
340 #include "control_surfaces/types/tracktion_NovationRemoteSl.cpp"
341 #include "control_surfaces/types/tracktion_RemoteSLCompact.cpp"
342 #include "control_surfaces/types/tracktion_Tranzport.cpp"
343#endif
344
345#if TRACKTION_ENABLE_CONTROL_SURFACES
346 #include "control_surfaces/types/tracktion_NovationAutomap.cpp"
347#endif
348
349#ifdef __GNUC__
350 #pragma GCC diagnostic pop
351#endif
352
353#endif
sprintf
va_start
vsnprintf