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"
42 class AWindowNewFolder;
43 class AWindowDeleteFolder;
44 class AWindowRenameFolder;
45 class AWindowDeleteDisk;
46 class AWindowDeleteProject;
49 class AWindowRedrawIndex;
62 class AssetPicon : public BC_ListBoxItem
65 AssetPicon(MWindow *mwindow, AWindowGUI *gui, Indexable *indexable);
66 AssetPicon(MWindow *mwindow, AWindowGUI *gui, EDL *edl);
67 AssetPicon(MWindow *mwindow, AWindowGUI *gui, PluginServer *plugin);
68 AssetPicon(MWindow *mwindow, AWindowGUI *gui, const char *folder);
69 virtual ~AssetPicon();
71 void create_objects();
78 // ID of thing pointed to
81 // Check ID first. Update these next before dereferencing
95 class AssetVIcon : public VIcon {
102 int64_t set_seq_no(int64_t no);
106 AssetVIcon(AssetPicon *picon, int w, int h, double framerate, int64_t length);
110 class AWindowRemovePlugin;
112 class AWindowRemovePluginGUI : public BC_Window {
115 AWindowRemovePlugin *thread;
116 PluginServer *plugin;
117 ArrayList<BC_ListBoxItem*> plugin_list;
122 void create_objects();
124 AWindowRemovePluginGUI(AWindow *awindow, AWindowRemovePlugin *thread,
125 int x, int y, PluginServer *plugin);
126 ~AWindowRemovePluginGUI();
129 class AWindowRemovePlugin : public BC_DialogThread {
132 PluginServer *plugin;
133 BC_Window* new_gui();
134 void handle_close_event(int result);
135 int remove_plugin(PluginServer *plugin, ArrayList<BC_ListBoxItem*> &folder);
137 AWindowRemovePlugin(AWindow *awindow, PluginServer *plugin);
138 ~AWindowRemovePlugin();
141 class AWindowGUI : public BC_Window
144 AWindowGUI(MWindow *mwindow, AWindow *awindow);
147 void create_objects();
148 int resize_event(int w, int h);
149 int translation_event();
151 int keypress_event();
152 void update_assets();
153 void update_effects();
155 void reposition_objects();
156 int current_folder_number();
157 // Call back for MWindow entry point
160 // Collect items into the drag vectors of MainSession
161 void collect_assets();
162 void create_persistent_folder(ArrayList<BC_ListBoxItem*> *output,
167 void copy_picons(ArrayList<BC_ListBoxItem*> *dst,
168 ArrayList<BC_ListBoxItem*> *src,
170 void sort_picons(ArrayList<BC_ListBoxItem*> *src,
172 // Return the selected asset in asset_list
173 Indexable* selected_asset();
174 PluginServer* selected_plugin();
175 AssetPicon* selected_folder();
176 bool protected_pixmap(BC_Pixmap *pixmap);
177 int save_defaults(BC_Hash *defaults);
178 int load_defaults(BC_Hash *defaults);
179 void start_vicon_drawing();
180 void stop_vicon_drawing();
185 AWindowAssets *asset_list;
186 AWindowFolders *folder_list;
187 AWindowDivider *divider;
189 // Store data to speed up responses
190 // Persistant data for listboxes
191 // All assets in current EDL
192 ArrayList<BC_ListBoxItem*> assets;
193 ArrayList<BC_ListBoxItem*> folders;
194 ArrayList<BC_ListBoxItem*> aeffects;
195 ArrayList<BC_ListBoxItem*> veffects;
196 ArrayList<BC_ListBoxItem*> atransitions;
197 ArrayList<BC_ListBoxItem*> vtransitions;
199 // Currently displayed data for listboxes
200 // Currently displayed assets + comments
201 ArrayList<BC_ListBoxItem*> displayed_assets[2];
203 const char *asset_titles[ASSET_COLUMNS];
207 BC_Pixmap *folder_icon;
208 BC_Pixmap *file_icon;
209 BC_Pixmap *audio_icon;
210 BC_Pixmap *video_icon;
211 BC_Pixmap *clip_icon; VFrame *clip_vframe;
212 BC_Pixmap *atransition_icon; VFrame *atransition_vframe;
213 BC_Pixmap *vtransition_icon; VFrame *vtransition_vframe;
214 BC_Pixmap *aeffect_icon; VFrame *aeffect_vframe;
215 BC_Pixmap *ladspa_icon; VFrame *ladspa_vframe;
216 BC_Pixmap *ff_aud_icon; VFrame *ff_aud_vframe;
217 BC_Pixmap *ff_vid_icon; VFrame *ff_vid_vframe;
218 BC_Pixmap *veffect_icon; VFrame *veffect_vframe;
219 NewFolderThread *newfolder_thread;
222 AssetPopup *asset_menu;
223 AssetListMenu *assetlist_menu;
224 FolderListMenu *folderlist_menu;
226 // Temporary for reading picons from files
228 VIconThread *vicon_thread;
230 int64_t plugin_visibility;
231 AWindowRemovePlugin *remove_plugin;
233 AVIconDrawing *avicon_drawing;
234 int avicon_w, avicon_h, vicon_drawing;
236 void update_folder_list();
237 void update_asset_list();
238 void filter_displayed_assets();
241 class AWindowAssets : public BC_ListBox
244 AWindowAssets(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h);
248 int selection_changed();
249 void draw_background();
250 int drag_start_event();
251 int drag_motion_event();
252 int drag_stop_event();
253 int button_press_event();
254 int column_resize_event();
255 int cursor_enter_event();
256 int cursor_leave_event();
262 class AWindowDivider : public BC_SubWindow
265 AWindowDivider(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h);
268 int button_press_event();
269 int cursor_motion_event();
270 int button_release_event();
276 class AWindowFolders : public BC_ListBox
279 AWindowFolders(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h);
282 int selection_changed();
283 int button_press_event();
289 class AWindowNewFolder : public BC_Button
292 AWindowNewFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y);
299 class AWindowDeleteFolder : public BC_Button
302 AWindowDeleteFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y);
309 class AWindowRenameFolder : public BC_Button
312 AWindowRenameFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y);
319 class AWindowDeleteDisk : public BC_Button
322 AWindowDeleteDisk(MWindow *mwindow, AWindowGUI *gui, int x, int y);
329 class AWindowDeleteProject : public BC_Button
332 AWindowDeleteProject(MWindow *mwindow, AWindowGUI *gui, int x, int y);
339 class AWindowInfo : public BC_Button
342 AWindowInfo(MWindow *mwindow, AWindowGUI *gui, int x, int y);
349 class AWindowRedrawIndex : public BC_Button
352 AWindowRedrawIndex(MWindow *mwindow, AWindowGUI *gui, int x, int y);
359 class AWindowPaste : public BC_Button
362 AWindowPaste(MWindow *mwindow, AWindowGUI *gui, int x, int y);
369 class AWindowAppend : public BC_Button
372 AWindowAppend(MWindow *mwindow, AWindowGUI *gui, int x, int y);
379 class AWindowView : public BC_Button
382 AWindowView(MWindow *mwindow, AWindowGUI *gui, int x, int y);
389 class AddTools : public BC_MenuBar
392 AddTools(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w);
393 void create_objects();
397 AddPluginsMenu *add_plugins;
400 class AddPluginsMenu : public BC_Menu
403 AddPluginsMenu(MWindow *mwindow, AWindowGUI *gui);
404 void create_objects();
410 class AddPluginItem : public BC_MenuItem
413 AddPluginItem(AddPluginsMenu *menu, const char *text, int idx);
416 AddPluginsMenu *menu;
420 class AVIconDrawing : public BC_Toggle
426 static void calculate_geometry(AWindowGUI *agui, VFrame **images, int *ww, int *hh);
428 AVIconDrawing(AWindowGUI *agui, int x, int y, VFrame **images);