iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
IPlug_include_in_plug_hdr.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the iPlug 2 library. Copyright (C) the iPlug 2 developers.
5
6 See LICENSE.txt for more info.
7
8 ==============================================================================
9*/
10
11#pragma once
12
20#include <cstdio>
21#include "IPlugPlatform.h"
22#include "config.h"
23
24#define API_EXT2
25#ifdef VST2_API
26 #include "IPlugVST2.h"
27 #define PLUGIN_API_BASE IPlugVST2
28 #define API_EXT "vst"
29#elif defined AU_API
30 #include "IPlugAU.h"
31 #define PLUGIN_API_BASE IPlugAU
32 #define API_EXT "audiounit"
33#elif defined AUv3_API
34 #include "IPlugAUv3.h"
35 #define PLUGIN_API_BASE IPlugAUv3
36 #define API_EXT "app"
37 #undef API_EXT2
38 #define API_EXT2 ".AUv3"
39#elif defined AAX_API
40 #include "IPlugAAX.h"
41 #define PLUGIN_API_BASE IPlugAAX
42 #define API_EXT "aax"
43 #define PROTOOLS
44#elif defined APP_API
45 #include "IPlugAPP.h"
46 #define PLUGIN_API_BASE IPlugAPP
47 #define API_EXT "app"
48#elif defined WAM_API
49 #include "IPlugWAM.h"
50 #define PLUGIN_API_BASE IPlugWAM
51#elif defined WEB_API
52 #include "IPlugWeb.h"
53 #define PLUGIN_API_BASE IPlugWeb
54#elif defined WASM_DSP_API
55 #include "IPlugWasmDSP.h"
56 #define PLUGIN_API_BASE IPlugWasmDSP
57#elif defined WASM_UI_API
58 #include "IPlugWasmUI.h"
59 #define PLUGIN_API_BASE IPlugWasmUI
60#elif defined VST3_API
61 #define IPLUG_VST3
62 #include "IPlugVST3.h"
63 #define PLUGIN_API_BASE IPlugVST3
64 #define API_EXT "vst3"
65#elif defined VST3C_API
66 #define IPLUG_VST3
67 #include "IPlugVST3_Controller.h"
68 #define PLUGIN_API_BASE IPlugVST3Controller
69 #undef PLUG_CLASS_NAME
70 #define PLUG_CLASS_NAME VST3Controller
71 #define API_EXT "vst3"
72#elif defined VST3P_API
73 #define IPLUG_VST3
74 #include "IPlugVST3_Processor.h"
75 #define PLUGIN_API_BASE IPlugVST3Processor
76 #define API_EXT "vst3"
77#elif defined CLAP_API
78 #include "IPlugCLAP.h"
79 #define PLUGIN_API_BASE IPlugCLAP
80 #define API_EXT "clap"
81#else
82 #error "No API defined!"
83#endif
84
85BEGIN_IPLUG_NAMESPACE
86using Plugin = PLUGIN_API_BASE;
87END_IPLUG_NAMESPACE
88
89#ifdef OS_WIN
90 #define EXPORT __declspec(dllexport)
91 #define BUNDLE_ID ""
92 #define APP_GROUP_ID ""
93#elif defined OS_MAC
94 #define BUNDLE_ID BUNDLE_DOMAIN "." BUNDLE_MFR "." API_EXT "." BUNDLE_NAME API_EXT2
95 #if !defined APP_GROUP_ID
96 #define APP_GROUP_ID "group." BUNDLE_DOMAIN "." BUNDLE_MFR "." BUNDLE_NAME
97 #endif
98 #define EXPORT __attribute__ ((visibility("default")))
99#elif defined OS_IOS
100 #define BUNDLE_ID BUNDLE_DOMAIN "." BUNDLE_MFR "." BUNDLE_NAME API_EXT2
101 #if !defined APP_GROUP_ID
102 #define APP_GROUP_ID "group." BUNDLE_DOMAIN "." BUNDLE_MFR "." BUNDLE_NAME
103 #endif
104 #define EXPORT __attribute__ ((visibility("default")))
105#elif defined OS_LINUX
106 //TODO:
107#elif defined OS_WEB
108 #define BUNDLE_ID ""
109 #define APP_GROUP_ID ""
110#else
111 #error "No OS defined!"
112#endif
113
114#if !defined NO_IGRAPHICS && !defined VST3P_API
116#endif
117
118#define STRINGISE_IMPL(x) #x
119#define STRINGISE(x) STRINGISE_IMPL(x)
120
121// Use: #pragma message WARN("My message")
122#if _MSC_VER
123# define FILE_LINE_LINK __FILE__ "(" STRINGISE(__LINE__) ") : "
124# define WARN(exp) (FILE_LINE_LINK "WARNING: " exp)
125#else//__GNUC__ - may need other defines for different compilers
126# define WARN(exp) ("WARNING: " exp)
127#endif
128
129#ifndef PLUG_NAME
130 #error You need to define PLUG_NAME in config.h - The name of your plug-in, with no spaces
131#endif
132
133#ifndef PLUG_MFR
134 #error You need to define PLUG_MFR in config.h - The manufacturer name
135#endif
136
137#ifndef PLUG_TYPE
138 #error You need to define PLUG_TYPE in config.h. 0 = Effect, 1 = Instrument, 2 = MIDI Effect
139#endif
140
141#ifndef PLUG_VERSION_HEX
142 #error You need to define PLUG_VERSION_HEX in config.h - The hexadecimal version number in the form 0xVVVVRRMM: V = version, R = revision, M = minor revision.
143#endif
144
145#ifndef PLUG_UNIQUE_ID
146 #error You need to define PLUG_UNIQUE_ID in config.h - The unique four char ID for your plug-in, e.g. 'IPeF'
147#endif
148
149#ifndef PLUG_MFR_ID
150 #error You need to define PLUG_MFR_ID in config.h - The unique four char ID for your manufacturer, e.g. 'Acme'
151#endif
152
153#ifndef PLUG_CLASS_NAME
154 #error PLUG_CLASS_NAME not defined - this is the name of your main iPlug plug-in class (no spaces allowed)
155#endif
156
157#ifndef BUNDLE_NAME
158 #error BUNDLE_NAME not defined - this is the product name part of the plug-in's bundle ID (used on macOS and iOS)
159#endif
160
161#ifndef BUNDLE_MFR
162 #error BUNDLE_MFR not defined - this is the manufacturer name part of the plug-in's bundle ID (used on macOS and iOS)
163#endif
164
165#ifndef BUNDLE_DOMAIN
166 #error BUNDLE_DOMAIN not defined - this is the domain name part of the plug-in's bundle ID (used on macOS and iOS)
167#endif
168
169#ifndef PLUG_CHANNEL_IO
170 #error PLUG_CHANNEL_IO not defined - you need to specify the input and output configurations of the plug-in e.g. "2-2"
171#endif
172
173#ifndef PLUG_LATENCY
174 #define PLUG_LATENCY 0
175#endif
176
177#ifndef PLUG_DOES_MIDI_IN
178 #pragma message WARN("PLUG_DOES_MIDI_IN not defined, setting to 0")
179 #define PLUG_DOES_MIDI_IN 0
180#endif
181
182#ifndef PLUG_DOES_MIDI_OUT
183 #pragma message WARN("PLUG_DOES_MIDI_OUT not defined, setting to 0")
184 #define PLUG_DOES_MIDI_OUT 0
185#endif
186
187#ifndef PLUG_DOES_MPE
188 #pragma message WARN("PLUG_DOES_MPE not defined, setting to 0")
189 #define PLUG_DOES_MPE 0
190#endif
191
192#ifndef PLUG_DOES_STATE_CHUNKS
193 #pragma message WARN("PLUG_DOES_STATE_CHUNKS not defined, setting to 0")
194 #define PLUG_DOES_STATE_CHUNKS 0
195#endif
196
197#ifndef PLUG_HAS_UI
198 #pragma message WARN("PLUG_HAS_UI not defined, setting to 0")
199 #define PLUG_HAS_UI 0
200#endif
201
202#ifndef PLUG_WIDTH
203 #pragma message WARN("PLUG_WIDTH not defined, setting to 500px")
204 #define PLUG_WIDTH 500
205#endif
206
207#ifndef PLUG_HEIGHT
208 #pragma message WARN("PLUG_HEIGHT not defined, setting to 500px")
209 #define PLUG_HEIGHT 500
210#endif
211
212#ifndef PLUG_MIN_WIDTH
213 #define PLUG_MIN_WIDTH (PLUG_WIDTH / 3)
214#endif
215
216#ifndef PLUG_MIN_HEIGHT
217 #define PLUG_MIN_HEIGHT (PLUG_HEIGHT / 3)
218#endif
219
220#ifndef PLUG_MAX_WIDTH
221 #define PLUG_MAX_WIDTH (PLUG_WIDTH * 3)
222#endif
223
224#ifndef PLUG_MAX_HEIGHT
225 #define PLUG_MAX_HEIGHT (PLUG_HEIGHT * 3)
226#endif
227
228#ifndef PLUG_FPS
229 #pragma message WARN("PLUG_FPS not defined, setting to 60")
230 #define PLUG_FPS 60
231#endif
232
233#ifndef PLUG_SHARED_RESOURCES
234 #pragma message WARN("PLUG_SHARED_RESOURCES not defined, setting to 0")
235 #define PLUG_SHARED_RESOURCES 0
236#else
237 #ifndef SHARED_RESOURCES_SUBPATH
238 #pragma message WARN("SHARED_RESOURCES_SUBPATH not defined, setting to PLUG_NAME")
239 #define SHARED_RESOURCES_SUBPATH PLUG_NAME
240 #endif
241#endif
242
243#ifdef IPLUG_VST3
244 #ifndef PLUG_VERSION_STR
245 #error You need to define PLUG_VERSION_STR in config.h - A string to identify the version number
246 #endif
247
248 #ifndef PLUG_URL_STR
249 #pragma message WARN("PLUG_URL_STR not defined, setting to empty string")
250 #define PLUG_URL_STR ""
251 #endif
252
253 #ifndef PLUG_EMAIL_STR
254 #pragma message WARN("PLUG_EMAIL_STR not defined, setting to empty string")
255 #define PLUG_EMAIL_STR ""
256 #endif
257
258 #ifndef PLUG_COPYRIGHT_STR
259 #pragma message WARN("PLUG_COPYRIGHT_STR not defined, setting to empty string")
260 #define PLUG_COPYRIGHT_STR ""
261 #endif
262
263 #ifndef VST3_SUBCATEGORY
264 #pragma message WARN("VST3_SUBCATEGORY not defined, setting to other")
265 #define VST3_SUBCATEGORY "Other"
266 #endif
267#endif
268
269#ifdef AU_API
270 #ifndef AUV2_ENTRY
271 #error AUV2_ENTRY not defined - the name of the entry point for a component manager AUv2 plug-in, without quotes
272 #endif
273 #ifndef AUV2_ENTRY_STR
274 #error AUV2_ENTRY_STR not defined - the name of the entry point for a component manager AUv2 plug-in, with quotes
275 #endif
276 #ifndef AUV2_FACTORY
277 #error AUV2_FACTORY not defined - the name of the entry point for a AUPlugIn AUv2 plug-in, without quotes
278 #endif
279 #if PLUG_HAS_UI
280 #ifndef AUV2_VIEW_CLASS
281 #error AUV2_VIEW_CLASS not defined - the name of the Objective-C class for the AUv2 plug-in's view, without quotes
282 #endif
283 #ifndef AUV2_VIEW_CLASS_STR
284 #error AUV2_VIEW_CLASS_STR not defined - the name of the Objective-C class for the AUv2 plug-in's view, with quotes
285 #endif
286 #endif
287#endif
288
289#ifdef AAX_API
290 #ifndef AAX_TYPE_IDS
291 #error AAX_TYPE_IDS not defined - list of comma separated four char IDs, that correspond to the different possible channel layouts of your plug-in, e.g. 'EFN1', 'EFN2'
292 #endif
293
294 #ifndef AAX_PLUG_MFR_STR
295 #error AAX_PLUG_MFR_STR not defined - The manufacturer name as it will appear in Pro tools preset manager
296 #endif
297
298 #ifndef AAX_PLUG_NAME_STR
299 #error AAX_PLUG_NAME_STR not defined - The plug-in name string, which may include shorten names separated with newline characters, e.g. "IPlugEffect\nIPEF"
300 #endif
301
302 #ifndef AAX_PLUG_CATEGORY_STR
303 #error AAX_PLUG_CATEGORY_STR not defined - String defining the category for your plug-in, e.g. "Effect"
304 #endif
305
306 #if AAX_DOES_AUDIOSUITE
307 #ifndef AAX_TYPE_IDS_AUDIOSUITE
308 #error AAX_TYPE_IDS_AUDIOSUITE not defined - list of comma separated four char IDs, that correspond to the different possible channel layouts of your plug-in when running off-line in audio suite mode, e.g. 'EFA1', 'EFA2'
309 #endif
310 #endif
311#endif
IGraphics header include Include this file in the main header if using IGraphics outside a plugin con...
Include to get consistently named preprocessor macros for different platforms and logging functionali...