comparison DPF-Prymula-audioplugins/dpf/distrho/src/DistrhoPluginChecks.h @ 3:84e66ea83026

DPF-Prymula-audioplugins-0.231015-2
author prymula <prymula76@outlook.com>
date Mon, 16 Oct 2023 21:53:34 +0200
parents
children
comparison
equal deleted inserted replaced
2:cf2cb71d31dd 3:84e66ea83026
1 /*
2 * DISTRHO Plugin Framework (DPF)
3 * Copyright (C) 2012-2023 Filipe Coelho <falktx@falktx.com>
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any purpose with
6 * or without fee is hereby granted, provided that the above copyright notice and this
7 * permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
10 * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
11 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
12 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17 #ifndef DISTRHO_PLUGIN_CHECKS_H_INCLUDED
18 #define DISTRHO_PLUGIN_CHECKS_H_INCLUDED
19
20 #ifndef DISTRHO_DETAILS_HPP_INCLUDED
21 # error wrong include order
22 #endif
23
24 #include "DistrhoPluginInfo.h"
25
26 // -----------------------------------------------------------------------
27 // Check if all required macros are defined
28
29 #ifndef DISTRHO_PLUGIN_NAME
30 # error DISTRHO_PLUGIN_NAME undefined!
31 #endif
32
33 #ifndef DISTRHO_PLUGIN_NUM_INPUTS
34 # error DISTRHO_PLUGIN_NUM_INPUTS undefined!
35 #endif
36
37 #ifndef DISTRHO_PLUGIN_NUM_OUTPUTS
38 # error DISTRHO_PLUGIN_NUM_OUTPUTS undefined!
39 #endif
40
41 #ifndef DISTRHO_PLUGIN_URI
42 # error DISTRHO_PLUGIN_URI undefined!
43 #endif
44
45 // -----------------------------------------------------------------------
46 // Define optional macros if not done yet
47
48 #ifndef DISTRHO_PLUGIN_HAS_UI
49 # define DISTRHO_PLUGIN_HAS_UI 0
50 #endif
51
52 #ifndef DISTRHO_PLUGIN_HAS_EXTERNAL_UI
53 # define DISTRHO_PLUGIN_HAS_EXTERNAL_UI 0
54 #endif
55
56 #ifndef DISTRHO_PLUGIN_IS_RT_SAFE
57 # define DISTRHO_PLUGIN_IS_RT_SAFE 0
58 #endif
59
60 #ifndef DISTRHO_PLUGIN_IS_SYNTH
61 # define DISTRHO_PLUGIN_IS_SYNTH 0
62 #endif
63
64 #ifndef DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
65 # define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 0
66 #endif
67
68 #ifndef DISTRHO_PLUGIN_WANT_LATENCY
69 # define DISTRHO_PLUGIN_WANT_LATENCY 0
70 #endif
71
72 #ifndef DISTRHO_PLUGIN_WANT_MIDI_OUTPUT
73 # define DISTRHO_PLUGIN_WANT_MIDI_OUTPUT 0
74 #endif
75
76 #ifndef DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST
77 # define DISTRHO_PLUGIN_WANT_PARAMETER_VALUE_CHANGE_REQUEST 0
78 #endif
79
80 #ifndef DISTRHO_PLUGIN_WANT_PROGRAMS
81 # define DISTRHO_PLUGIN_WANT_PROGRAMS 0
82 #endif
83
84 #ifndef DISTRHO_PLUGIN_WANT_STATE
85 # define DISTRHO_PLUGIN_WANT_STATE 0
86 #endif
87
88 #ifndef DISTRHO_PLUGIN_WANT_FULL_STATE
89 # define DISTRHO_PLUGIN_WANT_FULL_STATE 0
90 # define DISTRHO_PLUGIN_WANT_FULL_STATE_WAS_NOT_SET
91 #endif
92
93 #ifndef DISTRHO_PLUGIN_WANT_TIMEPOS
94 # define DISTRHO_PLUGIN_WANT_TIMEPOS 0
95 #endif
96
97 #ifndef DISTRHO_UI_FILE_BROWSER
98 # if defined(DGL_FILE_BROWSER_DISABLED) || DISTRHO_PLUGIN_HAS_EXTERNAL_UI
99 # define DISTRHO_UI_FILE_BROWSER 0
100 # else
101 # define DISTRHO_UI_FILE_BROWSER 1
102 # endif
103 #endif
104
105 #ifndef DISTRHO_UI_USER_RESIZABLE
106 # define DISTRHO_UI_USER_RESIZABLE 0
107 #endif
108
109 #ifndef DISTRHO_UI_USE_NANOVG
110 # define DISTRHO_UI_USE_NANOVG 0
111 #endif
112
113 // -----------------------------------------------------------------------
114 // Define DISTRHO_PLUGIN_HAS_EMBED_UI if needed
115
116 #ifndef DISTRHO_PLUGIN_HAS_EMBED_UI
117 # if (defined(DGL_CAIRO) && defined(HAVE_CAIRO)) || (defined(DGL_OPENGL) && defined(HAVE_OPENGL))
118 # define DISTRHO_PLUGIN_HAS_EMBED_UI 1
119 # else
120 # define DISTRHO_PLUGIN_HAS_EMBED_UI 0
121 # endif
122 #endif
123
124 // -----------------------------------------------------------------------
125 // Define DISTRHO_UI_URI if needed
126
127 #ifndef DISTRHO_UI_URI
128 # define DISTRHO_UI_URI DISTRHO_PLUGIN_URI "#DPF_UI"
129 #endif
130
131 // -----------------------------------------------------------------------
132 // Test if synth has audio outputs
133
134 #if DISTRHO_PLUGIN_IS_SYNTH && DISTRHO_PLUGIN_NUM_OUTPUTS == 0
135 # error Synths need audio output to work!
136 #endif
137
138 // -----------------------------------------------------------------------
139 // Enable MIDI input if synth, test if midi-input disabled when synth
140
141 #ifndef DISTRHO_PLUGIN_WANT_MIDI_INPUT
142 # define DISTRHO_PLUGIN_WANT_MIDI_INPUT DISTRHO_PLUGIN_IS_SYNTH
143 #elif DISTRHO_PLUGIN_IS_SYNTH && ! DISTRHO_PLUGIN_WANT_MIDI_INPUT
144 # error Synths need MIDI input to work!
145 #endif
146
147 // -----------------------------------------------------------------------
148 // Enable state if plugin wants state files (deprecated)
149
150 #ifdef DISTRHO_PLUGIN_WANT_STATEFILES
151 # warning DISTRHO_PLUGIN_WANT_STATEFILES is deprecated
152 # undef DISTRHO_PLUGIN_WANT_STATEFILES
153 # if ! DISTRHO_PLUGIN_WANT_STATE
154 # undef DISTRHO_PLUGIN_WANT_STATE
155 # define DISTRHO_PLUGIN_WANT_STATE 1
156 # endif
157 #endif
158
159 // -----------------------------------------------------------------------
160 // Enable full state if plugin exports presets
161
162 #if DISTRHO_PLUGIN_WANT_PROGRAMS && DISTRHO_PLUGIN_WANT_STATE && defined(DISTRHO_PLUGIN_WANT_FULL_STATE_WAS_NOT_SET)
163 # warning Plugins with programs and state should implement full state API too
164 # undef DISTRHO_PLUGIN_WANT_FULL_STATE
165 # define DISTRHO_PLUGIN_WANT_FULL_STATE 1
166 #endif
167
168 // -----------------------------------------------------------------------
169 // Disable file browser if using external UI
170
171 #if DISTRHO_UI_FILE_BROWSER && DISTRHO_PLUGIN_HAS_EXTERNAL_UI
172 # warning file browser APIs do not work for external UIs
173 # undef DISTRHO_UI_FILE_BROWSER 0
174 # define DISTRHO_UI_FILE_BROWSER 0
175 #endif
176
177 // -----------------------------------------------------------------------
178 // Disable UI if DGL or external UI is not available
179
180 #if (defined(DGL_CAIRO) && ! defined(HAVE_CAIRO)) || (defined(DGL_OPENGL) && ! defined(HAVE_OPENGL))
181 # undef DISTRHO_PLUGIN_HAS_EMBED_UI
182 # define DISTRHO_PLUGIN_HAS_EMBED_UI 0
183 #endif
184
185 #if DISTRHO_PLUGIN_HAS_UI && ! DISTRHO_PLUGIN_HAS_EMBED_UI && ! DISTRHO_PLUGIN_HAS_EXTERNAL_UI
186 # undef DISTRHO_PLUGIN_HAS_UI
187 # define DISTRHO_PLUGIN_HAS_UI 0
188 #endif
189
190 // -----------------------------------------------------------------------
191 // Make sure both default width and height are provided
192
193 #if defined(DISTRHO_UI_DEFAULT_WIDTH) && !defined(DISTRHO_UI_DEFAULT_HEIGHT)
194 # error DISTRHO_UI_DEFAULT_WIDTH is defined but DISTRHO_UI_DEFAULT_HEIGHT is not
195 #endif
196
197 #if defined(DISTRHO_UI_DEFAULT_HEIGHT) && !defined(DISTRHO_UI_DEFAULT_WIDTH)
198 # error DISTRHO_UI_DEFAULT_HEIGHT is defined but DISTRHO_UI_DEFAULT_WIDTH is not
199 #endif
200
201 // -----------------------------------------------------------------------
202 // Prevent users from messing about with DPF internals
203
204 #ifdef DISTRHO_UI_IS_STANDALONE
205 # error DISTRHO_UI_IS_STANDALONE must not be defined
206 #endif
207
208 // -----------------------------------------------------------------------
209
210 #endif // DISTRHO_PLUGIN_CHECKS_H_INCLUDED