Merge CV, ver=5.1; ops/methods from HV, and interface from CV where possible
[goodguy/history.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 class PluginDialogTextBox;
26 class PluginDialogDetach;
27 class PluginDialogNew;
28 class PluginDialogShared;
29 class PluginDialogModules;
30 class PluginDialogAttachNew;
31 class PluginDialogChangeNew;
32 class PluginDialogIn;
33 class PluginDialogOut;
34 class PluginDialogThru;
35 class PluginDialogSingle;
36 class PluginDialog;
37
38 #include "bcdialog.h"
39 #include "condition.inc"
40 #include "guicast.h"
41 #include "mutex.inc"
42 #include "mwindow.inc"
43 #include "plugin.inc"
44 #include "pluginserver.inc"
45 #include "sharedlocation.h"
46 #include "thread.h"
47 #include "track.inc"
48 #include "transition.inc"
49
50 class PluginDialogThread : public BC_DialogThread
51 {
52 public:
53         PluginDialogThread(MWindow *mwindow);
54         ~PluginDialogThread();
55
56 // Set up parameters for a transition menu.
57         void start_window(Track *track,
58                 Plugin *plugin,
59                 const char *title,
60                 int is_mainmenu,
61                 int data_type);
62         BC_Window* new_gui();
63         void handle_done_event(int result);
64         void handle_close_event(int result);
65
66         MWindow *mwindow;
67         Track *track;
68         int data_type;
69         Transition *transition;
70 // Plugin being modified if there is one
71         Plugin *plugin;
72         char window_title[BCTEXTLEN];
73 // If attaching from main menu
74         int is_mainmenu;
75
76
77 // type of attached plugin
78         int plugin_type;    // 0: none  1: plugin   2: shared plugin   3: module
79
80 // location of attached plugin if shared
81         SharedLocation shared_location;
82
83 // Title of attached plugin if new
84         char plugin_title[BCTEXTLEN];
85 // For the main menu invocation,
86 // attach 1 standalone on the first track and share it with other tracks
87         int single_standalone;
88 };
89
90 class PluginDialog : public BC_Window
91 {
92 public:
93         PluginDialog(MWindow *mwindow,
94                 PluginDialogThread *thread,
95                 const char *title,
96                 int x,
97                 int y);
98         ~PluginDialog();
99
100         void create_objects();
101
102         int attach_new(int number);
103         int attach_shared(int number);
104         int attach_module(int number);
105         void save_settings();
106         int resize_event(int w, int h);
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
116
117         PluginDialogThru *thru;
118
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
240 /*
241  * class PluginDialogAttachShared : public BC_GenericButton
242  * {
243  * public:
244  *      PluginDialogAttachShared(MWindow *mwindow, PluginDialog *dialog, int x, int y);
245  *      ~PluginDialogAttachShared();
246  *
247  *      int handle_event();
248  *      PluginDialog *dialog;
249  * };
250  *
251  * class PluginDialogChangeShared : public BC_GenericButton
252  * {
253  * public:
254  *    PluginDialogChangeShared(MWindow *mwindow, PluginDialog *dialog, int x, int y);
255  *    ~PluginDialogChangeShared();
256  *
257  *    int handle_event();
258  *    PluginDialog *dialog;
259  * };
260  *
261  *
262  * class PluginDialogAttachModule : public BC_GenericButton
263  * {
264  * public:
265  *      PluginDialogAttachModule(MWindow *mwindow, PluginDialog *dialog, int x, int y);
266  *      ~PluginDialogAttachModule();
267  *
268  *      int handle_event();
269  *      PluginDialog *dialog;
270  * };
271  *
272  * class PluginDialogChangeModule : public BC_GenericButton
273  * {
274  * public:
275  *    PluginDialogChangeModule(MWindow *mwindow, PluginDialog *dialog, int x, int y);
276  *    ~PluginDialogChangeModule();
277  *
278  *    int handle_event();
279  *    PluginDialog *dialog;
280  * }
281  */
282
283
284
285 #endif