2 #include "assetpopup.h"
4 #include "awindowgui.h"
5 #include "awindowgui.inc"
7 #include "awindowmenu.h"
9 #include "colormodels.h"
11 #include "cwindowgui.h"
14 #include "edlsession.h"
16 #include "filesystem.h"
17 #include "localsession.h"
19 #include "mainsession.h"
20 #include "mwindowgui.h"
22 #include "newfolder.h"
23 #include "preferences.h"
26 #include "vwindowgui.h"
31 #define _(String) gettext(String)
32 #define gettext_noop(String) String
33 #define N_(String) gettext_noop (String)
36 AssetPicon::AssetPicon(MWindow *mwindow,
42 this->mwindow = mwindow;
48 AssetPicon::AssetPicon(MWindow *mwindow,
54 this->mwindow = mwindow;
60 AssetPicon::AssetPicon(MWindow *mwindow,
63 : BC_ListBoxItem(folder, gui->folder_icon)
66 this->mwindow = mwindow;
70 AssetPicon::AssetPicon(MWindow *mwindow,
76 this->mwindow = mwindow;
78 this->plugin = plugin;
84 AssetPicon::~AssetPicon()
88 if(icon != gui->file_icon &&
89 icon != gui->audio_icon &&
90 icon != gui->folder_icon &&
91 icon != gui->clip_icon &&
92 icon != gui->video_icon) delete icon;
96 void AssetPicon::reset()
107 void AssetPicon::create_objects()
110 char name[BCTEXTLEN];
112 int pixmap_w, pixmap_h;
119 fs.extract_name(name, asset->path);
121 if(asset->video_data)
123 if(mwindow->preferences->use_thumbnails)
125 //printf("AssetPicon::create_objects 1\n");
126 File *file = mwindow->video_cache->check_out(asset);
127 //printf("AssetPicon::create_objects 2\n");
131 pixmap_w = pixmap_h * asset->width / asset->height;
133 //printf("AssetPicon::create_objects 3\n");
135 file->set_video_position(0, mwindow->edl->session->frame_rate);
136 frame = file->read_frame(BC_RGB888);
137 //printf("AssetPicon::create_objects 4\n");
141 icon = new BC_Pixmap(gui, pixmap_w, pixmap_h);
142 icon->draw_vframe(frame,
150 //printf("AssetPicon::create_objects 5\n");
152 mwindow->video_cache->check_in(asset);
153 //printf("AssetPicon::create_objects 6\n");
157 icon = gui->video_icon;
162 icon = gui->video_icon;
166 if(asset->audio_data)
168 icon = gui->audio_icon;
170 //printf("AssetPicon::create_objects 2\n");
173 //printf("AssetPicon::create_objects 4\n");
178 //printf("AssetPicon::create_objects 4 %s\n", edl->local_session->clip_title);
179 strcpy(name, edl->local_session->clip_title);
181 set_icon(gui->clip_icon);
186 strcpy(name, plugin->title);
190 if(plugin->picon->get_color_model() == BC_RGB888)
192 icon = new BC_Pixmap(gui,
193 plugin->picon->get_w(),
194 plugin->picon->get_h());
195 icon->draw_vframe(plugin->picon,
198 plugin->picon->get_w(),
199 plugin->picon->get_h(),
205 icon = new BC_Pixmap(gui,
212 icon = gui->file_icon;
224 AWindowGUI::AWindowGUI(MWindow *mwindow, AWindow *awindow)
225 : BC_Window(PROGRAM_NAME ": Resources",
226 mwindow->session->awindow_x,
227 mwindow->session->awindow_y,
228 mwindow->session->awindow_w,
229 mwindow->session->awindow_h,
236 // printf("AWindowGUI::AWindowGUI %d %d %d %d\n",
237 // mwindow->session->awindow_x,
238 // mwindow->session->awindow_y,
239 // mwindow->session->awindow_w,
240 // mwindow->session->awindow_h);
241 this->mwindow = mwindow;
242 this->awindow = awindow;
245 AWindowGUI::~AWindowGUI()
247 assets.remove_all_objects();
248 folders.remove_all_objects();
249 aeffects.remove_all_objects();
250 veffects.remove_all_objects();
251 atransitions.remove_all_objects();
252 vtransitions.remove_all_objects();
253 displayed_assets[1].remove_all_objects();
258 delete newfolder_thread;
260 delete assetlist_menu;
261 delete folderlist_menu;
264 int AWindowGUI::create_objects()
269 //printf("AWindowGUI::create_objects 1\n");
270 asset_titles[0] = _("Title");
271 asset_titles[1] = _("Comments");
273 set_icon(mwindow->theme->awindow_icon);
274 file_icon = new BC_Pixmap(this,
275 BC_WindowBase::get_resources()->type_to_icon[ICON_UNKNOWN],
278 folder_icon = new BC_Pixmap(this,
279 BC_WindowBase::get_resources()->type_to_icon[ICON_FOLDER],
282 audio_icon = new BC_Pixmap(this,
283 BC_WindowBase::get_resources()->type_to_icon[ICON_SOUND],
286 video_icon = new BC_Pixmap(this,
287 BC_WindowBase::get_resources()->type_to_icon[ICON_FILM],
290 clip_icon = new BC_Pixmap(this,
291 mwindow->theme->clip_icon,
295 folders.append(picon = new AssetPicon(mwindow,
298 picon->persistent = 1;
299 folders.append(picon = new AssetPicon(mwindow,
302 picon->persistent = 1;
303 folders.append(picon = new AssetPicon(mwindow,
305 ATRANSITION_FOLDER));
306 picon->persistent = 1;
307 folders.append(picon = new AssetPicon(mwindow,
309 VTRANSITION_FOLDER));
310 picon->persistent = 1;
312 create_persistent_folder(&aeffects, 1, 0, 1, 0);
313 create_persistent_folder(&veffects, 0, 1, 1, 0);
314 create_persistent_folder(&atransitions, 1, 0, 0, 1);
315 create_persistent_folder(&vtransitions, 0, 1, 0, 1);
317 mwindow->theme->get_awindow_sizes(this);
318 add_subwindow(asset_list = new AWindowAssets(mwindow,
320 mwindow->theme->alist_x,
321 mwindow->theme->alist_y,
322 mwindow->theme->alist_w,
323 mwindow->theme->alist_h));
324 add_subwindow(divider = new AWindowDivider(mwindow,
326 mwindow->theme->adivider_x,
327 mwindow->theme->adivider_y,
328 mwindow->theme->adivider_w,
329 mwindow->theme->adivider_h));
330 divider->set_cursor(HSEPARATE_CURSOR);
331 add_subwindow(folder_list = new AWindowFolders(mwindow,
333 mwindow->theme->afolders_x,
334 mwindow->theme->afolders_y,
335 mwindow->theme->afolders_w,
336 mwindow->theme->afolders_h));
338 x = mwindow->theme->abuttons_x;
339 y = mwindow->theme->abuttons_y;
341 newfolder_thread = new NewFolderThread(mwindow, this);
343 add_subwindow(asset_menu = new AssetPopup(mwindow, this));
344 asset_menu->create_objects();
346 add_subwindow(assetlist_menu = new AssetListMenu(mwindow, this));
347 assetlist_menu->create_objects();
349 add_subwindow(folderlist_menu = new FolderListMenu(mwindow, this));
350 folderlist_menu->create_objects();
351 //printf("AWindowGUI::create_objects 2\n");
356 int AWindowGUI::resize_event(int w, int h)
358 mwindow->session->awindow_x = get_x();
359 mwindow->session->awindow_y = get_y();
360 mwindow->session->awindow_w = w;
361 mwindow->session->awindow_h = h;
363 mwindow->theme->get_awindow_sizes(this);
364 mwindow->theme->draw_awindow_bg(this);
366 asset_list->reposition_window(mwindow->theme->alist_x,
367 mwindow->theme->alist_y,
368 mwindow->theme->alist_w,
369 mwindow->theme->alist_h);
370 divider->reposition_window(mwindow->theme->adivider_x,
371 mwindow->theme->adivider_y,
372 mwindow->theme->adivider_w,
373 mwindow->theme->adivider_h);
374 folder_list->reposition_window(mwindow->theme->afolders_x,
375 mwindow->theme->afolders_y,
376 mwindow->theme->afolders_w,
377 mwindow->theme->afolders_h);
379 int x = mwindow->theme->abuttons_x;
380 int y = mwindow->theme->abuttons_y;
382 // new_bin->reposition_window(x, y);
383 // x += new_bin->get_w();
384 // delete_bin->reposition_window(x, y);
385 // x += delete_bin->get_w();
386 // rename_bin->reposition_window(x, y);
387 // x += rename_bin->get_w();
388 // delete_disk->reposition_window(x, y);
389 // x += delete_disk->get_w();
390 // delete_project->reposition_window(x, y);
391 // x += delete_project->get_w();
392 // info->reposition_window(x, y);
393 // x += info->get_w();
394 // redraw_index->reposition_window(x, y);
395 // x += redraw_index->get_w();
396 // paste->reposition_window(x, y);
397 // x += paste->get_w();
398 // append->reposition_window(x, y);
399 // x += append->get_w();
400 // view->reposition_window(x, y);
402 BC_WindowBase::resize_event(w, h);
406 int AWindowGUI::translation_event()
408 mwindow->session->awindow_x = get_x();
409 mwindow->session->awindow_y = get_y();
413 void AWindowGUI::reposition_objects()
415 mwindow->theme->get_awindow_sizes(this);
416 asset_list->reposition_window(mwindow->theme->alist_x,
417 mwindow->theme->alist_y,
418 mwindow->theme->alist_w,
419 mwindow->theme->alist_h);
420 divider->reposition_window(mwindow->theme->adivider_x,
421 mwindow->theme->adivider_y,
422 mwindow->theme->adivider_w,
423 mwindow->theme->adivider_h);
424 folder_list->reposition_window(mwindow->theme->afolders_x,
425 mwindow->theme->afolders_y,
426 mwindow->theme->afolders_w,
427 mwindow->theme->afolders_h);
431 int AWindowGUI::close_event()
434 mwindow->session->show_awindow = 0;
435 mwindow->gui->lock_window();
436 mwindow->gui->mainmenu->show_awindow->set_checked(0);
437 mwindow->gui->unlock_window();
438 mwindow->save_defaults();
443 int AWindowGUI::keypress_event()
445 switch(get_keypress())
459 void AWindowGUI::update_folder_list()
461 //printf("AWindowGUI::update_folder_list 1\n");
462 for(int i = 0; i < folders.total; i++)
464 AssetPicon *picon = (AssetPicon*)folders.values[i];
467 //printf("AWindowGUI::update_folder_list 1\n");
469 // Search assets for folders
470 for(int i = 0; i < mwindow->edl->folders.total; i++)
472 char *folder = mwindow->edl->folders.values[i];
474 //printf("AWindowGUI::update_folder_list 1.1\n");
476 for(int j = 0; j < folders.total; j++)
478 AssetPicon *picon = (AssetPicon*)folders.values[j];
479 if(!strcasecmp(picon->get_text(), folder))
489 AssetPicon *picon = new AssetPicon(mwindow, this, folder);
490 picon->create_objects();
491 folders.append(picon);
493 //printf("AWindowGUI::update_folder_list 1.3\n");
495 //printf("AWindowGUI::update_folder_list 1\n");
496 //for(int i = 0; i < folders.total; i++)
497 // printf("AWindowGUI::update_folder_list %s\n", folders.values[i]->get_text());
500 for(int i = folders.total - 1; i >= 0; i--)
502 AssetPicon *picon = (AssetPicon*)folders.values[i];
503 if(!picon->in_use && !picon->persistent)
506 folders.remove_number(i);
509 //for(int i = 0; i < folders.total; i++)
510 // printf("AWindowGUI::update_folder_list %s\n", folders.values[i]->get_text());
511 //printf("AWindowGUI::update_folder_list 2\n");
514 void AWindowGUI::create_persistent_folder(ArrayList<BC_ListBoxItem*> *output,
520 ArrayList<PluginServer*> plugindb;
522 // Get pointers to plugindb entries
523 mwindow->create_plugindb(do_audio,
530 for(int i = 0; i < plugindb.total; i++)
532 PluginServer *server = plugindb.values[i];
535 // Create new listitem
538 AssetPicon *picon = new AssetPicon(mwindow, this, server);
539 picon->create_objects();
540 output->append(picon);
545 void AWindowGUI::update_asset_list()
547 //printf("AWindowGUI::update_asset_list 1\n");
548 for(int i = 0; i < assets.total; i++)
550 AssetPicon *picon = (AssetPicon*)assets.values[i];
558 //printf("AWindowGUI::update_asset_list 1\n");
561 // Synchronize EDL clips
562 for(int i = 0; i < mwindow->edl->clips.total; i++)
566 // Look for clip in existing listitems
567 for(int j = 0; j < assets.total && !exists; j++)
569 AssetPicon *picon = (AssetPicon*)assets.values[j];
571 if(picon->id == mwindow->edl->clips.values[i]->id)
573 picon->edl = mwindow->edl->clips.values[i];
574 picon->set_text(mwindow->edl->clips.values[i]->local_session->clip_title);
580 // Create new listitem
583 AssetPicon *picon = new AssetPicon(mwindow,
585 mwindow->edl->clips.values[i]);
586 picon->create_objects();
587 assets.append(picon);
597 //printf("AWindowGUI::update_asset_list 2 %d\n", assets.total);
598 // Synchronize EDL assets
599 for(Asset *current = mwindow->edl->assets->first;
605 //printf("AWindowGUI::update_asset_list 3 %s\n", current->path);
606 // Look for asset in existing listitems
607 for(int j = 0; j < assets.total && !exists; j++)
609 AssetPicon *picon = (AssetPicon*)assets.values[j];
611 if(picon->id == current->id)
613 //printf("AWindowGUI::update_asset_list 4 %p %d %d\n", picon->asset, picon->get_icon_x(), picon->get_icon_y());
614 picon->asset = current;
621 //printf("AWindowGUI::update_asset_list 5\n");
622 // Create new listitem
625 //printf("AWindowGUI::update_asset_list 4.1 %s\n", current->path);
626 AssetPicon *picon = new AssetPicon(mwindow, this, current);
627 //printf("AWindowGUI::update_asset_list 4.2 %s\n", current->path);
628 picon->create_objects();
629 //printf("AWindowGUI::update_asset_list 4.3 %s\n", current->path);
630 assets.append(picon);
631 //printf("AWindowGUI::update_asset_list 4.4 %s\n", current->path);
643 //printf("AWindowGUI::update_asset_list 6\n");
644 for(int i = assets.total - 1; i >= 0; i--)
646 AssetPicon *picon = (AssetPicon*)assets.values[i];
647 //printf("AWindowGUI::update_asset_list %s %d\n", picon->asset->path, picon->in_use);
651 assets.remove_number(i);
654 //printf("AWindowGUI::update_asset_list 7 %d\n", assets.total);
661 void AWindowGUI::sort_assets()
663 //printf("AWindowGUI::sort_assets 1 %s\n", mwindow->edl->session->current_folder);
664 if(!strcasecmp(mwindow->edl->session->current_folder, AEFFECT_FOLDER))
665 sort_picons(&aeffects,
668 if(!strcasecmp(mwindow->edl->session->current_folder, VEFFECT_FOLDER))
669 sort_picons(&veffects,
672 if(!strcasecmp(mwindow->edl->session->current_folder, ATRANSITION_FOLDER))
673 sort_picons(&atransitions,
676 if(!strcasecmp(mwindow->edl->session->current_folder, VTRANSITION_FOLDER))
677 sort_picons(&vtransitions,
681 mwindow->edl->session->current_folder);
696 void AWindowGUI::collect_assets()
699 mwindow->session->drag_assets->remove_all();
700 mwindow->session->drag_clips->remove_all();
703 AssetPicon *result = (AssetPicon*)asset_list->get_selection(0, i++);
706 if(result->asset) mwindow->session->drag_assets->append(result->asset);
707 if(result->edl) mwindow->session->drag_clips->append(result->edl);
711 void AWindowGUI::copy_picons(ArrayList<BC_ListBoxItem*> *dst,
712 ArrayList<BC_ListBoxItem*> *src,
715 // Remove current pointers
717 dst[1].remove_all_objects();
719 // Create new pointers
720 //if(folder) printf("AWindowGUI::copy_picons 1 %s\n", folder);
721 for(int i = 0; i < src->total; i++)
723 AssetPicon *picon = (AssetPicon*)src->values[i];
724 //printf("AWindowGUI::copy_picons 2 %s\n", picon->asset->folder);
726 (folder && picon->asset && !strcasecmp(picon->asset->folder, folder)) ||
727 (folder && picon->edl && !strcasecmp(picon->edl->local_session->folder, folder)))
729 BC_ListBoxItem *item2, *item1;
730 dst[0].append(item1 = picon);
732 dst[1].append(item2 = new BC_ListBoxItem(picon->edl->local_session->clip_notes));
734 dst[1].append(item2 = new BC_ListBoxItem(""));
735 item1->set_autoplace_text(1);
736 item2->set_autoplace_text(1);
737 //printf("AWindowGUI::copy_picons 3 %s\n", picon->get_text());
742 void AWindowGUI::sort_picons(ArrayList<BC_ListBoxItem*> *src,
745 //printf("AWindowGUI::sort_picons 1\n")
750 for(int i = 0; i < src->total - 1; i++)
752 BC_ListBoxItem *item1 = src->values[i];
753 BC_ListBoxItem *item2 = src->values[i + 1];
754 item1->set_autoplace_icon(1);
755 item2->set_autoplace_icon(1);
756 item1->set_autoplace_text(1);
757 item2->set_autoplace_text(1);
758 if(strcmp(item1->get_text(), item2->get_text()) > 0)
760 src->values[i + 1] = item1;
761 src->values[i] = item2;
769 void AWindowGUI::filter_displayed_assets()
771 if(!strcasecmp(mwindow->edl->session->current_folder, AEFFECT_FOLDER))
772 copy_picons(displayed_assets,
776 if(!strcasecmp(mwindow->edl->session->current_folder, VEFFECT_FOLDER))
777 copy_picons(displayed_assets,
781 if(!strcasecmp(mwindow->edl->session->current_folder, ATRANSITION_FOLDER))
782 copy_picons(displayed_assets,
786 if(!strcasecmp(mwindow->edl->session->current_folder, VTRANSITION_FOLDER))
787 copy_picons(displayed_assets,
791 copy_picons(displayed_assets,
793 mwindow->edl->session->current_folder);
797 void AWindowGUI::update_assets()
799 //printf("AWindowGUI::update_assets 1\n");
800 update_folder_list();
801 //printf("AWindowGUI::update_assets 2\n");
803 //printf("AWindowGUI::update_assets 3\n");
804 filter_displayed_assets();
806 //for(int i = 0; i < folders.total; i++)
807 //printf("AWindowGUI::update_assets 4\n");
808 // printf("AWindowGUI::update_assets %s\n", folders.values[i]->get_text());
809 if(mwindow->edl->session->folderlist_format != folder_list->get_format())
810 folder_list->update_format(mwindow->edl->session->folderlist_format, 0);
811 folder_list->update(&folders,
815 folder_list->get_xposition(),
816 folder_list->get_yposition(),
818 //printf("AWindowGUI::update_assets 5\n");
820 if(mwindow->edl->session->assetlist_format != asset_list->get_format())
821 asset_list->update_format(mwindow->edl->session->assetlist_format, 0);
824 //printf("AWindowGUI::update_assets 6 %d\n", displayed_assets[0].total);
825 asset_list->update(displayed_assets,
827 mwindow->edl->session->asset_columns,
829 asset_list->get_xposition(),
830 asset_list->get_yposition(),
833 //printf("AWindowGUI::update_assets 7\n");
836 //printf("AWindowGUI::update_assets 8\n");
840 int AWindowGUI::current_folder_number()
843 for(int i = 0; i < folders.total; i++)
845 if(!strcasecmp(folders.values[i]->get_text(), mwindow->edl->session->current_folder))
854 int AWindowGUI::drag_motion()
856 if(get_hidden()) return 0;
862 int AWindowGUI::drag_stop()
864 if(get_hidden()) return 0;
869 Asset* AWindowGUI::selected_asset()
871 AssetPicon *picon = (AssetPicon*)asset_list->get_selection(0, 0);
872 if(picon) return picon->asset;
875 PluginServer* AWindowGUI::selected_plugin()
877 AssetPicon *picon = (AssetPicon*)asset_list->get_selection(0, 0);
878 if(picon) return picon->plugin;
881 AssetPicon* AWindowGUI::selected_folder()
883 AssetPicon *picon = (AssetPicon*)folder_list->get_selection(0, 0);
896 AWindowDivider::AWindowDivider(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h)
897 : BC_SubWindow(x, y, w, h)
899 this->mwindow = mwindow;
902 AWindowDivider::~AWindowDivider()
906 int AWindowDivider::button_press_event()
908 if(is_event_win() && cursor_inside())
910 mwindow->session->current_operation = DRAG_PARTITION;
916 int AWindowDivider::cursor_motion_event()
918 if(mwindow->session->current_operation == DRAG_PARTITION)
920 mwindow->session->afolders_w = gui->get_relative_cursor_x();
921 gui->reposition_objects();
926 int AWindowDivider::button_release_event()
928 if(mwindow->session->current_operation == DRAG_PARTITION)
930 mwindow->session->current_operation = NO_OPERATION;
941 AWindowFolders::AWindowFolders(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h)
946 mwindow->edl->session->folderlist_format == FOLDERS_ICONS ?
947 LISTBOX_ICONS : LISTBOX_TEXT,
948 &gui->folders, // Each column has an ArrayList of BC_ListBoxItems.
949 0, // Titles for columns. Set to 0 for no titles
950 0, // width of each column
952 0, // Pixel of top of window.
953 0, // If this listbox is a popup window
954 LISTBOX_SINGLE, // Select one item or multiple items
955 ICON_TOP, // Position of icon relative to text of each item
958 this->mwindow = mwindow;
963 AWindowFolders::~AWindowFolders()
967 int AWindowFolders::selection_changed()
969 AssetPicon *picon = (AssetPicon*)get_selection(0, 0);
972 strcpy(mwindow->edl->session->current_folder, picon->get_text());
973 //printf("AWindowFolders::selection_changed 1\n");
974 gui->asset_list->draw_background();
975 gui->update_assets();
980 int AWindowFolders::button_press_event()
984 result = BC_ListBox::button_press_event();
988 if(get_buttonpress() == 3 && is_event_win() && cursor_inside())
990 gui->folderlist_menu->update_titles();
991 gui->folderlist_menu->activate_menu();
1006 AWindowAssets::AWindowAssets(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h)
1011 mwindow->edl->session->assetlist_format == ASSETS_ICONS ?
1012 LISTBOX_ICONS : LISTBOX_TEXT,
1013 &gui->assets, // Each column has an ArrayList of BC_ListBoxItems.
1014 gui->asset_titles, // Titles for columns. Set to 0 for no titles
1015 mwindow->edl->session->asset_columns, // width of each column
1016 1, // Total columns.
1017 0, // Pixel of top of window.
1018 0, // If this listbox is a popup window
1019 LISTBOX_MULTIPLE, // Select one item or multiple items
1020 ICON_TOP, // Position of icon relative to text of each item
1023 this->mwindow = mwindow;
1028 AWindowAssets::~AWindowAssets()
1032 int AWindowAssets::button_press_event()
1036 result = BC_ListBox::button_press_event();
1038 if(!result && get_buttonpress() == 3 && is_event_win() && cursor_inside())
1040 BC_ListBox::deactivate_selection();
1041 gui->assetlist_menu->update_titles();
1042 gui->assetlist_menu->activate_menu();
1051 int AWindowAssets::handle_event()
1053 //printf("AWindowAssets::handle_event 1 %d %d\n", get_buttonpress(), get_selection(0, 0));
1054 if(get_selection(0, 0))
1056 if(!strcasecmp(mwindow->edl->session->current_folder, AEFFECT_FOLDER))
1060 if(!strcasecmp(mwindow->edl->session->current_folder, VEFFECT_FOLDER))
1064 if(!strcasecmp(mwindow->edl->session->current_folder, ATRANSITION_FOLDER))
1068 if(!strcasecmp(mwindow->edl->session->current_folder, VTRANSITION_FOLDER))
1073 //printf("AWindowAssets::handle_event 2 %d %d\n", get_buttonpress(), get_selection(0, 0));
1074 mwindow->vwindow->gui->lock_window();
1076 if(((AssetPicon*)get_selection(0, 0))->asset)
1077 mwindow->vwindow->change_source(((AssetPicon*)get_selection(0, 0))->asset);
1079 if(((AssetPicon*)get_selection(0, 0))->edl)
1080 mwindow->vwindow->change_source(((AssetPicon*)get_selection(0, 0))->edl);
1082 mwindow->vwindow->gui->unlock_window();
1090 int AWindowAssets::selection_changed()
1092 // Show popup window
1093 if(get_button_down() && get_buttonpress() == 3 && get_selection(0, 0))
1095 if(!strcasecmp(mwindow->edl->session->current_folder, AEFFECT_FOLDER) ||
1096 !strcasecmp(mwindow->edl->session->current_folder, VEFFECT_FOLDER) ||
1097 !strcasecmp(mwindow->edl->session->current_folder, ATRANSITION_FOLDER) ||
1098 !strcasecmp(mwindow->edl->session->current_folder, VTRANSITION_FOLDER))
1100 gui->assetlist_menu->update_titles();
1101 gui->assetlist_menu->activate_menu();
1105 if(((AssetPicon*)get_selection(0, 0))->asset)
1106 gui->asset_menu->update();
1108 if(((AssetPicon*)get_selection(0, 0))->edl)
1109 gui->asset_menu->update();
1113 gui->asset_menu->activate_menu();
1116 BC_ListBox::deactivate_selection();
1122 void AWindowAssets::draw_background()
1124 //printf("AWindowAssets::draw_background %s\n", mwindow->edl->session->current_folder);
1125 BC_ListBox::draw_background();
1127 set_font(LARGEFONT);
1129 get_text_width(LARGEFONT, mwindow->edl->session->current_folder) - 4,
1131 mwindow->edl->session->current_folder,
1136 int AWindowAssets::drag_start_event()
1138 int collect_pluginservers = 0;
1139 int collect_assets = 0;
1141 if(BC_ListBox::drag_start_event())
1143 if(!strcasecmp(mwindow->edl->session->current_folder, AEFFECT_FOLDER))
1145 mwindow->session->current_operation = DRAG_AEFFECT;
1146 collect_pluginservers = 1;
1149 if(!strcasecmp(mwindow->edl->session->current_folder, VEFFECT_FOLDER))
1151 mwindow->session->current_operation = DRAG_VEFFECT;
1152 collect_pluginservers = 1;
1155 if(!strcasecmp(mwindow->edl->session->current_folder, ATRANSITION_FOLDER))
1157 mwindow->session->current_operation = DRAG_ATRANSITION;
1158 collect_pluginservers = 1;
1161 if(!strcasecmp(mwindow->edl->session->current_folder, VTRANSITION_FOLDER))
1163 mwindow->session->current_operation = DRAG_VTRANSITION;
1164 collect_pluginservers = 1;
1168 mwindow->session->current_operation = DRAG_ASSET;
1173 if(collect_pluginservers)
1176 mwindow->session->drag_pluginservers->remove_all();
1179 AssetPicon *result = (AssetPicon*)get_selection(0, i++);
1182 mwindow->session->drag_pluginservers->append(result->plugin);
1188 gui->collect_assets();
1196 int AWindowAssets::drag_motion_event()
1198 BC_ListBox::drag_motion_event();
1200 mwindow->gui->lock_window();
1201 mwindow->gui->drag_motion();
1202 mwindow->gui->unlock_window();
1204 mwindow->vwindow->gui->lock_window();
1205 mwindow->vwindow->gui->drag_motion();
1206 mwindow->vwindow->gui->unlock_window();
1208 mwindow->cwindow->gui->lock_window();
1209 mwindow->cwindow->gui->drag_motion();
1210 mwindow->cwindow->gui->unlock_window();
1214 int AWindowAssets::drag_stop_event()
1218 result = gui->drag_stop();
1223 mwindow->gui->lock_window();
1224 result = mwindow->gui->drag_stop();
1225 mwindow->gui->unlock_window();
1230 mwindow->vwindow->gui->lock_window();
1231 result = mwindow->vwindow->gui->drag_stop();
1232 mwindow->vwindow->gui->unlock_window();
1237 mwindow->cwindow->gui->lock_window();
1238 result = mwindow->cwindow->gui->drag_stop();
1239 mwindow->cwindow->gui->unlock_window();
1244 if(result) get_drag_popup()->set_animation(0);
1246 BC_ListBox::drag_stop_event();
1250 int AWindowAssets::column_resize_event()
1252 mwindow->edl->session->asset_columns[0] = get_column_width(0);
1253 mwindow->edl->session->asset_columns[1] = get_column_width(1);
1268 AWindowNewFolder::AWindowNewFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y)
1269 : BC_Button(x, y, mwindow->theme->newbin_data)
1271 this->mwindow = mwindow;
1273 set_tooltip(_("New bin"));
1276 int AWindowNewFolder::handle_event()
1278 gui->newfolder_thread->start_new_folder();
1282 AWindowDeleteFolder::AWindowDeleteFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y)
1283 : BC_Button(x, y, mwindow->theme->deletebin_data)
1285 this->mwindow = mwindow;
1287 set_tooltip(_("Delete bin"));
1290 int AWindowDeleteFolder::handle_event()
1292 if(gui->folder_list->get_selection(0, 0))
1294 BC_ListBoxItem *folder = gui->folder_list->get_selection(0, 0);
1295 mwindow->delete_folder(folder->get_text());
1300 AWindowRenameFolder::AWindowRenameFolder(MWindow *mwindow, AWindowGUI *gui, int x, int y)
1301 : BC_Button(x, y, mwindow->theme->renamebin_data)
1303 this->mwindow = mwindow;
1305 set_tooltip(_("Rename bin"));
1308 int AWindowRenameFolder::handle_event()
1313 AWindowDeleteDisk::AWindowDeleteDisk(MWindow *mwindow, AWindowGUI *gui, int x, int y)
1314 : BC_Button(x, y, mwindow->theme->deletedisk_data)
1316 this->mwindow = mwindow;
1318 set_tooltip(_("Delete asset from disk"));
1321 int AWindowDeleteDisk::handle_event()
1326 AWindowDeleteProject::AWindowDeleteProject(MWindow *mwindow, AWindowGUI *gui, int x, int y)
1327 : BC_Button(x, y, mwindow->theme->deleteproject_data)
1329 this->mwindow = mwindow;
1331 set_tooltip(_("Delete asset from project"));
1334 int AWindowDeleteProject::handle_event()
1339 AWindowInfo::AWindowInfo(MWindow *mwindow, AWindowGUI *gui, int x, int y)
1340 : BC_Button(x, y, mwindow->theme->infoasset_data)
1342 this->mwindow = mwindow;
1344 set_tooltip(_("Edit information on asset"));
1347 int AWindowInfo::handle_event()
1349 gui->awindow->asset_edit->edit_asset(gui->selected_asset());
1353 AWindowRedrawIndex::AWindowRedrawIndex(MWindow *mwindow, AWindowGUI *gui, int x, int y)
1354 : BC_Button(x, y, mwindow->theme->redrawindex_data)
1356 this->mwindow = mwindow;
1358 set_tooltip(_("Redraw index"));
1361 int AWindowRedrawIndex::handle_event()
1366 AWindowPaste::AWindowPaste(MWindow *mwindow, AWindowGUI *gui, int x, int y)
1367 : BC_Button(x, y, mwindow->theme->pasteasset_data)
1369 this->mwindow = mwindow;
1371 set_tooltip(_("Paste asset on recordable tracks"));
1374 int AWindowPaste::handle_event()
1379 AWindowAppend::AWindowAppend(MWindow *mwindow, AWindowGUI *gui, int x, int y)
1380 : BC_Button(x, y, mwindow->theme->appendasset_data)
1382 this->mwindow = mwindow;
1384 set_tooltip(_("Append asset in new tracks"));
1387 int AWindowAppend::handle_event()
1392 AWindowView::AWindowView(MWindow *mwindow, AWindowGUI *gui, int x, int y)
1393 : BC_Button(x, y, mwindow->theme->viewasset_data)
1395 this->mwindow = mwindow;
1397 set_tooltip(_("View asset"));
1400 int AWindowView::handle_event()