Ardour  9.0-pre0-582-g084a23a80d
suil.h
Go to the documentation of this file.
1 /*
2  Copyright 2011-2017 David Robillard <http://drobilla.net>
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 
21 #ifndef SUIL_SUIL_H
22 #define SUIL_SUIL_H
23 
24 #include "lv2/core/lv2.h"
25 
26 #include <stdbool.h>
27 
28 #ifdef _WIN32
29 # define SUIL_LIB_IMPORT __declspec(dllimport)
30 # define SUIL_LIB_EXPORT __declspec(dllexport)
31 #else
32 # define SUIL_LIB_IMPORT __attribute__((visibility("default")))
33 # define SUIL_LIB_EXPORT __attribute__((visibility("default")))
34 #endif
35 
36 #ifdef SUIL_SHARED
37 # ifdef SUIL_INTERNAL
38 # define SUIL_API SUIL_LIB_EXPORT
39 # else
40 # define SUIL_API SUIL_LIB_IMPORT
41 # endif
42 #else
43 # define SUIL_API
44 #endif
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
72 typedef struct SuilHostImpl SuilHost;
73 
75 typedef struct SuilInstanceImpl SuilInstance;
76 
78 typedef void* SuilHandle;
79 
81 typedef void* SuilWidget;
82 
91 typedef void* SuilController;
92 
94 typedef void (*SuilPortWriteFunc)(
96  uint32_t port_index,
97  uint32_t buffer_size,
98  uint32_t protocol,
99  void const* buffer);
100 
102 typedef uint32_t (*SuilPortIndexFunc)(
104  const char* port_symbol);
105 
107 typedef uint32_t (*SuilPortSubscribeFunc)(
109  uint32_t port_index,
110  uint32_t protocol,
111  const LV2_Feature* const* features);
112 
114 typedef uint32_t (*SuilPortUnsubscribeFunc)(
116  uint32_t port_index,
117  uint32_t protocol,
118  const LV2_Feature* const* features);
119 
121 typedef void (*SuilTouchFunc)(
123  uint32_t port_index,
124  bool grabbed);
125 
127 typedef enum {
130 
139 SUIL_API
140 void
141 suil_init(int* argc, char*** argv, SuilArg key, ...);
142 
150 SUIL_API
151 SuilHost*
153  SuilPortIndexFunc index_func,
154  SuilPortSubscribeFunc subscribe_func,
155  SuilPortUnsubscribeFunc unsubscribe_func);
156 
162 SUIL_API
163 void
165  SuilTouchFunc touch_func);
166 
170 SUIL_API
171 void
173 
183 SUIL_API
184 unsigned
185 suil_ui_supported(const char* host_type_uri,
186  const char* ui_type_uri);
187 
212 SUIL_API
216  const char* container_type_uri,
217  const char* plugin_uri,
218  const char* ui_uri,
219  const char* ui_type_uri,
220  const char* ui_bundle_path,
221  const char* ui_binary_path,
222  const LV2_Feature* const* features);
223 
230 SUIL_API
231 void
233 
243 SUIL_API
246 
255 SUIL_API
258 
275 SUIL_API
276 void
278  uint32_t port_index,
279  uint32_t buffer_size,
280  uint32_t format,
281  const void* buffer);
282 
286 SUIL_API
287 const void*
289  const char* uri);
290 
295 #ifdef __cplusplus
296 } /* extern "C" */
297 #endif
298 
299 #endif /* SUIL_SUIL_H */
SuilHandle suil_instance_get_handle(SuilInstance *instance)
SuilArg
Definition: suil.h:127
SuilHost * suil_host_new(SuilPortWriteFunc write_func, SuilPortIndexFunc index_func, SuilPortSubscribeFunc subscribe_func, SuilPortUnsubscribeFunc unsubscribe_func)
void * SuilWidget
Definition: suil.h:81
void suil_init(int *argc, char ***argv, SuilArg key,...)
void suil_host_set_touch_func(SuilHost *host, SuilTouchFunc touch_func)
struct SuilInstanceImpl SuilInstance
Definition: suil.h:75
void suil_host_free(SuilHost *host)
uint32_t(* SuilPortIndexFunc)(SuilController controller, const char *port_symbol)
Definition: suil.h:102
uint32_t(* SuilPortUnsubscribeFunc)(SuilController controller, uint32_t port_index, uint32_t protocol, const LV2_Feature *const *features)
Definition: suil.h:114
void suil_instance_free(SuilInstance *instance)
unsigned suil_ui_supported(const char *host_type_uri, const char *ui_type_uri)
struct SuilHostImpl SuilHost
Definition: suil.h:72
void * SuilHandle
Definition: suil.h:78
SuilWidget suil_instance_get_widget(SuilInstance *instance)
const void * suil_instance_extension_data(SuilInstance *instance, const char *uri)
void * SuilController
Definition: suil.h:91
void suil_instance_port_event(SuilInstance *instance, uint32_t port_index, uint32_t buffer_size, uint32_t format, const void *buffer)
uint32_t(* SuilPortSubscribeFunc)(SuilController controller, uint32_t port_index, uint32_t protocol, const LV2_Feature *const *features)
Definition: suil.h:107
SuilInstance * suil_instance_new(SuilHost *host, SuilController controller, const char *container_type_uri, const char *plugin_uri, const char *ui_uri, const char *ui_type_uri, const char *ui_bundle_path, const char *ui_binary_path, const LV2_Feature *const *features)
void(* SuilPortWriteFunc)(SuilController controller, uint32_t port_index, uint32_t buffer_size, uint32_t protocol, void const *buffer)
Definition: suil.h:94
void(* SuilTouchFunc)(SuilController controller, uint32_t port_index, bool grabbed)
Definition: suil.h:121
@ SUIL_ARG_NONE
Definition: suil.h:128
#define SUIL_API
Definition: suil.h:43