Ardour  9.0-pre0-582-g084a23a80d
lv2_extensions.h
Go to the documentation of this file.
1 /*
2  Copyright 2016 Robin Gareus <robin@gareus.org>
3 
4  Permission to use, copy, modify, and/or distribute this software for any
5  purpose with or without fee is hereby granted, provided that the above
6  copyright notice and this permission notice appear in all copies.
7 
8  THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16 
17 #ifndef _ardour_lv2_extensions_h_
18 #define _ardour_lv2_extensions_h_
19 
20 #ifdef HAVE_LV2_1_18_6
21 #include <lv2/core/lv2.h>
22 #include <lv2/options/options.h>
23 #else
24 #include <lv2/lv2plug.in/ns/lv2core/lv2.h>
25 #include <lv2/lv2plug.in/ns/ext/options/options.h>
26 #endif
27 
37 #define LV2_INLINEDISPLAY_URI "http://harrisonconsoles.com/lv2/inlinedisplay"
38 #define LV2_INLINEDISPLAY_PREFIX LV2_INLINEDISPLAY_URI "#"
39 #define LV2_INLINEDISPLAY__interface LV2_INLINEDISPLAY_PREFIX "interface"
40 #define LV2_INLINEDISPLAY__queue_draw LV2_INLINEDISPLAY_PREFIX "queue_draw"
41 #define LV2_INLINEDISPLAY__in_gui LV2_INLINEDISPLAY_PREFIX "in_gui"
42 
45 
50 typedef struct {
51  unsigned char *data;
52  int width;
53  int height;
54  int stride;
56 
58 typedef struct {
63  void (*queue_draw)(LV2_Inline_Display_Handle handle);
65 
69 typedef struct {
81  LV2_Inline_Display_Image_Surface* (*render)(LV2_Handle instance, uint32_t w, uint32_t h);
83 
96 #define LV2_AUTOMATE_URI "http://ardour.org/lv2/automate"
97 #define LV2_AUTOMATE_URI_PREFIX LV2_AUTOMATE_URI "#"
99 #define LV2_AUTOMATE_URI__can_write LV2_AUTOMATE_URI_PREFIX "canWriteAutomatation"
101 #define LV2_AUTOMATE_URI__control LV2_AUTOMATE_URI_PREFIX "automationControl"
103 #define LV2_AUTOMATE_URI__controlled LV2_AUTOMATE_URI_PREFIX "automationControlled"
104 #define LV2_AUTOMATE_URI__controller LV2_AUTOMATE_URI_PREFIX "automationController"
105 
107 #define LV2_AUTOMATE_URI__event LV2_AUTOMATE_URI_PREFIX "event"
108 #define LV2_AUTOMATE_URI__setup LV2_AUTOMATE_URI_PREFIX "setup"
109 #define LV2_AUTOMATE_URI__finalize LV2_AUTOMATE_URI_PREFIX "finalize"
110 #define LV2_AUTOMATE_URI__start LV2_AUTOMATE_URI_PREFIX "start"
111 #define LV2_AUTOMATE_URI__end LV2_AUTOMATE_URI_PREFIX "end"
112 #define LV2_AUTOMATE_URI__parameter LV2_AUTOMATE_URI_PREFIX "parameter"
113 #define LV2_AUTOMATE_URI__value LV2_AUTOMATE_URI_PREFIX "value"
114 
128 #define LV2_PLUGINLICENSE_URI "http://harrisonconsoles.com/lv2/license"
129 #define LV2_PLUGINLICENSE_PREFIX LV2_PLUGINLICENSE_URI "#"
130 #define LV2_PLUGINLICENSE__interface LV2_PLUGINLICENSE_PREFIX "interface"
131 #define LV2_PLUGINLICENSE__interface2 LV2_PLUGINLICENSE_PREFIX "interface2"
132 
133 
134 typedef struct _LV2_License_Interface {
135  /* @return -1 if no license is needed; 0 if unlicensed, 1 if licensed */
136  int (*is_licensed)(LV2_Handle instance);
137  /* @return a string copy of the licensee name if licensed, or NULL, the caller needs to free this */
138  char* (*licensee)(LV2_Handle instance);
139  /* @return a URI identifying the plugin-bundle or plugin for which a given license is valid */
140  const char* (*product_uri)(LV2_Handle instance);
141  /* @return human readable product name for the URI */
142  const char* (*product_name)(LV2_Handle instance);
143  /* @return link to website or webstore */
144  const char* (*store_url)(LV2_Handle instance);
145  /* interface2 ext: preferred location to install the license file, the caller needs to free this */
146  char* (*preferred_license_file_path)(LV2_Handle instance);
147  /* interface2 ext: currently used license file (if any, may be NULL), the caller needs to free this */
148  char* (*current_license_file_path)(LV2_Handle instance);
149  /* interface2 ext: free() allocated strings (licensee, license_file_paths) */
150  void (*free)(char*);
152 
181 #define LV2_PROCESSING_URI "http://ardour.org/lv2/processing"
182 #define LV2_PROCESSING_URI_PREFIX LV2_PROCESSING_URI "#"
183 #define LV2_PROCESSING_URI__enable LV2_PROCESSING_URI_PREFIX "enable"
184 
204 #define LV2_ROUTING_URI "http://harrisonconsoles.com/lv2/routing"
205 #define LV2_ROUTING_PREFIX LV2_ROUTING_URI "#"
206 #define LV2_ROUTING__connectAllOutputs LV2_ROUTING_PREFIX "connectAllOutputs"
207 
219 #define LV2_MIDNAM_URI "http://ardour.org/lv2/midnam"
220 #define LV2_MIDNAM_PREFIX LV2_MIDNAM_URI "#"
221 #define LV2_MIDNAM__interface LV2_MIDNAM_PREFIX "interface"
222 #define LV2_MIDNAM__update LV2_MIDNAM_PREFIX "update"
223 
224 typedef void* LV2_Midnam_Handle;
225 
227 typedef struct {
231  void (*update)(LV2_Midnam_Handle handle);
232 } LV2_Midnam;
233 
234 typedef struct {
243  char* (*midnam)(LV2_Handle instance);
244 
248  char* (*model)(LV2_Handle instance);
249 
254  void (*free)(char*);
256 
271 #define LV2_BANKPATCH_URI "http://ardour.org/lv2/bankpatch"
272 #define LV2_BANKPATCH_PREFIX LV2_BANKPATCH_URI "#"
273 #define LV2_BANKPATCH__notify LV2_BANKPATCH_PREFIX "notify"
274 
275 typedef void* LV2_BankPatch_Handle;
276 
278 typedef struct {
282  void (*notify)(LV2_BankPatch_Handle handle, uint8_t channel, uint32_t bank, uint8_t pgm);
283 } LV2_BankPatch;
284 
298 #define LV2_EXPORT_URI "http://ardour.org/lv2/export"
299 #define LV2_EXPORT_PREFIX LV2_EXPORT_URI "#"
300 #define LV2_EXPORT__interface LV2_EXPORT_PREFIX "interface"
301 
303 typedef struct {
305  int (*setup)(LV2_Handle, const char*, LV2_Options_Option const*);
307  int (*finalize)(LV2_Handle);
309 
313 #endif
void * LV2_BankPatch_Handle
void * LV2_Inline_Display_Handle
struct _LV2_License_Interface LV2_License_Interface
void * LV2_Midnam_Handle
LV2_BankPatch_Handle handle
LV2_Inline_Display_Handle handle
LV2_Midnam_Handle handle
void(* free)(char *)
int(* is_licensed)(LV2_Handle instance)