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