1 /*
2   LV2 Data Access Extension
3   Copyright 2008-2011 David Robillard <http://drobilla.net>
4 
5   Permission to use, copy, modify, and/or distribute this software for any
6   purpose with or without fee is hereby granted, provided that the above
7   copyright notice and this permission notice appear in all copies.
8 
9   THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10   WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11   MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12   ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17 
18 /**
19    @file data-access.h
20    C header for the LV2 Extension Data extension
21    <http://lv2plug.in/ns/ext/data-access>.
22 
23    This extension defines a method for (e.g.) plugin UIs to have (possibly
24    marshalled) access to the extension_data function on a plugin instance.
25 */
26 
27 #ifndef LV2_DATA_ACCESS_H
28 #define LV2_DATA_ACCESS_H
29 
30 #define LV2_DATA_ACCESS_URI "http://lv2plug.in/ns/ext/data-access"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /**
37    The data field of the LV2_Feature for this extension.
38 
39    To support this feature the host must pass an LV2_Feature struct to the
40    instantiate method with URI "http://lv2plug.in/ns/ext/data-access"
41    and data pointed to an instance of this struct.
42 */
43 typedef struct {
44 	/**
45 	   A pointer to a method the UI can call to get data (of a type specified
46 	   by some other extension) from the plugin.
47 
48 	   This call never is never guaranteed to return anything, UIs should
49 	   degrade gracefully if direct access to the plugin data is not possible
50 	   (in which case this function will return NULL).
51 
52 	   This is for access to large data that can only possibly work if the UI
53 	   and plugin are running in the same process.  For all other things, use
54 	   the normal LV2 UI communication system.
55 	*/
56 	const void* (*data_access)(const char* uri);
57 } LV2_Extension_Data_Feature;
58 
59 #ifdef __cplusplus
60 }  /* extern "C" */
61 #endif
62 
63 #endif  /* LV2_DATA_ACCESS_H */
64