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
25 #include "arraylist.h"
27 #include "assetpopup.inc"
30 #include "awindow.inc"
31 #include "awindowmenu.inc"
34 #include "indexable.inc"
35 #include "mwindow.inc"
36 #include "newfolder.inc"
37 #include "pluginserver.inc"
41 class AWindowNewFolder;
42 class AWindowDeleteFolder;
43 class AWindowRenameFolder;
44 class AWindowDeleteDisk;
45 class AWindowDeleteProject;
48 class AWindowRedrawIndex;
58 class AssetPicon : public BC_ListBoxItem
61 AssetPicon(MWindow *mwindow, AWindowGUI *gui, Indexable *indexable);
62 AssetPicon(MWindow *mwindow, AWindowGUI *gui, EDL *edl);
63 AssetPicon(MWindow *mwindow, AWindowGUI *gui, PluginServer *plugin);
64 AssetPicon(MWindow *mwindow, AWindowGUI *gui, const char *folder);
65 virtual ~AssetPicon();
67 void create_objects();
74 // ID of thing pointed to
77 // Check ID first. Update these next before dereferencing
90 class AWindowRemovePlugin;
92 class AWindowRemovePluginGUI : public BC_Window {
95 AWindowRemovePlugin *thread;
97 ArrayList<BC_ListBoxItem*> plugin_list;
102 void create_objects();
104 AWindowRemovePluginGUI(AWindow *awindow, AWindowRemovePlugin *thread,
105 int x, int y, PluginServer *plugin);
106 ~AWindowRemovePluginGUI();
109 class AWindowRemovePlugin : public BC_DialogThread {
112 PluginServer *plugin;
113 BC_Window* new_gui();
114 void handle_close_event(int result);
115 int remove_plugin(PluginServer *plugin, ArrayList<BC_ListBoxItem*> &folder);
117 AWindowRemovePlugin(AWindow *awindow, PluginServer *plugin);
118 ~AWindowRemovePlugin();
121 class AWindowGUI : public BC_Window
124 AWindowGUI(MWindow *mwindow, AWindow *awindow);
127 void create_objects();
128 int resize_event(int w, int h);
129 int translation_event();
131 int keypress_event();
132 void update_assets();
133 void update_effects();
135 void reposition_objects();
136 int current_folder_number();
137 // Call back for MWindow entry point
140 // Collect items into the drag vectors of MainSession
141 void collect_assets();
142 void create_persistent_folder(ArrayList<BC_ListBoxItem*> *output,
147 void copy_picons(ArrayList<BC_ListBoxItem*> *dst,
148 ArrayList<BC_ListBoxItem*> *src,
150 void sort_picons(ArrayList<BC_ListBoxItem*> *src,
152 // Return the selected asset in asset_list
153 Indexable* selected_asset();
154 PluginServer* selected_plugin();
155 AssetPicon* selected_folder();
156 bool protected_pixmap(BC_Pixmap *pixmap);
161 AWindowAssets *asset_list;
162 AWindowFolders *folder_list;
163 AWindowDivider *divider;
164 uint32_t plugin_visibility;
166 // Store data to speed up responses
167 // Persistant data for listboxes
168 // All assets in current EDL
169 ArrayList<BC_ListBoxItem*> assets;
170 ArrayList<BC_ListBoxItem*> folders;
171 ArrayList<BC_ListBoxItem*> aeffects;
172 ArrayList<BC_ListBoxItem*> veffects;
173 ArrayList<BC_ListBoxItem*> atransitions;
174 ArrayList<BC_ListBoxItem*> vtransitions;
176 // Currently displayed data for listboxes
177 // Currently displayed assets + comments
178 ArrayList<BC_ListBoxItem*> displayed_assets[2];
180 const char *asset_titles[ASSET_COLUMNS];
183 BC_Pixmap *folder_icon;
184 BC_Pixmap *file_icon;
185 BC_Pixmap *audio_icon;
186 BC_Pixmap *video_icon;
187 BC_Pixmap *clip_icon; VFrame *clip_vframe;
188 BC_Pixmap *atransition_icon; VFrame *atransition_vframe;
189 BC_Pixmap *vtransition_icon; VFrame *vtransition_vframe;
190 BC_Pixmap *aeffect_icon; VFrame *aeffect_vframe;
191 BC_Pixmap *ladspa_icon; VFrame *ladspa_vframe;
192 BC_Pixmap *veffect_icon; VFrame *veffect_vframe;
193 NewFolderThread *newfolder_thread;
196 AssetPopup *asset_menu;
197 AssetListMenu *assetlist_menu;
198 FolderListMenu *folderlist_menu;
200 // Temporary for reading picons from files
203 AWindowRemovePlugin *remove_plugin;
205 void update_folder_list();
206 void update_asset_list();
207 void filter_displayed_assets();
210 class AWindowAssets : public BC_ListBox
213 AWindowAssets(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h);
217 int selection_changed();
218 void draw_background();
219 int drag_start_event();
220 int drag_motion_event();
221 int drag_stop_event();
222 int button_press_event();
223 int column_resize_event();
229 class AWindowDivider : public BC_SubWindow
232 AWindowDivider(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h);
235 int button_press_event();
236 int cursor_motion_event();
237 int button_release_event();
243 class AWindowFolders : public BC_ListBox
246 AWindowFolders(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h);
249 int selection_changed();
250 int button_press_event();
256 class AWindowNewFolder : public BC_Button
259 AWindowNewFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y);
266 class AWindowDeleteFolder : public BC_Button
269 AWindowDeleteFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y);
276 class AWindowRenameFolder : public BC_Button
279 AWindowRenameFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y);
286 class AWindowDeleteDisk : public BC_Button
289 AWindowDeleteDisk(MWindow *mwindow, AWindowGUI *gui, int x, int y);
296 class AWindowDeleteProject : public BC_Button
299 AWindowDeleteProject(MWindow *mwindow, AWindowGUI *gui, int x, int y);
306 class AWindowInfo : public BC_Button
309 AWindowInfo(MWindow *mwindow, AWindowGUI *gui, int x, int y);
316 class AWindowRedrawIndex : public BC_Button
319 AWindowRedrawIndex(MWindow *mwindow, AWindowGUI *gui, int x, int y);
326 class AWindowPaste : public BC_Button
329 AWindowPaste(MWindow *mwindow, AWindowGUI *gui, int x, int y);
336 class AWindowAppend : public BC_Button
339 AWindowAppend(MWindow *mwindow, AWindowGUI *gui, int x, int y);
346 class AWindowView : public BC_Button
349 AWindowView(MWindow *mwindow, AWindowGUI *gui, int x, int y);
356 class AddTools : public BC_MenuBar
359 AddTools(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w);
360 void create_objects();
364 AddPluginsMenu *add_plugins;
367 class AddPluginsMenu : public BC_Menu
370 AddPluginsMenu(MWindow *mwindow, AWindowGUI *gui);
371 void create_objects();
377 class AddPluginItem : public BC_MenuItem
380 AddPluginItem(AddPluginsMenu *menu, const char *text, int idx);
383 AddPluginsMenu *menu;