Suil  0.6.0
suil.h
1 /*
2  Copyright 2011 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 <stdbool.h>
25 #include <stdint.h>
26 
27 #include "lv2/lv2plug.in/ns/lv2core/lv2.h"
28 
29 #ifdef SUIL_SHARED
30 # ifdef _WIN32
31 # define SUIL_LIB_IMPORT __declspec(dllimport)
32 # define SUIL_LIB_EXPORT __declspec(dllexport)
33 # else
34 # define SUIL_LIB_IMPORT __attribute__((visibility("default")))
35 # define SUIL_LIB_EXPORT __attribute__((visibility("default")))
36 # endif
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 
63 typedef struct SuilHostImpl SuilHost;
64 
66 typedef struct SuilInstanceImpl SuilInstance;
67 
69 typedef void* SuilWidget;
70 
79 typedef void* SuilController;
80 
82 typedef void (*SuilPortWriteFunc)(
83  SuilController controller,
84  uint32_t port_index,
85  uint32_t buffer_size,
86  uint32_t protocol,
87  void const* buffer);
88 
90 typedef uint32_t (*SuilPortIndexFunc)(
91  SuilController controller,
92  const char* port_symbol);
93 
95 typedef uint32_t (*SuilPortSubscribeFunc)(
96  SuilController controller,
97  uint32_t port_index,
98  uint32_t protocol,
99  const LV2_Feature* const* features);
100 
102 typedef uint32_t (*SuilPortUnsubscribeFunc)(
103  SuilController controller,
104  uint32_t port_index,
105  uint32_t protocol,
106  const LV2_Feature* const* features);
107 
109 typedef void (*SuilTouchFunc)(
110  SuilController controller,
111  uint32_t port_index,
112  bool grabbed);
113 
121 SUIL_API
122 SuilHost*
124  SuilPortIndexFunc index_func,
125  SuilPortSubscribeFunc subscribe_func,
126  SuilPortUnsubscribeFunc unsubscribe_func);
127 
133 SUIL_API
134 void
136  SuilTouchFunc touch_func);
137 
141 SUIL_API
142 void
143 suil_host_free(SuilHost* host);
144 
154 SUIL_API
155 unsigned
156 suil_ui_supported(const char* host_type_uri,
157  const char* ui_type_uri);
158 
172 SUIL_API
175  SuilController controller,
176  const char* container_type_uri,
177  const char* plugin_uri,
178  const char* ui_uri,
179  const char* ui_type_uri,
180  const char* ui_bundle_path,
181  const char* ui_binary_path,
182  const LV2_Feature* const* features);
183 
190 SUIL_API
191 void
193 
202 SUIL_API
203 SuilWidget
205 
209 SUIL_API
210 void
212  uint32_t port_index,
213  uint32_t buffer_size,
214  uint32_t format,
215  const void* buffer);
216 
220 SUIL_API
221 const void*
223  const char* uri);
224 
229 #ifdef __cplusplus
230 } /* extern "C" */
231 #endif
232 
233 #endif /* SUIL_SUIL_H */