annotate Plugins/Effect/ladspa/ladspa.h @ 395:0923a41170bb trunk

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