vtl: send A/V offset to video-monitor when launched
[ardour.git] / gtk2_ardour / lv2_external_ui.h
1 /*
2     Copyright (C) 2012 Paul Davis 
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 /* -*- Mode: C ; c-basic-offset: 2 -*- */
21 /*****************************************************************************
22  *
23  *  This work is in public domain.
24  *
25  *  This file is distributed in the hope that it will be useful,
26  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
27  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
28  *
29  *  If you have questions, contact Nedko Arnaudov <nedko@arnaudov.name> or
30  *  ask in #lad channel, FreeNode IRC network.
31  *
32  *****************************************************************************/
33
34 #ifndef LV2_EXTERNAL_UI_H__5AFE09A5_0FB7_47AF_924E_2AF0F8DE8873__INCLUDED
35 #define LV2_EXTERNAL_UI_H__5AFE09A5_0FB7_47AF_924E_2AF0F8DE8873__INCLUDED
36
37 /** UI extension suitable for out-of-process UIs */
38 #define LV2_EXTERNAL_UI_URI "http://lv2plug.in/ns/extensions/ui#external"
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 #if 0
44 } /* Adjust editor indent */
45 #endif
46
47 /**
48  * When LV2_EXTERNAL_UI_URI UI is instantiated, the returned
49  * LV2UI_Widget handle must be cast to pointer to struct lv2_external_ui.
50  * UI is created in invisible state.
51  */
52 struct lv2_external_ui
53 {
54   /**
55    * Host calls this function regulary. UI library implementing the
56    * callback may do IPC or redraw the UI.
57    *
58    * @param _this_ the UI context
59    */
60   void (* run)(struct lv2_external_ui * _this_);
61
62   /**
63    * Host calls this function to make the plugin UI visible.
64    *
65    * @param _this_ the UI context
66    */
67   void (* show)(struct lv2_external_ui * _this_);
68
69   /**
70    * Host calls this function to make the plugin UI invisible again.
71    *
72    * @param _this_ the UI context
73    */
74   void (* hide)(struct lv2_external_ui * _this_);
75 };
76
77 #define LV2_EXTERNAL_UI_RUN(ptr) (ptr)->run(ptr)
78 #define LV2_EXTERNAL_UI_SHOW(ptr) (ptr)->show(ptr)
79 #define LV2_EXTERNAL_UI_HIDE(ptr) (ptr)->hide(ptr)
80
81 /**
82  * On UI instantiation, host must supply LV2_EXTERNAL_UI_URI
83  * feature. LV2_Feature::data must be pointer to struct lv2_external_ui_host. */
84 struct lv2_external_ui_host
85 {
86   /**
87    * Callback that plugin UI will call
88    * when UI (GUI window) is closed by user.
89    * This callback wil; be called during execution of lv2_external_ui::run()
90    * (i.e. not from background thread).
91    *
92    * After this callback is called, UI is defunct. Host must call
93    * LV2UI_Descriptor::cleanup(). If host wants to make the UI visible
94    * again UI must be reinstantiated.
95    *
96    * @param controller Host context associated with plugin UI, as
97    * supplied to LV2UI_Descriptor::instantiate()
98    */
99   void (* ui_closed)(void* controller);
100
101   /**
102    * Optional (may be NULL) "user friendly" identifier which the UI
103    * may display to allow a user to easily associate this particular
104    * UI instance with the correct plugin instance as it is represented
105    * by the host (e.g. "track 1" or "channel 4").
106    *
107    * If supplied by host, the string will be referenced only during
108    * LV2UI_Descriptor::instantiate()
109    */
110   const char * plugin_human_id;
111 };
112
113 #if 0
114 { /* Adjust editor indent */
115 #endif
116 #ifdef __cplusplus
117 } /* extern "C" */
118 #endif
119
120 #endif /* #ifndef LV2_EXTERNAL_UI_H__5AFE09A5_0FB7_47AF_924E_2AF0F8DE8873__INCLUDED */