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);
157 int save_defaults(BC_Hash *defaults);
158 int load_defaults(BC_Hash *defaults);
163 AWindowAssets *asset_list;
164 AWindowFolders *folder_list;
165 AWindowDivider *divider;
167 // Store data to speed up responses
168 // Persistant data for listboxes
169 // All assets in current EDL
170 ArrayList<BC_ListBoxItem*> assets;
171 ArrayList<BC_ListBoxItem*> folders;
172 ArrayList<BC_ListBoxItem*> aeffects;
173 ArrayList<BC_ListBoxItem*> veffects;
174 ArrayList<BC_ListBoxItem*> atransitions;
175 ArrayList<BC_ListBoxItem*> vtransitions;
177 // Currently displayed data for listboxes
178 // Currently displayed assets + comments
179 ArrayList<BC_ListBoxItem*> displayed_assets[2];
181 const char *asset_titles[ASSET_COLUMNS];
185 BC_Pixmap *folder_icon;
186 BC_Pixmap *file_icon;
187 BC_Pixmap *audio_icon;
188 BC_Pixmap *video_icon;
189 BC_Pixmap *clip_icon; VFrame *clip_vframe;
190 BC_Pixmap *atransition_icon; VFrame *atransition_vframe;
191 BC_Pixmap *vtransition_icon; VFrame *vtransition_vframe;
192 BC_Pixmap *aeffect_icon; VFrame *aeffect_vframe;
193 BC_Pixmap *ladspa_icon; VFrame *ladspa_vframe;
194 BC_Pixmap *ff_aud_icon; VFrame *ff_aud_vframe;
195 BC_Pixmap *ff_vid_icon; VFrame *ff_vid_vframe;
196 BC_Pixmap *veffect_icon; VFrame *veffect_vframe;
197 NewFolderThread *newfolder_thread;
200 AssetPopup *asset_menu;
201 AssetListMenu *assetlist_menu;
202 FolderListMenu *folderlist_menu;
204 // Temporary for reading picons from files
207 int64_t plugin_visibility;
208 AWindowRemovePlugin *remove_plugin;
210 void update_folder_list();
211 void update_asset_list();
212 void filter_displayed_assets();
215 class AWindowAssets : public BC_ListBox
218 AWindowAssets(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h);
222 int selection_changed();
223 void draw_background();
224 int drag_start_event();
225 int drag_motion_event();
226 int drag_stop_event();
227 int button_press_event();
228 int column_resize_event();
234 class AWindowDivider : public BC_SubWindow
237 AWindowDivider(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h);
240 int button_press_event();
241 int cursor_motion_event();
242 int button_release_event();
248 class AWindowFolders : public BC_ListBox
251 AWindowFolders(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h);
254 int selection_changed();
255 int button_press_event();
261 class AWindowNewFolder : public BC_Button
264 AWindowNewFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y);
271 class AWindowDeleteFolder : public BC_Button
274 AWindowDeleteFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y);
281 class AWindowRenameFolder : public BC_Button
284 AWindowRenameFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y);
291 class AWindowDeleteDisk : public BC_Button
294 AWindowDeleteDisk(MWindow *mwindow, AWindowGUI *gui, int x, int y);
301 class AWindowDeleteProject : public BC_Button
304 AWindowDeleteProject(MWindow *mwindow, AWindowGUI *gui, int x, int y);
311 class AWindowInfo : public BC_Button
314 AWindowInfo(MWindow *mwindow, AWindowGUI *gui, int x, int y);
321 class AWindowRedrawIndex : public BC_Button
324 AWindowRedrawIndex(MWindow *mwindow, AWindowGUI *gui, int x, int y);
331 class AWindowPaste : public BC_Button
334 AWindowPaste(MWindow *mwindow, AWindowGUI *gui, int x, int y);
341 class AWindowAppend : public BC_Button
344 AWindowAppend(MWindow *mwindow, AWindowGUI *gui, int x, int y);
351 class AWindowView : public BC_Button
354 AWindowView(MWindow *mwindow, AWindowGUI *gui, int x, int y);
361 class AddTools : public BC_MenuBar
364 AddTools(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w);
365 void create_objects();
369 AddPluginsMenu *add_plugins;
372 class AddPluginsMenu : public BC_Menu
375 AddPluginsMenu(MWindow *mwindow, AWindowGUI *gui);
376 void create_objects();
382 class AddPluginItem : public BC_MenuItem
385 AddPluginItem(AddPluginsMenu *menu, const char *text, int idx);
388 AddPluginsMenu *menu;