Ardour  9.0-pre0-1851-g4ef4288b2a
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 
172 #define LV2_ROUTING_URI "http://harrisonconsoles.com/lv2/routing"
173 #define LV2_ROUTING_PREFIX LV2_ROUTING_URI "#"
174 #define LV2_ROUTING__connectAllOutputs LV2_ROUTING_PREFIX "connectAllOutputs"
175 
187 #define LV2_MIDNAM_URI "http://ardour.org/lv2/midnam"
188 #define LV2_MIDNAM_PREFIX LV2_MIDNAM_URI "#"
189 #define LV2_MIDNAM__interface LV2_MIDNAM_PREFIX "interface"
190 #define LV2_MIDNAM__update LV2_MIDNAM_PREFIX "update"
191 
192 typedef void* LV2_Midnam_Handle;
193 
195 typedef struct {
199  void (*update)(LV2_Midnam_Handle handle);
200 } LV2_Midnam;
201 
202 typedef struct {
211  char* (*midnam)(LV2_Handle instance);
212 
216  char* (*model)(LV2_Handle instance);
217 
222  void (*free)(char*);
224 
239 #define LV2_BANKPATCH_URI "http://ardour.org/lv2/bankpatch"
240 #define LV2_BANKPATCH_PREFIX LV2_BANKPATCH_URI "#"
241 #define LV2_BANKPATCH__notify LV2_BANKPATCH_PREFIX "notify"
242 
243 typedef void* LV2_BankPatch_Handle;
244 
246 typedef struct {
250  void (*notify)(LV2_BankPatch_Handle handle, uint8_t channel, uint32_t bank, uint8_t pgm);
251 } LV2_BankPatch;
252 
266 #define LV2_EXPORT_URI "http://ardour.org/lv2/export"
267 #define LV2_EXPORT_PREFIX LV2_EXPORT_URI "#"
268 #define LV2_EXPORT__interface LV2_EXPORT_PREFIX "interface"
269 
271 typedef struct {
273  int (*setup)(LV2_Handle, const char*, LV2_Options_Option const*);
275  int (*finalize)(LV2_Handle);
277 
281 #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)