4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
22 #ifndef PLUGINDIALOG_H
23 #define PLUGINDIALOG_H
26 #include "condition.inc"
29 #include "mwindow.inc"
31 #include "plugindialog.inc"
32 #include "pluginserver.inc"
33 #include "sharedlocation.h"
36 #include "transition.inc"
38 class PluginDialogThread : public BC_DialogThread
41 PluginDialogThread(MWindow *mwindow);
42 ~PluginDialogThread();
44 // Set up parameters for a transition menu.
45 void start_window(Track *track,
51 void handle_done_event(int result);
52 void handle_close_event(int result);
58 Transition *transition;
59 // Plugin being modified if there is one
61 char window_title[BCTEXTLEN];
62 // If attaching from main menu
66 // type of attached plugin
67 int plugin_type; // 0: none 1: plugin 2: shared plugin 3: module
69 // location of attached plugin if shared
70 SharedLocation shared_location;
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;
79 class PluginDialogListItem : public BC_ListBoxItem
82 PluginDialogListItem(const char *item, int n)
83 : BC_ListBoxItem(item), item_no(n) {}
87 class PluginDialog : public BC_Window
90 PluginDialog(MWindow *mwindow,
91 PluginDialogThread *thread,
97 void create_objects();
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();
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;
117 BC_CancelButton *can_btn;
118 PluginDialogApply *apy_btn;
119 PluginDialogThread *thread;
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!
128 int selected_available;
130 int selected_modules;
137 * class PluginDialogTextBox : public BC_TextBox
140 * PluginDialogTextBox(PluginDialog *dialog, char *text, int x, int y);
141 * ~PluginDialogTextBox();
143 * int handle_event();
144 * PluginDialog *dialog;
149 * class PluginDialogDetach : public BC_GenericButton
152 * PluginDialogDetach(MWindow *mwindow, PluginDialog *dialog, int x, int y);
153 * ~PluginDialogDetach();
155 * int handle_event();
156 * PluginDialog *dialog;
161 * class PluginDialogAttachNew : public BC_GenericButton
164 * PluginDialogAttachNew(MWindow *mwindow, PluginDialog *dialog, int x, int y);
165 * ~PluginDialogAttachNew();
167 * int handle_event();
168 * PluginDialog *dialog;
171 * class PluginDialogChangeNew : public BC_GenericButton
174 * PluginDialogChangeNew(MWindow *mwindow, PluginDialog *dialog, int x, int y);
175 * ~PluginDialogChangeNew();
177 * int handle_event();
178 * PluginDialog *dialog;
183 class PluginDialogNew : public BC_ListBox
186 PluginDialogNew(PluginDialog *dialog,
187 ArrayList<BC_ListBoxItem*> *standalone_data,
195 int selection_changed();
196 int keypress_event();
197 PluginDialog *dialog;
200 class PluginDialogShared : public BC_ListBox
203 PluginDialogShared(PluginDialog *dialog,
204 ArrayList<BC_ListBoxItem*> *shared_data,
209 ~PluginDialogShared();
212 int selection_changed();
213 PluginDialog *dialog;
216 class PluginDialogModules : public BC_ListBox
219 PluginDialogModules(PluginDialog *dialog,
220 ArrayList<BC_ListBoxItem*> *module_data,
225 ~PluginDialogModules();
228 int selection_changed();
229 PluginDialog *dialog;
232 class PluginDialogSingle : public BC_CheckBox
235 PluginDialogSingle(PluginDialog *dialog, int x, int y);
237 PluginDialog *dialog;
240 class PluginDialogSearchText : public BC_TextBox
243 PluginDialogSearchText(PluginDialog *dialog, int x, int y, int w);
246 PluginDialog *dialog;
249 class PluginDialogApply : public BC_GenericButton
252 PluginDialogApply(PluginDialog *dialog, int x, int y);
255 PluginDialog *dialog;
258 * class PluginDialogAttachShared : public BC_GenericButton
261 * PluginDialogAttachShared(MWindow *mwindow, PluginDialog *dialog, int x, int y);
262 * ~PluginDialogAttachShared();
264 * int handle_event();
265 * PluginDialog *dialog;
268 * class PluginDialogChangeShared : public BC_GenericButton
271 * PluginDialogChangeShared(MWindow *mwindow, PluginDialog *dialog, int x, int y);
272 * ~PluginDialogChangeShared();
274 * int handle_event();
275 * PluginDialog *dialog;
279 * class PluginDialogAttachModule : public BC_GenericButton
282 * PluginDialogAttachModule(MWindow *mwindow, PluginDialog *dialog, int x, int y);
283 * ~PluginDialogAttachModule();
285 * int handle_event();
286 * PluginDialog *dialog;
289 * class PluginDialogChangeModule : public BC_GenericButton
292 * PluginDialogChangeModule(MWindow *mwindow, PluginDialog *dialog, int x, int y);
293 * ~PluginDialogChangeModule();
295 * int handle_event();
296 * PluginDialog *dialog;