1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
// Copyright 2017 Stefan Riha
// Documentation copied from http://lv2plug.in/ns/extensions/ui/ui.h
// Copyright text of the original C file:
// LV2 UI Extension
// Copyright 2009-2016 David Robillard <d@drobilla.net>
// Copyright 2006-2011 Lars Luthman <lars.luthman@gmail.com>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
//! Documentation of the corresponding C header files: <http://lv2plug.in/ns/extensions/ui/ui.html>.
use *;
use crateLV2Feature;
/**
A pointer to UI instance internals.
The host may compare this to NULL, but otherwise MUST NOT interpret it.
*/
pub type LV2UIHandle = *mut c_void;
/**
A pointer to some widget or other type of UI handle.
The actual type is defined by the type of the UI.
*/
pub type LV2UIWidget = *mut c_void;
/**
A pointer to a controller provided by the host.
The UI may compare this to NULL, but otherwise MUST NOT interpret it.
*/
pub type LV2UIControllerRaw = *const c_void;
/**
A host-provided function that sends data to a plugin's input ports.
@param controller The opaque controller pointer passed to
LV2UI_Descriptor::instantiate().
@param port_index Index of the port to update.
@param buffer Buffer containing `buffer_size` bytes of data.
@param buffer_size Size of `buffer` in bytes.
@param port_protocol Either 0 or the URID for a ui:PortProtocol. If 0, the
protocol is implicitly ui:floatProtocol, the port MUST be an lv2:ControlPort
input, `buffer` MUST point to a single float value, and `buffer_size` MUST
be sizeof(float). The UI SHOULD NOT use a protocol not supported by the
host, but the host MUST gracefully ignore any protocol it does not
understand.
*/
pub type LV2UIWriteFunctionRaw = ;
/**
A plugin UI.
A pointer to an object of this type is returned by the lv2ui_descriptor()
function.
*/
/**
UI Idle Interface (LV2_UI__idleInterface)
UIs can provide this interface to have an idle() callback called by the host
rapidly to update the UI.
*/
/**
UI Show Interface (LV2_UI__showInterface)
UIs can provide this interface to show and hide a window, which allows them
to function in hosts unable to embed their widget. This allows any UI to
provide a fallback for embedding that works in any host.
If used:
- The host MUST use LV2UI_Idle_Interface to drive the UI.
- The UI MUST return non-zero from LV2UI_Idle_Interface::idle() when it has been closed.
- If idle() returns non-zero, the host MUST call hide() and stop calling
idle(). It MAY later call show() then resume calling idle().
*/
// RUST_TODO: The following are deprecated, should not declare this here. Ardour and Qtractor do not implement ui:showInterface
// http://lists.lv2plug.in/pipermail/devel-lv2plug.in/2016-May/001649.html
// http://kxstudio.linuxaudio.org/ns/lv2ext/lv2_external_ui.h
/**
* When LV2_EXTERNAL_UI__Widget UI is instantiated, the returned
* LV2UI_Widget handle must be cast to pointer to LV2_External_UI_Widget.
* UI is created in invisible state.
*/
/**
* On UI instantiation, host must supply LV2_EXTERNAL_UI__Host feature.
* LV2_Feature::data must be pointer to LV2_External_UI_Host.
*/