X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindow.C;h=89d188debcece611b4a3d8a4a017e665aa97d324;hp=c6c8235a57b165285692555a9b470f1873e56181;hb=03fa86e6dc495f9444ae14dad401b1ad6de793fe;hpb=0e16112661802284c0d2c9eb8d1df84141125e91;ds=sidebyside diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index c6c8235a..89d188de 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -27,6 +27,7 @@ #include "awindowgui.h" #include "awindow.h" #include "batchrender.h" +#include "bccmodels.h" #include "bcdisplayinfo.h" #include "bcprogressbox.h" #include "bcsignals.h" @@ -40,9 +41,9 @@ #include "channelinfo.h" #include "clip.h" #include "clipedls.h" -#include "bccmodels.h" #include "commercials.h" #include "confirmsave.h" +#include "convert.h" #include "cplayback.h" #include "ctimebar.h" #include "cwindowgui.h" @@ -225,6 +226,7 @@ MWindow::MWindow() create_bd = 0; create_dvd = 0; batch_render = 0; + convert_render = 0; render = 0; edl = 0; gui = 0; @@ -265,6 +267,7 @@ MWindow::~MWindow() delete create_dvd; create_dvd = 0; delete shuttle; shuttle = 0; delete batch_render; batch_render = 0; + delete convert_render; convert_render = 0; delete render; render = 0; delete mixers_align; mixers_align = 0; commit_commercial(); @@ -4078,44 +4081,50 @@ void MWindow::remove_asset_from_caches(Asset *asset) } -void MWindow::remove_assets_from_project(int push_undo, int redraw, +void MWindow::remove_assets_from_project(int push_undo, int redraw, int delete_indexes, ArrayList *drag_assets, ArrayList *drag_clips) { awindow->gui->close_view_popup(); - for(int i = 0; i < drag_assets->total; i++) { - Indexable *indexable = drag_assets->get(i); - if(indexable->is_asset) remove_asset_from_caches((Asset*)indexable); - } - // Remove from VWindow. - for(int i = 0; i < session->drag_clips->total; i++) { - for(int j = 0; j < vwindows.size(); j++) { - VWindow *vwindow = vwindows[j]; - if( !vwindow->is_running() ) continue; - if(session->drag_clips->get(i) == vwindow->get_edl()) { - vwindow->gui->lock_window("MWindow::remove_assets_from_project 1"); - vwindow->delete_source(1, 1); - vwindow->gui->unlock_window(); + if( drag_clips ) { + for(int i = 0; i < drag_clips->total; i++) { + for(int j = 0; j < vwindows.size(); j++) { + VWindow *vwindow = vwindows[j]; + if( !vwindow->is_running() ) continue; + if(drag_clips->get(i) == vwindow->get_edl()) { + vwindow->gui->lock_window("MWindow::remove_assets_from_project 1"); + vwindow->delete_source(1, 1); + vwindow->gui->unlock_window(); + } } } } - for(int i = 0; i < drag_assets->size(); i++) { - for(int j = 0; j < vwindows.size(); j++) { - VWindow *vwindow = vwindows[j]; - if( !vwindow->is_running() ) continue; - if(drag_assets->get(i) == vwindow->get_source()) { - vwindow->gui->lock_window("MWindow::remove_assets_from_project 2"); - vwindow->delete_source(1, 1); - vwindow->gui->unlock_window(); + if( drag_assets ) { + for(int i = 0; i < drag_assets->size(); i++) { + for(int j = 0; j < vwindows.size(); j++) { + VWindow *vwindow = vwindows[j]; + if( !vwindow->is_running() ) continue; + if(drag_assets->get(i) == vwindow->get_source()) { + vwindow->gui->lock_window("MWindow::remove_assets_from_project 2"); + vwindow->delete_source(1, 1); + vwindow->gui->unlock_window(); + } } } - } - for(int i = 0; i < drag_assets->size(); i++) { - Indexable *indexable = drag_assets->get(i); - remove_indexfile(indexable); + for(int i = 0; i < drag_assets->total; i++) { + Indexable *indexable = drag_assets->get(i); + if(indexable->is_asset) remove_asset_from_caches((Asset*)indexable); + } + + if( delete_indexes ) { + for(int i = 0; i < drag_assets->size(); i++) { + Indexable *indexable = drag_assets->get(i); + remove_indexfile(indexable); + } + } } //printf("MWindow::rebuild_indices 1 %s\n", indexable->path); @@ -4140,10 +4149,8 @@ void MWindow::remove_assets_from_project(int push_undo, int redraw, void MWindow::remove_assets_from_disk() { - remove_assets_from_project(1, - 1, - session->drag_assets, - session->drag_clips); + remove_assets_from_project(1, 1, 1, + session->drag_assets, session->drag_clips); // Remove from disk for(int i = 0; i < session->drag_assets->total; i++)