1d5ac70f0Sopenharmony_ci/* ladspa.h
2d5ac70f0Sopenharmony_ci
3d5ac70f0Sopenharmony_ci   Linux Audio Developer's Simple Plugin API Version 1.1[LGPL].
4d5ac70f0Sopenharmony_ci   Copyright (C) 2000-2002 Richard W.E. Furse, Paul Barton-Davis,
5d5ac70f0Sopenharmony_ci   Stefan Westerfeld.
6d5ac70f0Sopenharmony_ci
7d5ac70f0Sopenharmony_ci   This library is free software; you can redistribute it and/or
8d5ac70f0Sopenharmony_ci   modify it under the terms of the GNU Lesser General Public License
9d5ac70f0Sopenharmony_ci   as published by the Free Software Foundation; either version 2.1 of
10d5ac70f0Sopenharmony_ci   the License, or (at your option) any later version.
11d5ac70f0Sopenharmony_ci
12d5ac70f0Sopenharmony_ci   This library is distributed in the hope that it will be useful, but
13d5ac70f0Sopenharmony_ci   WITHOUT ANY WARRANTY; without even the implied warranty of
14d5ac70f0Sopenharmony_ci   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15d5ac70f0Sopenharmony_ci   Lesser General Public License for more details.
16d5ac70f0Sopenharmony_ci
17d5ac70f0Sopenharmony_ci   You should have received a copy of the GNU Lesser General Public
18d5ac70f0Sopenharmony_ci   License along with this library; if not, write to the Free Software
19d5ac70f0Sopenharmony_ci   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20d5ac70f0Sopenharmony_ci   USA. */
21d5ac70f0Sopenharmony_ci
22d5ac70f0Sopenharmony_ci#ifndef LADSPA_INCLUDED
23d5ac70f0Sopenharmony_ci#define LADSPA_INCLUDED
24d5ac70f0Sopenharmony_ci
25d5ac70f0Sopenharmony_ci#define LADSPA_VERSION "1.1"
26d5ac70f0Sopenharmony_ci#define LADSPA_VERSION_MAJOR 1
27d5ac70f0Sopenharmony_ci#define LADSPA_VERSION_MINOR 1
28d5ac70f0Sopenharmony_ci
29d5ac70f0Sopenharmony_ci#ifdef __cplusplus
30d5ac70f0Sopenharmony_ciextern "C" {
31d5ac70f0Sopenharmony_ci#endif
32d5ac70f0Sopenharmony_ci
33d5ac70f0Sopenharmony_ci/*****************************************************************************/
34d5ac70f0Sopenharmony_ci
35d5ac70f0Sopenharmony_ci/* Overview:
36d5ac70f0Sopenharmony_ci
37d5ac70f0Sopenharmony_ci   There is a large number of synthesis packages in use or development
38d5ac70f0Sopenharmony_ci   on the Linux platform at this time. This API (`The Linux Audio
39d5ac70f0Sopenharmony_ci   Developer's Simple Plugin API') attempts to give programmers the
40d5ac70f0Sopenharmony_ci   ability to write simple `plugin' audio processors in C/C++ and link
41d5ac70f0Sopenharmony_ci   them dynamically (`plug') into a range of these packages (`hosts').
42d5ac70f0Sopenharmony_ci   It should be possible for any host and any plugin to communicate
43d5ac70f0Sopenharmony_ci   completely through this interface.
44d5ac70f0Sopenharmony_ci
45d5ac70f0Sopenharmony_ci   This API is deliberately short and simple. To achieve compatibility
46d5ac70f0Sopenharmony_ci   with a range of promising Linux sound synthesis packages it
47d5ac70f0Sopenharmony_ci   attempts to find the `greatest common divisor' in their logical
48d5ac70f0Sopenharmony_ci   behaviour. Having said this, certain limiting decisions are
49d5ac70f0Sopenharmony_ci   implicit, notably the use of a fixed type (LADSPA_Data) for all
50d5ac70f0Sopenharmony_ci   data transfer and absence of a parameterised `initialisation'
51d5ac70f0Sopenharmony_ci   phase. See below for the LADSPA_Data typedef.
52d5ac70f0Sopenharmony_ci
53d5ac70f0Sopenharmony_ci   Plugins are expected to distinguish between control and audio
54d5ac70f0Sopenharmony_ci   data. Plugins have `ports' that are inputs or outputs for audio or
55d5ac70f0Sopenharmony_ci   control data and each plugin is `run' for a `block' corresponding
56d5ac70f0Sopenharmony_ci   to a short time interval measured in samples. Audio data is
57d5ac70f0Sopenharmony_ci   communicated using arrays of LADSPA_Data, allowing a block of audio
58d5ac70f0Sopenharmony_ci   to be processed by the plugin in a single pass. Control data is
59d5ac70f0Sopenharmony_ci   communicated using single LADSPA_Data values. Control data has a
60d5ac70f0Sopenharmony_ci   single value at the start of a call to the `run()' or `run_adding()'
61d5ac70f0Sopenharmony_ci   function, and may be considered to remain this value for its
62d5ac70f0Sopenharmony_ci   duration. The plugin may assume that all its input and output ports
63d5ac70f0Sopenharmony_ci   have been connected to the relevant data location (see the
64d5ac70f0Sopenharmony_ci   `connect_port()' function below) before it is asked to run.
65d5ac70f0Sopenharmony_ci
66d5ac70f0Sopenharmony_ci   Plugins will reside in shared object files suitable for dynamic
67d5ac70f0Sopenharmony_ci   linking by dlopen() and family. The file will provide a number of
68d5ac70f0Sopenharmony_ci   `plugin types' that can be used to instantiate actual plugins
69d5ac70f0Sopenharmony_ci   (sometimes known as `plugin instances') that can be connected
70d5ac70f0Sopenharmony_ci   together to perform tasks.
71d5ac70f0Sopenharmony_ci
72d5ac70f0Sopenharmony_ci   This API contains very limited error-handling. */
73d5ac70f0Sopenharmony_ci
74d5ac70f0Sopenharmony_ci/*****************************************************************************/
75d5ac70f0Sopenharmony_ci
76d5ac70f0Sopenharmony_ci/* Fundamental data type passed in and out of plugin. This data type
77d5ac70f0Sopenharmony_ci   is used to communicate audio samples and control values. It is
78d5ac70f0Sopenharmony_ci   assumed that the plugin will work sensibly given any numeric input
79d5ac70f0Sopenharmony_ci   value although it may have a preferred range (see hints below).
80d5ac70f0Sopenharmony_ci
81d5ac70f0Sopenharmony_ci   For audio it is generally assumed that 1.0f is the `0dB' reference
82d5ac70f0Sopenharmony_ci   amplitude and is a `normal' signal level. */
83d5ac70f0Sopenharmony_ci
84d5ac70f0Sopenharmony_citypedef float LADSPA_Data;
85d5ac70f0Sopenharmony_ci
86d5ac70f0Sopenharmony_ci/*****************************************************************************/
87d5ac70f0Sopenharmony_ci
88d5ac70f0Sopenharmony_ci/* Special Plugin Properties:
89d5ac70f0Sopenharmony_ci
90d5ac70f0Sopenharmony_ci   Optional features of the plugin type are encapsulated in the
91d5ac70f0Sopenharmony_ci   LADSPA_Properties type. This is assembled by ORing individual
92d5ac70f0Sopenharmony_ci   properties together. */
93d5ac70f0Sopenharmony_ci
94d5ac70f0Sopenharmony_citypedef int LADSPA_Properties;
95d5ac70f0Sopenharmony_ci
96d5ac70f0Sopenharmony_ci/* Property LADSPA_PROPERTY_REALTIME indicates that the plugin has a
97d5ac70f0Sopenharmony_ci   real-time dependency (e.g. listens to a MIDI device) and so its
98d5ac70f0Sopenharmony_ci   output must not be cached or subject to significant latency. */
99d5ac70f0Sopenharmony_ci#define LADSPA_PROPERTY_REALTIME        0x1
100d5ac70f0Sopenharmony_ci
101d5ac70f0Sopenharmony_ci/* Property LADSPA_PROPERTY_INPLACE_BROKEN indicates that the plugin
102d5ac70f0Sopenharmony_ci   may cease to work correctly if the host elects to use the same data
103d5ac70f0Sopenharmony_ci   location for both input and output (see connect_port()). This
104d5ac70f0Sopenharmony_ci   should be avoided as enabling this flag makes it impossible for
105d5ac70f0Sopenharmony_ci   hosts to use the plugin to process audio `in-place.' */
106d5ac70f0Sopenharmony_ci#define LADSPA_PROPERTY_INPLACE_BROKEN  0x2
107d5ac70f0Sopenharmony_ci
108d5ac70f0Sopenharmony_ci/* Property LADSPA_PROPERTY_HARD_RT_CAPABLE indicates that the plugin
109d5ac70f0Sopenharmony_ci   is capable of running not only in a conventional host but also in a
110d5ac70f0Sopenharmony_ci   `hard real-time' environment. To qualify for this the plugin must
111d5ac70f0Sopenharmony_ci   satisfy all of the following:
112d5ac70f0Sopenharmony_ci
113d5ac70f0Sopenharmony_ci   (1) The plugin must not use malloc(), free() or other heap memory
114d5ac70f0Sopenharmony_ci   management within its run() or run_adding() functions. All new
115d5ac70f0Sopenharmony_ci   memory used in run() must be managed via the stack. These
116d5ac70f0Sopenharmony_ci   restrictions only apply to the run() function.
117d5ac70f0Sopenharmony_ci
118d5ac70f0Sopenharmony_ci   (2) The plugin will not attempt to make use of any library
119d5ac70f0Sopenharmony_ci   functions with the exceptions of functions in the ANSI standard C
120d5ac70f0Sopenharmony_ci   and C maths libraries, which the host is expected to provide.
121d5ac70f0Sopenharmony_ci
122d5ac70f0Sopenharmony_ci   (3) The plugin will not access files, devices, pipes, sockets, IPC
123d5ac70f0Sopenharmony_ci   or any other mechanism that might result in process or thread
124d5ac70f0Sopenharmony_ci   blocking.
125d5ac70f0Sopenharmony_ci
126d5ac70f0Sopenharmony_ci   (4) The plugin will take an amount of time to execute a run() or
127d5ac70f0Sopenharmony_ci   run_adding() call approximately of form (A+B*SampleCount) where A
128d5ac70f0Sopenharmony_ci   and B depend on the machine and host in use. This amount of time
129d5ac70f0Sopenharmony_ci   may not depend on input signals or plugin state. The host is left
130d5ac70f0Sopenharmony_ci   the responsibility to perform timings to estimate upper bounds for
131d5ac70f0Sopenharmony_ci   A and B. */
132d5ac70f0Sopenharmony_ci#define LADSPA_PROPERTY_HARD_RT_CAPABLE 0x4
133d5ac70f0Sopenharmony_ci
134d5ac70f0Sopenharmony_ci#define LADSPA_IS_REALTIME(x)        ((x) & LADSPA_PROPERTY_REALTIME)
135d5ac70f0Sopenharmony_ci#define LADSPA_IS_INPLACE_BROKEN(x)  ((x) & LADSPA_PROPERTY_INPLACE_BROKEN)
136d5ac70f0Sopenharmony_ci#define LADSPA_IS_HARD_RT_CAPABLE(x) ((x) & LADSPA_PROPERTY_HARD_RT_CAPABLE)
137d5ac70f0Sopenharmony_ci
138d5ac70f0Sopenharmony_ci/*****************************************************************************/
139d5ac70f0Sopenharmony_ci
140d5ac70f0Sopenharmony_ci/* Plugin Ports:
141d5ac70f0Sopenharmony_ci
142d5ac70f0Sopenharmony_ci   Plugins have `ports' that are inputs or outputs for audio or
143d5ac70f0Sopenharmony_ci   data. Ports can communicate arrays of LADSPA_Data (for audio
144d5ac70f0Sopenharmony_ci   inputs/outputs) or single LADSPA_Data values (for control
145d5ac70f0Sopenharmony_ci   input/outputs). This information is encapsulated in the
146d5ac70f0Sopenharmony_ci   LADSPA_PortDescriptor type which is assembled by ORing individual
147d5ac70f0Sopenharmony_ci   properties together.
148d5ac70f0Sopenharmony_ci
149d5ac70f0Sopenharmony_ci   Note that a port must be an input or an output port but not both
150d5ac70f0Sopenharmony_ci   and that a port must be a control or audio port but not both. */
151d5ac70f0Sopenharmony_ci
152d5ac70f0Sopenharmony_citypedef int LADSPA_PortDescriptor;
153d5ac70f0Sopenharmony_ci
154d5ac70f0Sopenharmony_ci/* Property LADSPA_PORT_INPUT indicates that the port is an input. */
155d5ac70f0Sopenharmony_ci#define LADSPA_PORT_INPUT   0x1
156d5ac70f0Sopenharmony_ci
157d5ac70f0Sopenharmony_ci/* Property LADSPA_PORT_OUTPUT indicates that the port is an output. */
158d5ac70f0Sopenharmony_ci#define LADSPA_PORT_OUTPUT  0x2
159d5ac70f0Sopenharmony_ci
160d5ac70f0Sopenharmony_ci/* Property LADSPA_PORT_CONTROL indicates that the port is a control
161d5ac70f0Sopenharmony_ci   port. */
162d5ac70f0Sopenharmony_ci#define LADSPA_PORT_CONTROL 0x4
163d5ac70f0Sopenharmony_ci
164d5ac70f0Sopenharmony_ci/* Property LADSPA_PORT_AUDIO indicates that the port is a audio
165d5ac70f0Sopenharmony_ci   port. */
166d5ac70f0Sopenharmony_ci#define LADSPA_PORT_AUDIO   0x8
167d5ac70f0Sopenharmony_ci
168d5ac70f0Sopenharmony_ci#define LADSPA_IS_PORT_INPUT(x)   ((x) & LADSPA_PORT_INPUT)
169d5ac70f0Sopenharmony_ci#define LADSPA_IS_PORT_OUTPUT(x)  ((x) & LADSPA_PORT_OUTPUT)
170d5ac70f0Sopenharmony_ci#define LADSPA_IS_PORT_CONTROL(x) ((x) & LADSPA_PORT_CONTROL)
171d5ac70f0Sopenharmony_ci#define LADSPA_IS_PORT_AUDIO(x)   ((x) & LADSPA_PORT_AUDIO)
172d5ac70f0Sopenharmony_ci
173d5ac70f0Sopenharmony_ci/*****************************************************************************/
174d5ac70f0Sopenharmony_ci
175d5ac70f0Sopenharmony_ci/* Plugin Port Range Hints:
176d5ac70f0Sopenharmony_ci
177d5ac70f0Sopenharmony_ci   The host may wish to provide a representation of data entering or
178d5ac70f0Sopenharmony_ci   leaving a plugin (e.g. to generate a GUI automatically). To make
179d5ac70f0Sopenharmony_ci   this more meaningful, the plugin should provide `hints' to the host
180d5ac70f0Sopenharmony_ci   describing the usual values taken by the data.
181d5ac70f0Sopenharmony_ci
182d5ac70f0Sopenharmony_ci   Note that these are only hints. The host may ignore them and the
183d5ac70f0Sopenharmony_ci   plugin must not assume that data supplied to it is meaningful. If
184d5ac70f0Sopenharmony_ci   the plugin receives invalid input data it is expected to continue
185d5ac70f0Sopenharmony_ci   to run without failure and, where possible, produce a sensible
186d5ac70f0Sopenharmony_ci   output (e.g. a high-pass filter given a negative cutoff frequency
187d5ac70f0Sopenharmony_ci   might switch to an all-pass mode).
188d5ac70f0Sopenharmony_ci
189d5ac70f0Sopenharmony_ci   Hints are meaningful for all input and output ports but hints for
190d5ac70f0Sopenharmony_ci   input control ports are expected to be particularly useful.
191d5ac70f0Sopenharmony_ci
192d5ac70f0Sopenharmony_ci   More hint information is encapsulated in the
193d5ac70f0Sopenharmony_ci   LADSPA_PortRangeHintDescriptor type which is assembled by ORing
194d5ac70f0Sopenharmony_ci   individual hint types together. Hints may require further
195d5ac70f0Sopenharmony_ci   LowerBound and UpperBound information.
196d5ac70f0Sopenharmony_ci
197d5ac70f0Sopenharmony_ci   All the hint information for a particular port is aggregated in the
198d5ac70f0Sopenharmony_ci   LADSPA_PortRangeHint structure. */
199d5ac70f0Sopenharmony_ci
200d5ac70f0Sopenharmony_citypedef int LADSPA_PortRangeHintDescriptor;
201d5ac70f0Sopenharmony_ci
202d5ac70f0Sopenharmony_ci/* Hint LADSPA_HINT_BOUNDED_BELOW indicates that the LowerBound field
203d5ac70f0Sopenharmony_ci   of the LADSPA_PortRangeHint should be considered meaningful. The
204d5ac70f0Sopenharmony_ci   value in this field should be considered the (inclusive) lower
205d5ac70f0Sopenharmony_ci   bound of the valid range. If LADSPA_HINT_SAMPLE_RATE is also
206d5ac70f0Sopenharmony_ci   specified then the value of LowerBound should be multiplied by the
207d5ac70f0Sopenharmony_ci   sample rate. */
208d5ac70f0Sopenharmony_ci#define LADSPA_HINT_BOUNDED_BELOW   0x1
209d5ac70f0Sopenharmony_ci
210d5ac70f0Sopenharmony_ci/* Hint LADSPA_HINT_BOUNDED_ABOVE indicates that the UpperBound field
211d5ac70f0Sopenharmony_ci   of the LADSPA_PortRangeHint should be considered meaningful. The
212d5ac70f0Sopenharmony_ci   value in this field should be considered the (inclusive) upper
213d5ac70f0Sopenharmony_ci   bound of the valid range. If LADSPA_HINT_SAMPLE_RATE is also
214d5ac70f0Sopenharmony_ci   specified then the value of UpperBound should be multiplied by the
215d5ac70f0Sopenharmony_ci   sample rate. */
216d5ac70f0Sopenharmony_ci#define LADSPA_HINT_BOUNDED_ABOVE   0x2
217d5ac70f0Sopenharmony_ci
218d5ac70f0Sopenharmony_ci/* Hint LADSPA_HINT_TOGGLED indicates that the data item should be
219d5ac70f0Sopenharmony_ci   considered a Boolean toggle. Data less than or equal to zero should
220d5ac70f0Sopenharmony_ci   be considered `off' or `false,' and data above zero should be
221d5ac70f0Sopenharmony_ci   considered `on' or `true.' LADSPA_HINT_TOGGLED may not be used in
222d5ac70f0Sopenharmony_ci   conjunction with any other hint except LADSPA_HINT_DEFAULT_0 or
223d5ac70f0Sopenharmony_ci   LADSPA_HINT_DEFAULT_1. */
224d5ac70f0Sopenharmony_ci#define LADSPA_HINT_TOGGLED         0x4
225d5ac70f0Sopenharmony_ci
226d5ac70f0Sopenharmony_ci/* Hint LADSPA_HINT_SAMPLE_RATE indicates that any bounds specified
227d5ac70f0Sopenharmony_ci   should be interpreted as multiples of the sample rate. For
228d5ac70f0Sopenharmony_ci   instance, a frequency range from 0Hz to the Nyquist frequency (half
229d5ac70f0Sopenharmony_ci   the sample rate) could be requested by this hint in conjunction
230d5ac70f0Sopenharmony_ci   with LowerBound = 0 and UpperBound = 0.5. Hosts that support bounds
231d5ac70f0Sopenharmony_ci   at all must support this hint to retain meaning. */
232d5ac70f0Sopenharmony_ci#define LADSPA_HINT_SAMPLE_RATE     0x8
233d5ac70f0Sopenharmony_ci
234d5ac70f0Sopenharmony_ci/* Hint LADSPA_HINT_LOGARITHMIC indicates that it is likely that the
235d5ac70f0Sopenharmony_ci   user will find it more intuitive to view values using a logarithmic
236d5ac70f0Sopenharmony_ci   scale. This is particularly useful for frequencies and gains. */
237d5ac70f0Sopenharmony_ci#define LADSPA_HINT_LOGARITHMIC     0x10
238d5ac70f0Sopenharmony_ci
239d5ac70f0Sopenharmony_ci/* Hint LADSPA_HINT_INTEGER indicates that a user interface would
240d5ac70f0Sopenharmony_ci   probably wish to provide a stepped control taking only integer
241d5ac70f0Sopenharmony_ci   values. Any bounds set should be slightly wider than the actual
242d5ac70f0Sopenharmony_ci   integer range required to avoid floating point rounding errors. For
243d5ac70f0Sopenharmony_ci   instance, the integer set {0,1,2,3} might be described as [-0.1,
244d5ac70f0Sopenharmony_ci   3.1]. */
245d5ac70f0Sopenharmony_ci#define LADSPA_HINT_INTEGER         0x20
246d5ac70f0Sopenharmony_ci
247d5ac70f0Sopenharmony_ci/* The various LADSPA_HINT_HAS_DEFAULT_* hints indicate a `normal'
248d5ac70f0Sopenharmony_ci   value for the port that is sensible as a default. For instance,
249d5ac70f0Sopenharmony_ci   this value is suitable for use as an initial value in a user
250d5ac70f0Sopenharmony_ci   interface or as a value the host might assign to a control port
251d5ac70f0Sopenharmony_ci   when the user has not provided one. Defaults are encoded using a
252d5ac70f0Sopenharmony_ci   mask so only one default may be specified for a port. Some of the
253d5ac70f0Sopenharmony_ci   hints make use of lower and upper bounds, in which case the
254d5ac70f0Sopenharmony_ci   relevant bound or bounds must be available and
255d5ac70f0Sopenharmony_ci   LADSPA_HINT_SAMPLE_RATE must be applied as usual. The resulting
256d5ac70f0Sopenharmony_ci   default must be rounded if LADSPA_HINT_INTEGER is present. Default
257d5ac70f0Sopenharmony_ci   values were introduced in LADSPA v1.1. */
258d5ac70f0Sopenharmony_ci#define LADSPA_HINT_DEFAULT_MASK    0x3C0
259d5ac70f0Sopenharmony_ci
260d5ac70f0Sopenharmony_ci/* This default values indicates that no default is provided. */
261d5ac70f0Sopenharmony_ci#define LADSPA_HINT_DEFAULT_NONE    0x0
262d5ac70f0Sopenharmony_ci
263d5ac70f0Sopenharmony_ci/* This default hint indicates that the suggested lower bound for the
264d5ac70f0Sopenharmony_ci   port should be used. */
265d5ac70f0Sopenharmony_ci#define LADSPA_HINT_DEFAULT_MINIMUM 0x40
266d5ac70f0Sopenharmony_ci
267d5ac70f0Sopenharmony_ci/* This default hint indicates that a low value between the suggested
268d5ac70f0Sopenharmony_ci   lower and upper bounds should be chosen. For ports with
269d5ac70f0Sopenharmony_ci   LADSPA_HINT_LOGARITHMIC, this should be exp(log(lower) * 0.75 +
270d5ac70f0Sopenharmony_ci   log(upper) * 0.25). Otherwise, this should be (lower * 0.75 + upper
271d5ac70f0Sopenharmony_ci   * 0.25). */
272d5ac70f0Sopenharmony_ci#define LADSPA_HINT_DEFAULT_LOW     0x80
273d5ac70f0Sopenharmony_ci
274d5ac70f0Sopenharmony_ci/* This default hint indicates that a middle value between the
275d5ac70f0Sopenharmony_ci   suggested lower and upper bounds should be chosen. For ports with
276d5ac70f0Sopenharmony_ci   LADSPA_HINT_LOGARITHMIC, this should be exp(log(lower) * 0.5 +
277d5ac70f0Sopenharmony_ci   log(upper) * 0.5). Otherwise, this should be (lower * 0.5 + upper *
278d5ac70f0Sopenharmony_ci   0.5). */
279d5ac70f0Sopenharmony_ci#define LADSPA_HINT_DEFAULT_MIDDLE  0xC0
280d5ac70f0Sopenharmony_ci
281d5ac70f0Sopenharmony_ci/* This default hint indicates that a high value between the suggested
282d5ac70f0Sopenharmony_ci   lower and upper bounds should be chosen. For ports with
283d5ac70f0Sopenharmony_ci   LADSPA_HINT_LOGARITHMIC, this should be exp(log(lower) * 0.25 +
284d5ac70f0Sopenharmony_ci   log(upper) * 0.75). Otherwise, this should be (lower * 0.25 + upper
285d5ac70f0Sopenharmony_ci   * 0.75). */
286d5ac70f0Sopenharmony_ci#define LADSPA_HINT_DEFAULT_HIGH    0x100
287d5ac70f0Sopenharmony_ci
288d5ac70f0Sopenharmony_ci/* This default hint indicates that the suggested upper bound for the
289d5ac70f0Sopenharmony_ci   port should be used. */
290d5ac70f0Sopenharmony_ci#define LADSPA_HINT_DEFAULT_MAXIMUM 0x140
291d5ac70f0Sopenharmony_ci
292d5ac70f0Sopenharmony_ci/* This default hint indicates that the number 0 should be used. Note
293d5ac70f0Sopenharmony_ci   that this default may be used in conjunction with
294d5ac70f0Sopenharmony_ci   LADSPA_HINT_TOGGLED. */
295d5ac70f0Sopenharmony_ci#define LADSPA_HINT_DEFAULT_0       0x200
296d5ac70f0Sopenharmony_ci
297d5ac70f0Sopenharmony_ci/* This default hint indicates that the number 1 should be used. Note
298d5ac70f0Sopenharmony_ci   that this default may be used in conjunction with
299d5ac70f0Sopenharmony_ci   LADSPA_HINT_TOGGLED. */
300d5ac70f0Sopenharmony_ci#define LADSPA_HINT_DEFAULT_1       0x240
301d5ac70f0Sopenharmony_ci
302d5ac70f0Sopenharmony_ci/* This default hint indicates that the number 100 should be used. */
303d5ac70f0Sopenharmony_ci#define LADSPA_HINT_DEFAULT_100     0x280
304d5ac70f0Sopenharmony_ci
305d5ac70f0Sopenharmony_ci/* This default hint indicates that the Hz frequency of `concert A'
306d5ac70f0Sopenharmony_ci   should be used. This will be 440 unless the host uses an unusual
307d5ac70f0Sopenharmony_ci   tuning convention, in which case it may be within a few Hz. */
308d5ac70f0Sopenharmony_ci#define LADSPA_HINT_DEFAULT_440     0x2C0
309d5ac70f0Sopenharmony_ci
310d5ac70f0Sopenharmony_ci#define LADSPA_IS_HINT_BOUNDED_BELOW(x)   ((x) & LADSPA_HINT_BOUNDED_BELOW)
311d5ac70f0Sopenharmony_ci#define LADSPA_IS_HINT_BOUNDED_ABOVE(x)   ((x) & LADSPA_HINT_BOUNDED_ABOVE)
312d5ac70f0Sopenharmony_ci#define LADSPA_IS_HINT_TOGGLED(x)         ((x) & LADSPA_HINT_TOGGLED)
313d5ac70f0Sopenharmony_ci#define LADSPA_IS_HINT_SAMPLE_RATE(x)     ((x) & LADSPA_HINT_SAMPLE_RATE)
314d5ac70f0Sopenharmony_ci#define LADSPA_IS_HINT_LOGARITHMIC(x)     ((x) & LADSPA_HINT_LOGARITHMIC)
315d5ac70f0Sopenharmony_ci#define LADSPA_IS_HINT_INTEGER(x)         ((x) & LADSPA_HINT_INTEGER)
316d5ac70f0Sopenharmony_ci
317d5ac70f0Sopenharmony_ci#define LADSPA_IS_HINT_HAS_DEFAULT(x)     ((x) & LADSPA_HINT_DEFAULT_MASK)
318d5ac70f0Sopenharmony_ci#define LADSPA_IS_HINT_DEFAULT_MINIMUM(x) (((x) & LADSPA_HINT_DEFAULT_MASK)   \
319d5ac70f0Sopenharmony_ci                                           == LADSPA_HINT_DEFAULT_MINIMUM)
320d5ac70f0Sopenharmony_ci#define LADSPA_IS_HINT_DEFAULT_LOW(x)     (((x) & LADSPA_HINT_DEFAULT_MASK)   \
321d5ac70f0Sopenharmony_ci                                           == LADSPA_HINT_DEFAULT_LOW)
322d5ac70f0Sopenharmony_ci#define LADSPA_IS_HINT_DEFAULT_MIDDLE(x)  (((x) & LADSPA_HINT_DEFAULT_MASK)   \
323d5ac70f0Sopenharmony_ci                                           == LADSPA_HINT_DEFAULT_MIDDLE)
324d5ac70f0Sopenharmony_ci#define LADSPA_IS_HINT_DEFAULT_HIGH(x)    (((x) & LADSPA_HINT_DEFAULT_MASK)   \
325d5ac70f0Sopenharmony_ci                                           == LADSPA_HINT_DEFAULT_HIGH)
326d5ac70f0Sopenharmony_ci#define LADSPA_IS_HINT_DEFAULT_MAXIMUM(x) (((x) & LADSPA_HINT_DEFAULT_MASK)   \
327d5ac70f0Sopenharmony_ci                                           == LADSPA_HINT_DEFAULT_MAXIMUM)
328d5ac70f0Sopenharmony_ci#define LADSPA_IS_HINT_DEFAULT_0(x)       (((x) & LADSPA_HINT_DEFAULT_MASK)   \
329d5ac70f0Sopenharmony_ci                                           == LADSPA_HINT_DEFAULT_0)
330d5ac70f0Sopenharmony_ci#define LADSPA_IS_HINT_DEFAULT_1(x)       (((x) & LADSPA_HINT_DEFAULT_MASK)   \
331d5ac70f0Sopenharmony_ci                                           == LADSPA_HINT_DEFAULT_1)
332d5ac70f0Sopenharmony_ci#define LADSPA_IS_HINT_DEFAULT_100(x)     (((x) & LADSPA_HINT_DEFAULT_MASK)   \
333d5ac70f0Sopenharmony_ci                                           == LADSPA_HINT_DEFAULT_100)
334d5ac70f0Sopenharmony_ci#define LADSPA_IS_HINT_DEFAULT_440(x)     (((x) & LADSPA_HINT_DEFAULT_MASK)   \
335d5ac70f0Sopenharmony_ci                                            == LADSPA_HINT_DEFAULT_440)
336d5ac70f0Sopenharmony_ci
337d5ac70f0Sopenharmony_citypedef struct _LADSPA_PortRangeHint {
338d5ac70f0Sopenharmony_ci
339d5ac70f0Sopenharmony_ci  /* Hints about the port. */
340d5ac70f0Sopenharmony_ci  LADSPA_PortRangeHintDescriptor HintDescriptor;
341d5ac70f0Sopenharmony_ci
342d5ac70f0Sopenharmony_ci  /* Meaningful when hint LADSPA_HINT_BOUNDED_BELOW is active. When
343d5ac70f0Sopenharmony_ci     LADSPA_HINT_SAMPLE_RATE is also active then this value should be
344d5ac70f0Sopenharmony_ci     multiplied by the relevant sample rate. */
345d5ac70f0Sopenharmony_ci  LADSPA_Data LowerBound;
346d5ac70f0Sopenharmony_ci
347d5ac70f0Sopenharmony_ci  /* Meaningful when hint LADSPA_HINT_BOUNDED_ABOVE is active. When
348d5ac70f0Sopenharmony_ci     LADSPA_HINT_SAMPLE_RATE is also active then this value should be
349d5ac70f0Sopenharmony_ci     multiplied by the relevant sample rate. */
350d5ac70f0Sopenharmony_ci  LADSPA_Data UpperBound;
351d5ac70f0Sopenharmony_ci
352d5ac70f0Sopenharmony_ci} LADSPA_PortRangeHint;
353d5ac70f0Sopenharmony_ci
354d5ac70f0Sopenharmony_ci/*****************************************************************************/
355d5ac70f0Sopenharmony_ci
356d5ac70f0Sopenharmony_ci/* Plugin Handles:
357d5ac70f0Sopenharmony_ci
358d5ac70f0Sopenharmony_ci   This plugin handle indicates a particular instance of the plugin
359d5ac70f0Sopenharmony_ci   concerned. It is valid to compare this to NULL (0 for C++) but
360d5ac70f0Sopenharmony_ci   otherwise the host should not attempt to interpret it. The plugin
361d5ac70f0Sopenharmony_ci   may use it to reference internal instance data. */
362d5ac70f0Sopenharmony_ci
363d5ac70f0Sopenharmony_citypedef void * LADSPA_Handle;
364d5ac70f0Sopenharmony_ci
365d5ac70f0Sopenharmony_ci/*****************************************************************************/
366d5ac70f0Sopenharmony_ci
367d5ac70f0Sopenharmony_ci/* Descriptor for a Type of Plugin:
368d5ac70f0Sopenharmony_ci
369d5ac70f0Sopenharmony_ci   This structure is used to describe a plugin type. It provides a
370d5ac70f0Sopenharmony_ci   number of functions to examine the type, instantiate it, link it to
371d5ac70f0Sopenharmony_ci   buffers and workspaces and to run it. */
372d5ac70f0Sopenharmony_ci
373d5ac70f0Sopenharmony_citypedef struct _LADSPA_Descriptor {
374d5ac70f0Sopenharmony_ci
375d5ac70f0Sopenharmony_ci  /* This numeric identifier indicates the plugin type
376d5ac70f0Sopenharmony_ci     uniquely. Plugin programmers may reserve ranges of IDs from a
377d5ac70f0Sopenharmony_ci     central body to avoid clashes. Hosts may assume that IDs are
378d5ac70f0Sopenharmony_ci     below 0x1000000. */
379d5ac70f0Sopenharmony_ci  unsigned long UniqueID;
380d5ac70f0Sopenharmony_ci
381d5ac70f0Sopenharmony_ci  /* This identifier can be used as a unique, case-sensitive
382d5ac70f0Sopenharmony_ci     identifier for the plugin type within the plugin file. Plugin
383d5ac70f0Sopenharmony_ci     types should be identified by file and label rather than by index
384d5ac70f0Sopenharmony_ci     or plugin name, which may be changed in new plugin
385d5ac70f0Sopenharmony_ci     versions. Labels must not contain white-space characters. */
386d5ac70f0Sopenharmony_ci  const char * Label;
387d5ac70f0Sopenharmony_ci
388d5ac70f0Sopenharmony_ci  /* This indicates a number of properties of the plugin. */
389d5ac70f0Sopenharmony_ci  LADSPA_Properties Properties;
390d5ac70f0Sopenharmony_ci
391d5ac70f0Sopenharmony_ci  /* This member points to the null-terminated name of the plugin
392d5ac70f0Sopenharmony_ci     (e.g. "Sine Oscillator"). */
393d5ac70f0Sopenharmony_ci  const char * Name;
394d5ac70f0Sopenharmony_ci
395d5ac70f0Sopenharmony_ci  /* This member points to the null-terminated string indicating the
396d5ac70f0Sopenharmony_ci     maker of the plugin. This can be an empty string but not NULL. */
397d5ac70f0Sopenharmony_ci  const char * Maker;
398d5ac70f0Sopenharmony_ci
399d5ac70f0Sopenharmony_ci  /* This member points to the null-terminated string indicating any
400d5ac70f0Sopenharmony_ci     copyright applying to the plugin. If no Copyright applies the
401d5ac70f0Sopenharmony_ci     string "None" should be used. */
402d5ac70f0Sopenharmony_ci  const char * Copyright;
403d5ac70f0Sopenharmony_ci
404d5ac70f0Sopenharmony_ci  /* This indicates the number of ports (input AND output) present on
405d5ac70f0Sopenharmony_ci     the plugin. */
406d5ac70f0Sopenharmony_ci  unsigned long PortCount;
407d5ac70f0Sopenharmony_ci
408d5ac70f0Sopenharmony_ci  /* This member indicates an array of port descriptors. Valid indices
409d5ac70f0Sopenharmony_ci     vary from 0 to PortCount-1. */
410d5ac70f0Sopenharmony_ci  const LADSPA_PortDescriptor * PortDescriptors;
411d5ac70f0Sopenharmony_ci
412d5ac70f0Sopenharmony_ci  /* This member indicates an array of null-terminated strings
413d5ac70f0Sopenharmony_ci     describing ports (e.g. "Frequency (Hz)"). Valid indices vary from
414d5ac70f0Sopenharmony_ci     0 to PortCount-1. */
415d5ac70f0Sopenharmony_ci  const char * const * PortNames;
416d5ac70f0Sopenharmony_ci
417d5ac70f0Sopenharmony_ci  /* This member indicates an array of range hints for each port (see
418d5ac70f0Sopenharmony_ci     above). Valid indices vary from 0 to PortCount-1. */
419d5ac70f0Sopenharmony_ci  const LADSPA_PortRangeHint * PortRangeHints;
420d5ac70f0Sopenharmony_ci
421d5ac70f0Sopenharmony_ci  /* This may be used by the plugin developer to pass any custom
422d5ac70f0Sopenharmony_ci     implementation data into an instantiate call. It must not be used
423d5ac70f0Sopenharmony_ci     or interpreted by the host. It is expected that most plugin
424d5ac70f0Sopenharmony_ci     writers will not use this facility as LADSPA_Handle should be
425d5ac70f0Sopenharmony_ci     used to hold instance data. */
426d5ac70f0Sopenharmony_ci  void * ImplementationData;
427d5ac70f0Sopenharmony_ci
428d5ac70f0Sopenharmony_ci  /* This member is a function pointer that instantiates a plugin. A
429d5ac70f0Sopenharmony_ci     handle is returned indicating the new plugin instance. The
430d5ac70f0Sopenharmony_ci     instantiation function accepts a sample rate as a parameter. The
431d5ac70f0Sopenharmony_ci     plugin descriptor from which this instantiate function was found
432d5ac70f0Sopenharmony_ci     must also be passed. This function must return NULL if
433d5ac70f0Sopenharmony_ci     instantiation fails.
434d5ac70f0Sopenharmony_ci
435d5ac70f0Sopenharmony_ci     Note that instance initialisation should generally occur in
436d5ac70f0Sopenharmony_ci     activate() rather than here. */
437d5ac70f0Sopenharmony_ci  LADSPA_Handle (*instantiate)(const struct _LADSPA_Descriptor * Descriptor,
438d5ac70f0Sopenharmony_ci                               unsigned long                     SampleRate);
439d5ac70f0Sopenharmony_ci
440d5ac70f0Sopenharmony_ci  /* This member is a function pointer that connects a port on an
441d5ac70f0Sopenharmony_ci     instantiated plugin to a memory location at which a block of data
442d5ac70f0Sopenharmony_ci     for the port will be read/written. The data location is expected
443d5ac70f0Sopenharmony_ci     to be an array of LADSPA_Data for audio ports or a single
444d5ac70f0Sopenharmony_ci     LADSPA_Data value for control ports. Memory issues will be
445d5ac70f0Sopenharmony_ci     managed by the host. The plugin must read/write the data at these
446d5ac70f0Sopenharmony_ci     locations every time run() or run_adding() is called and the data
447d5ac70f0Sopenharmony_ci     present at the time of this connection call should not be
448d5ac70f0Sopenharmony_ci     considered meaningful.
449d5ac70f0Sopenharmony_ci
450d5ac70f0Sopenharmony_ci     connect_port() may be called more than once for a plugin instance
451d5ac70f0Sopenharmony_ci     to allow the host to change the buffers that the plugin is
452d5ac70f0Sopenharmony_ci     reading or writing. These calls may be made before or after
453d5ac70f0Sopenharmony_ci     activate() or deactivate() calls.
454d5ac70f0Sopenharmony_ci
455d5ac70f0Sopenharmony_ci     connect_port() must be called at least once for each port before
456d5ac70f0Sopenharmony_ci     run() or run_adding() is called. When working with blocks of
457d5ac70f0Sopenharmony_ci     LADSPA_Data the plugin should pay careful attention to the block
458d5ac70f0Sopenharmony_ci     size passed to the run function as the block allocated may only
459d5ac70f0Sopenharmony_ci     just be large enough to contain the block of samples.
460d5ac70f0Sopenharmony_ci
461d5ac70f0Sopenharmony_ci     Plugin writers should be aware that the host may elect to use the
462d5ac70f0Sopenharmony_ci     same buffer for more than one port and even use the same buffer
463d5ac70f0Sopenharmony_ci     for both input and output (see LADSPA_PROPERTY_INPLACE_BROKEN).
464d5ac70f0Sopenharmony_ci     However, overlapped buffers or use of a single buffer for both
465d5ac70f0Sopenharmony_ci     audio and control data may result in unexpected behaviour. */
466d5ac70f0Sopenharmony_ci   void (*connect_port)(LADSPA_Handle Instance,
467d5ac70f0Sopenharmony_ci                        unsigned long Port,
468d5ac70f0Sopenharmony_ci                        LADSPA_Data * DataLocation);
469d5ac70f0Sopenharmony_ci
470d5ac70f0Sopenharmony_ci  /* This member is a function pointer that initialises a plugin
471d5ac70f0Sopenharmony_ci     instance and activates it for use. This is separated from
472d5ac70f0Sopenharmony_ci     instantiate() to aid real-time support and so that hosts can
473d5ac70f0Sopenharmony_ci     reinitialise a plugin instance by calling deactivate() and then
474d5ac70f0Sopenharmony_ci     activate(). In this case the plugin instance must reset all state
475d5ac70f0Sopenharmony_ci     information dependent on the history of the plugin instance
476d5ac70f0Sopenharmony_ci     except for any data locations provided by connect_port() and any
477d5ac70f0Sopenharmony_ci     gain set by set_run_adding_gain(). If there is nothing for
478d5ac70f0Sopenharmony_ci     activate() to do then the plugin writer may provide a NULL rather
479d5ac70f0Sopenharmony_ci     than an empty function.
480d5ac70f0Sopenharmony_ci
481d5ac70f0Sopenharmony_ci     When present, hosts must call this function once before run() (or
482d5ac70f0Sopenharmony_ci     run_adding()) is called for the first time. This call should be
483d5ac70f0Sopenharmony_ci     made as close to the run() call as possible and indicates to
484d5ac70f0Sopenharmony_ci     real-time plugins that they are now live. Plugins should not rely
485d5ac70f0Sopenharmony_ci     on a prompt call to run() after activate(). activate() may not be
486d5ac70f0Sopenharmony_ci     called again unless deactivate() is called first. Note that
487d5ac70f0Sopenharmony_ci     connect_port() may be called before or after a call to
488d5ac70f0Sopenharmony_ci     activate(). */
489d5ac70f0Sopenharmony_ci  void (*activate)(LADSPA_Handle Instance);
490d5ac70f0Sopenharmony_ci
491d5ac70f0Sopenharmony_ci  /* This method is a function pointer that runs an instance of a
492d5ac70f0Sopenharmony_ci     plugin for a block. Two parameters are required: the first is a
493d5ac70f0Sopenharmony_ci     handle to the particular instance to be run and the second
494d5ac70f0Sopenharmony_ci     indicates the block size (in samples) for which the plugin
495d5ac70f0Sopenharmony_ci     instance may run.
496d5ac70f0Sopenharmony_ci
497d5ac70f0Sopenharmony_ci     Note that if an activate() function exists then it must be called
498d5ac70f0Sopenharmony_ci     before run() or run_adding(). If deactivate() is called for a
499d5ac70f0Sopenharmony_ci     plugin instance then the plugin instance may not be reused until
500d5ac70f0Sopenharmony_ci     activate() has been called again.
501d5ac70f0Sopenharmony_ci
502d5ac70f0Sopenharmony_ci     If the plugin has the property LADSPA_PROPERTY_HARD_RT_CAPABLE
503d5ac70f0Sopenharmony_ci     then there are various things that the plugin should not do
504d5ac70f0Sopenharmony_ci     within the run() or run_adding() functions (see above). */
505d5ac70f0Sopenharmony_ci  void (*run)(LADSPA_Handle Instance,
506d5ac70f0Sopenharmony_ci              unsigned long SampleCount);
507d5ac70f0Sopenharmony_ci
508d5ac70f0Sopenharmony_ci  /* This method is a function pointer that runs an instance of a
509d5ac70f0Sopenharmony_ci     plugin for a block. This has identical behaviour to run() except
510d5ac70f0Sopenharmony_ci     in the way data is output from the plugin. When run() is used,
511d5ac70f0Sopenharmony_ci     values are written directly to the memory areas associated with
512d5ac70f0Sopenharmony_ci     the output ports. However when run_adding() is called, values
513d5ac70f0Sopenharmony_ci     must be added to the values already present in the memory
514d5ac70f0Sopenharmony_ci     areas. Furthermore, output values written must be scaled by the
515d5ac70f0Sopenharmony_ci     current gain set by set_run_adding_gain() (see below) before
516d5ac70f0Sopenharmony_ci     addition.
517d5ac70f0Sopenharmony_ci
518d5ac70f0Sopenharmony_ci     run_adding() is optional. When it is not provided by a plugin,
519d5ac70f0Sopenharmony_ci     this function pointer must be set to NULL. When it is provided,
520d5ac70f0Sopenharmony_ci     the function set_run_adding_gain() must be provided also. */
521d5ac70f0Sopenharmony_ci  void (*run_adding)(LADSPA_Handle Instance,
522d5ac70f0Sopenharmony_ci                     unsigned long SampleCount);
523d5ac70f0Sopenharmony_ci
524d5ac70f0Sopenharmony_ci  /* This method is a function pointer that sets the output gain for
525d5ac70f0Sopenharmony_ci     use when run_adding() is called (see above). If this function is
526d5ac70f0Sopenharmony_ci     never called the gain is assumed to default to 1. Gain
527d5ac70f0Sopenharmony_ci     information should be retained when activate() or deactivate()
528d5ac70f0Sopenharmony_ci     are called.
529d5ac70f0Sopenharmony_ci
530d5ac70f0Sopenharmony_ci     This function should be provided by the plugin if and only if the
531d5ac70f0Sopenharmony_ci     run_adding() function is provided. When it is absent this
532d5ac70f0Sopenharmony_ci     function pointer must be set to NULL. */
533d5ac70f0Sopenharmony_ci  void (*set_run_adding_gain)(LADSPA_Handle Instance,
534d5ac70f0Sopenharmony_ci                              LADSPA_Data   Gain);
535d5ac70f0Sopenharmony_ci
536d5ac70f0Sopenharmony_ci  /* This is the counterpart to activate() (see above). If there is
537d5ac70f0Sopenharmony_ci     nothing for deactivate() to do then the plugin writer may provide
538d5ac70f0Sopenharmony_ci     a NULL rather than an empty function.
539d5ac70f0Sopenharmony_ci
540d5ac70f0Sopenharmony_ci     Hosts must deactivate all activated units after they have been
541d5ac70f0Sopenharmony_ci     run() (or run_adding()) for the last time. This call should be
542d5ac70f0Sopenharmony_ci     made as close to the last run() call as possible and indicates to
543d5ac70f0Sopenharmony_ci     real-time plugins that they are no longer live. Plugins should
544d5ac70f0Sopenharmony_ci     not rely on prompt deactivation. Note that connect_port() may be
545d5ac70f0Sopenharmony_ci     called before or after a call to deactivate().
546d5ac70f0Sopenharmony_ci
547d5ac70f0Sopenharmony_ci     Deactivation is not similar to pausing as the plugin instance
548d5ac70f0Sopenharmony_ci     will be reinitialised when activate() is called to reuse it. */
549d5ac70f0Sopenharmony_ci  void (*deactivate)(LADSPA_Handle Instance);
550d5ac70f0Sopenharmony_ci
551d5ac70f0Sopenharmony_ci  /* Once an instance of a plugin has been finished with it can be
552d5ac70f0Sopenharmony_ci     deleted using the following function. The instance handle passed
553d5ac70f0Sopenharmony_ci     ceases to be valid after this call.
554d5ac70f0Sopenharmony_ci
555d5ac70f0Sopenharmony_ci     If activate() was called for a plugin instance then a
556d5ac70f0Sopenharmony_ci     corresponding call to deactivate() must be made before cleanup()
557d5ac70f0Sopenharmony_ci     is called. */
558d5ac70f0Sopenharmony_ci  void (*cleanup)(LADSPA_Handle Instance);
559d5ac70f0Sopenharmony_ci
560d5ac70f0Sopenharmony_ci} LADSPA_Descriptor;
561d5ac70f0Sopenharmony_ci
562d5ac70f0Sopenharmony_ci/**********************************************************************/
563d5ac70f0Sopenharmony_ci
564d5ac70f0Sopenharmony_ci/* Accessing a Plugin: */
565d5ac70f0Sopenharmony_ci
566d5ac70f0Sopenharmony_ci/* The exact mechanism by which plugins are loaded is host-dependent,
567d5ac70f0Sopenharmony_ci   however all most hosts will need to know is the name of shared
568d5ac70f0Sopenharmony_ci   object file containing the plugin types. To allow multiple hosts to
569d5ac70f0Sopenharmony_ci   share plugin types, hosts may wish to check for environment
570d5ac70f0Sopenharmony_ci   variable LADSPA_PATH. If present, this should contain a
571d5ac70f0Sopenharmony_ci   colon-separated path indicating directories that should be searched
572d5ac70f0Sopenharmony_ci   (in order) when loading plugin types.
573d5ac70f0Sopenharmony_ci
574d5ac70f0Sopenharmony_ci   A plugin programmer must include a function called
575d5ac70f0Sopenharmony_ci   "ladspa_descriptor" with the following function prototype within
576d5ac70f0Sopenharmony_ci   the shared object file. This function will have C-style linkage (if
577d5ac70f0Sopenharmony_ci   you are using C++ this is taken care of by the `extern "C"' clause
578d5ac70f0Sopenharmony_ci   at the top of the file).
579d5ac70f0Sopenharmony_ci
580d5ac70f0Sopenharmony_ci   A host will find the plugin shared object file by one means or
581d5ac70f0Sopenharmony_ci   another, find the ladspa_descriptor() function, call it, and
582d5ac70f0Sopenharmony_ci   proceed from there.
583d5ac70f0Sopenharmony_ci
584d5ac70f0Sopenharmony_ci   Plugin types are accessed by index (not ID) using values from 0
585d5ac70f0Sopenharmony_ci   upwards. Out of range indexes must result in this function
586d5ac70f0Sopenharmony_ci   returning NULL, so the plugin count can be determined by checking
587d5ac70f0Sopenharmony_ci   for the least index that results in NULL being returned. */
588d5ac70f0Sopenharmony_ci
589d5ac70f0Sopenharmony_ciconst LADSPA_Descriptor * ladspa_descriptor(unsigned long Index);
590d5ac70f0Sopenharmony_ci
591d5ac70f0Sopenharmony_ci/* Datatype corresponding to the ladspa_descriptor() function. */
592d5ac70f0Sopenharmony_citypedef const LADSPA_Descriptor *
593d5ac70f0Sopenharmony_ci(*LADSPA_Descriptor_Function)(unsigned long Index);
594d5ac70f0Sopenharmony_ci
595d5ac70f0Sopenharmony_ci/**********************************************************************/
596d5ac70f0Sopenharmony_ci
597d5ac70f0Sopenharmony_ci#ifdef __cplusplus
598d5ac70f0Sopenharmony_ci}
599d5ac70f0Sopenharmony_ci#endif
600d5ac70f0Sopenharmony_ci
601d5ac70f0Sopenharmony_ci#endif /* LADSPA_INCLUDED */
602d5ac70f0Sopenharmony_ci
603d5ac70f0Sopenharmony_ci/* EOF */
604