fix awdw solo vicon crash, fix nested clip for binfolders, open edit edl
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / plugindialog.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #ifndef PLUGINDIALOG_H
23 #define PLUGINDIALOG_H
24
25 #include "bcdialog.h"
26 #include "condition.inc"
27 #include "guicast.h"
28 #include "mutex.inc"
29 #include "mwindow.inc"
30 #include "plugin.inc"
31 #include "plugindialog.inc"
32 #include "pluginserver.inc"
33 #include "sharedlocation.h"
34 #include "thread.h"
35 #include "track.inc"
36 #include "transition.inc"
37
38 class PluginDialogThread : public BC_DialogThread
39 {
40 public:
41         PluginDialogThread(MWindow *mwindow);
42         ~PluginDialogThread();
43
44 // Set up parameters for a transition menu.
45         void start_window(Track *track,
46                 Plugin *plugin,
47                 const char *title,
48                 int is_mainmenu,
49                 int data_type);
50         BC_Window* new_gui();
51         void handle_done_event(int result);
52         void handle_close_event(int result);
53         void apply();
54
55         MWindow *mwindow;
56         Track *track;
57         int data_type;
58         Transition *transition;
59 // Plugin being modified if there is one
60         int plugin_id;
61         char window_title[BCTEXTLEN];
62 // If attaching from main menu
63         int is_mainmenu;
64
65
66 // type of attached plugin
67         int plugin_type;    // 0: none  1: plugin   2: shared plugin   3: module
68
69 // location of attached plugin if shared
70         SharedLocation shared_location;
71
72 // Title of attached plugin if new
73         char plugin_title[BCTEXTLEN];
74 // For the main menu invocation,
75 // attach 1 standalone on the first track and share it with other tracks
76         int single_standalone;
77 };
78
79 class PluginDialogListItem : public BC_ListBoxItem
80 {
81 public:
82         PluginDialogListItem(const char *item, int n)
83          : BC_ListBoxItem(item), item_no(n) {}
84         int item_no;
85 };
86
87 class PluginDialog : public BC_Window
88 {
89 public:
90         PluginDialog(MWindow *mwindow,
91                 PluginDialogThread *thread,
92                 const char *title,
93                 int x,
94                 int y);
95         ~PluginDialog();
96
97         void create_objects();
98
99         int attach_new(int number);
100         int attach_shared(int number);
101         int attach_module(int number);
102         void save_settings();
103         int resize_event(int w, int h);
104         void load_plugin_list(int redraw);
105         void clear_selection();
106         void apply();
107
108         BC_Title *standalone_title;
109         PluginDialogNew *standalone_list;
110         BC_Title *shared_title;
111         PluginDialogShared *shared_list;
112         BC_Title *module_title;
113         PluginDialogModules *module_list;
114         PluginDialogSingle *single_standalone;
115         PluginDialogSearchText *search_text;
116         BC_OKButton *ok_btn;
117         BC_CancelButton *can_btn;
118         PluginDialogApply *apy_btn;
119         PluginDialogThread *thread;
120
121         ArrayList<BC_ListBoxItem*> standalone_data;
122         ArrayList<BC_ListBoxItem*> shared_data;
123         ArrayList<BC_ListBoxItem*> module_data;
124         ArrayList<SharedLocation*> plugin_locations; // locations of all shared plugins
125         ArrayList<SharedLocation*> module_locations; // locations of all shared modules
126         ArrayList<PluginServer*> plugindb;           // locations of all simple plugins, no need for memory freeing!
127
128         int selected_available;
129         int selected_shared;
130         int selected_modules;
131
132         MWindow *mwindow;
133 };
134
135
136 /*
137  * class PluginDialogTextBox : public BC_TextBox
138  * {
139  * public:
140  *      PluginDialogTextBox(PluginDialog *dialog, char *text, int x, int y);
141  *      ~PluginDialogTextBox();
142  *
143  *      int handle_event();
144  *      PluginDialog *dialog;
145  * };
146  */
147
148 /*
149  * class PluginDialogDetach : public BC_GenericButton
150  * {
151  * public:
152  *      PluginDialogDetach(MWindow *mwindow, PluginDialog *dialog, int x, int y);
153  *      ~PluginDialogDetach();
154  *
155  *      int handle_event();
156  *      PluginDialog *dialog;
157  * };
158  */
159
160 /*
161  * class PluginDialogAttachNew : public BC_GenericButton
162  * {
163  * public:
164  *      PluginDialogAttachNew(MWindow *mwindow, PluginDialog *dialog, int x, int y);
165  *      ~PluginDialogAttachNew();
166  *
167  *      int handle_event();
168  *      PluginDialog *dialog;
169  * };
170  *
171  * class PluginDialogChangeNew : public BC_GenericButton
172  * {
173  * public:
174  *    PluginDialogChangeNew(MWindow *mwindow, PluginDialog *dialog, int x, int y);
175  *    ~PluginDialogChangeNew();
176  *
177  *    int handle_event();
178  *    PluginDialog *dialog;
179  * };
180  */
181
182
183 class PluginDialogNew : public BC_ListBox
184 {
185 public:
186         PluginDialogNew(PluginDialog *dialog,
187                 ArrayList<BC_ListBoxItem*> *standalone_data,
188                 int x,
189                 int y,
190                 int w,
191                 int h);
192         ~PluginDialogNew();
193
194         int handle_event();
195         int selection_changed();
196         PluginDialog *dialog;
197 };
198
199 class PluginDialogShared : public BC_ListBox
200 {
201 public:
202         PluginDialogShared(PluginDialog *dialog,
203                 ArrayList<BC_ListBoxItem*> *shared_data,
204                 int x,
205                 int y,
206                 int w,
207                 int h);
208         ~PluginDialogShared();
209
210         int handle_event();
211         int selection_changed();
212         PluginDialog *dialog;
213 };
214
215 class PluginDialogModules : public BC_ListBox
216 {
217 public:
218         PluginDialogModules(PluginDialog *dialog,
219                 ArrayList<BC_ListBoxItem*> *module_data,
220                 int x,
221                 int y,
222                 int w,
223                 int h);
224         ~PluginDialogModules();
225
226         int handle_event();
227         int selection_changed();
228         PluginDialog *dialog;
229 };
230
231 class PluginDialogSingle : public BC_CheckBox
232 {
233 public:
234         PluginDialogSingle(PluginDialog *dialog, int x, int y);
235         int handle_event();
236         PluginDialog *dialog;
237 };
238
239 class PluginDialogSearchText : public BC_TextBox
240 {
241 public:
242         PluginDialogSearchText(PluginDialog *dialog, int x, int y, int w);
243         int handle_event();
244
245         PluginDialog *dialog;
246 };
247
248 class PluginDialogApply : public BC_GenericButton
249 {
250 public:
251         PluginDialogApply(PluginDialog *dialog, int x, int y);
252         int handle_event();
253
254         PluginDialog *dialog;
255 };
256 /*
257  * class PluginDialogAttachShared : public BC_GenericButton
258  * {
259  * public:
260  *      PluginDialogAttachShared(MWindow *mwindow, PluginDialog *dialog, int x, int y);
261  *      ~PluginDialogAttachShared();
262  *
263  *      int handle_event();
264  *      PluginDialog *dialog;
265  * };
266  *
267  * class PluginDialogChangeShared : public BC_GenericButton
268  * {
269  * public:
270  *    PluginDialogChangeShared(MWindow *mwindow, PluginDialog *dialog, int x, int y);
271  *    ~PluginDialogChangeShared();
272  *
273  *    int handle_event();
274  *    PluginDialog *dialog;
275  * };
276  *
277  *
278  * class PluginDialogAttachModule : public BC_GenericButton
279  * {
280  * public:
281  *      PluginDialogAttachModule(MWindow *mwindow, PluginDialog *dialog, int x, int y);
282  *      ~PluginDialogAttachModule();
283  *
284  *      int handle_event();
285  *      PluginDialog *dialog;
286  * };
287  *
288  * class PluginDialogChangeModule : public BC_GenericButton
289  * {
290  * public:
291  *    PluginDialogChangeModule(MWindow *mwindow, PluginDialog *dialog, int x, int y);
292  *    ~PluginDialogChangeModule();
293  *
294  *    int handle_event();
295  *    PluginDialog *dialog;
296  * }
297  */
298
299
300
301 #endif