X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fawindowgui.C;h=38dad86bf1d3a3ac3de310ac033b4e651fb94c88;hb=07217a92dbd5263eeb531053a3c62622f9bf925c;hp=f4a2474b3c2d1c3b6581d2fd6417e15983ca2802;hpb=5a46f81a504562b7c8a0c4ff940e2b5b5c068ded;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index f4a2474b..38dad86b 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -23,10 +23,11 @@ #include "asset.h" #include "assetedit.h" #include "assetpopup.h" +#include "assetremove.h" #include "assets.h" #include "audiodevice.h" -#include "awindowgui.h" #include "awindow.h" +#include "awindowgui.h" #include "bccmodels.h" #include "bcsignals.h" #include "bchash.h" @@ -1467,14 +1468,35 @@ int AWindowGUI::keypress_event() case 'v': return cycle_assetlist_format(); case DELETE: - if( shift_down() ) { + if( shift_down() && ctrl_down() ) { PluginServer* plugin = selected_plugin(); if( !plugin ) break; remove_plugin = new AWindowRemovePlugin(awindow, plugin); unlock_window(); remove_plugin->start(); - lock_window(); + lock_window("AWindowGUI::keypress_event 1"); + return 1; + } + collect_assets(); + if( shift_down() ) { + mwindow->awindow->asset_remove->start(); + return 1; + } + unlock_window(); + mwindow->remove_assets_from_project(1, 1, + mwindow->session->drag_assets, + mwindow->session->drag_clips); + lock_window("AWindowGUI::keypress_event 2"); + return 1; + case KEY_F1: + case KEY_F2: + case KEY_F3: + case KEY_F4: + if( shift_down() && ctrl_down() ) { + resend_event(mwindow->gui); + return 1; } + break; } return 0; } @@ -2924,3 +2946,51 @@ int AWindowListSort::handle_event() return 1; } +AssetSelectUsedItem::AssetSelectUsedItem(AssetSelectUsed *select_used, const char *text, int action) + : BC_MenuItem(text) +{ + this->select_used = select_used; + this->action = action; +} + +int AssetSelectUsedItem::handle_event() +{ + MWindow *mwindow = select_used->mwindow; + AWindowGUI *gui = select_used->gui; + AWindowAssets *asset_list = gui->asset_list; + ArrayList *data = gui->displayed_assets; + + switch( action ) { + case SELECT_ALL: + case SELECT_NONE: + asset_list->set_all_selected(data, action==SELECT_ALL ? 1 : 0); + break; + case SELECT_USED: + case SELECT_UNUSED: + asset_list->set_all_selected(data, 0); + for( int i = 0; i < data->total; i++ ) { + AssetPicon *picon = (AssetPicon*)data->values[i]; + Indexable *idxbl = picon->indexable ? picon->indexable : + picon->edl ? picon->edl->get_proxy_asset() : 0; + int used = idxbl && mwindow->edl->in_use(idxbl) ? 1 : 0; + asset_list->set_selected(data, i, action==SELECT_USED ? used : !used); + } + break; + } + + int asset_xposition = asset_list->get_xposition(); + int asset_yposition = asset_list->get_yposition(); + asset_list->update(gui->displayed_assets, gui->asset_titles, + mwindow->edl->session->asset_columns, ASSET_COLUMNS, + asset_xposition, asset_yposition, -1, 0); + asset_list->center_selection(); + return 1; +} + +AssetSelectUsed::AssetSelectUsed(MWindow *mwindow, AWindowGUI *gui) + : BC_MenuItem(_("Select")) +{ + this->mwindow = mwindow; + this->gui = gui; +} +