From: Good Guy Date: Fri, 22 Jun 2018 18:28:00 +0000 (-0600) Subject: batchrender hang on close, apply pref saves defaults, overwrite/splice tweaks, specif... X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=commitdiff_plain;h=b402ed7f93de4c98e6651483eb8561cf1c37ec9a batchrender hang on close, apply pref saves defaults, overwrite/splice tweaks, specify filter label --- diff --git a/cinelerra-5.1/cinelerra/batchrender.C b/cinelerra-5.1/cinelerra/batchrender.C index 9e45b3ec..4c5f1d4b 100644 --- a/cinelerra-5.1/cinelerra/batchrender.C +++ b/cinelerra-5.1/cinelerra/batchrender.C @@ -672,6 +672,8 @@ BatchRenderGUI::BatchRenderGUI(MWindow *mwindow, BatchRenderGUI::~BatchRenderGUI() { lock_window("BatchRenderGUI::~BatchRenderGUI"); + loadlist_batch->stop(); + savelist_batch->stop(); delete format_tools; unlock_window(); } @@ -996,16 +998,17 @@ BatchRenderSaveList::BatchRenderSaveList(BatchRenderThread *thread, int x, int y } BatchRenderSaveList::~BatchRenderSaveList() +{ + stop(); + delete startup_lock; +} + +void BatchRenderSaveList::stop() { startup_lock->lock("BatchRenderSaveList::~BrowseButton"); - if( gui ) { - gui->lock_window(); - gui->set_done(1); - gui->unlock_window(); - } + if( gui ) gui->set_done(1); startup_lock->unlock(); Thread::join(); - delete startup_lock; } int BatchRenderSaveList::handle_event() @@ -1046,7 +1049,6 @@ void BatchRenderSaveList::run() thread->save_jobs(thread->batch_path); } - this->thread->gui->flush(); startup_lock->lock("BatchRenderLoadList::run"); gui = 0; startup_lock->unlock(); @@ -1072,16 +1074,17 @@ BatchRenderLoadList::BatchRenderLoadList(BatchRenderThread *thread, } BatchRenderLoadList::~BatchRenderLoadList() +{ + stop(); + delete startup_lock; +} + +void BatchRenderLoadList::stop() { startup_lock->lock("BatchRenderLoadList::~BrowseButton"); - if( gui ) { - gui->lock_window(); - gui->set_done(1); - gui->unlock_window(); - } + if( gui ) gui->set_done(1); startup_lock->unlock(); Thread::join(); - delete startup_lock; } int BatchRenderLoadList::handle_event() @@ -1125,7 +1128,6 @@ void BatchRenderLoadList::run() thread->gui->change_job(); } - thread->gui->flush(); startup_lock->lock("BatchRenderLoadList::run"); gui = 0; startup_lock->unlock(); diff --git a/cinelerra-5.1/cinelerra/batchrender.h b/cinelerra-5.1/cinelerra/batchrender.h index 3350f792..4a81520b 100644 --- a/cinelerra-5.1/cinelerra/batchrender.h +++ b/cinelerra-5.1/cinelerra/batchrender.h @@ -200,6 +200,7 @@ public: BatchRenderThread *thread; BC_FileBox *gui; void run(); + void stop(); virtual int keypress_event(); Mutex *startup_lock; }; @@ -213,6 +214,7 @@ public: BatchRenderThread *thread; BC_FileBox *gui; void run(); + void stop(); virtual int keypress_event(); Mutex *startup_lock; }; diff --git a/cinelerra-5.1/cinelerra/mwindowedit.C b/cinelerra-5.1/cinelerra/mwindowedit.C index 3016050b..a0856008 100644 --- a/cinelerra-5.1/cinelerra/mwindowedit.C +++ b/cinelerra-5.1/cinelerra/mwindowedit.C @@ -1065,10 +1065,16 @@ void MWindow::overwrite(EDL *source, int all) { FileXML file; + LocalSession *src = source->local_session; double src_start = all ? 0 : - source->local_session->get_selectionstart(); - double overwrite_len = all ? source->tracks->total_length() : - source->local_session->get_selectionend() - src_start; + src->inpoint_valid() ? src->get_inpoint() : + src->outpoint_valid() ? 0 : + src->get_selectionstart(); + double src_end = all ? source->tracks->total_length() : + src->outpoint_valid() ? src->get_outpoint() : + src->inpoint_valid() ? source->tracks->total_length() : + src->get_selectionend(); + double overwrite_len = src_end - src_start; double dst_start = edl->local_session->get_selectionstart(); double dst_len = edl->local_session->get_selectionend() - dst_start; @@ -1989,12 +1995,16 @@ void MWindow::unset_inoutpoint(int is_mwindow) void MWindow::splice(EDL *source, int all) { FileXML file; + LocalSession *src = source->local_session; undo->update_undo_before(); double source_start = all ? 0 : - source->local_session->get_selectionstart(); + src->inpoint_valid() ? src->get_inpoint() : + src->outpoint_valid() ? 0 : src->get_selectionstart(); double source_end = all ? source->tracks->total_length() : - source->local_session->get_selectionend(); + src->outpoint_valid() ? src->get_outpoint() : + src->inpoint_valid() ? source->tracks->total_length() : + src->get_selectionend(); source->copy(source_start, source_end, 1, &file, "", 1); //file.dump(); double start = edl->local_session->get_selectionstart(); diff --git a/cinelerra-5.1/cinelerra/preferencesthread.C b/cinelerra-5.1/cinelerra/preferencesthread.C index 01fb08b2..c0a78d2a 100644 --- a/cinelerra-5.1/cinelerra/preferencesthread.C +++ b/cinelerra-5.1/cinelerra/preferencesthread.C @@ -640,6 +640,7 @@ PreferencesApply::PreferencesApply(MWindow *mwindow, PreferencesThread *thread) int PreferencesApply::handle_event() { thread->apply_settings(); + mwindow->save_defaults(); return 1; } int PreferencesApply::resize_event(int w, int h) diff --git a/cinelerra-5.1/guicast/bcfilebox.C b/cinelerra-5.1/guicast/bcfilebox.C index ae6e15f6..5d755977 100644 --- a/cinelerra-5.1/guicast/bcfilebox.C +++ b/cinelerra-5.1/guicast/bcfilebox.C @@ -223,7 +223,7 @@ int BC_FileBoxDirectoryText::handle_event() BC_FileBoxFilterText::BC_FileBoxFilterText(int x, int y, BC_FileBox *filebox) - : BC_TextBox(x, y, filebox->get_w() - 50, 1, filebox->get_resources()->filebox_filter) + : BC_TextBox(x, y, filebox->get_w() - x - 50, 1, filebox->get_resources()->filebox_filter) { this->filebox = filebox; } @@ -466,6 +466,7 @@ BC_FileBox::BC_FileBox(int x, int y, const char *init_path, column_type = new int[columns]; column_width = new int[columns]; + filter_title = 0; filter_text = 0; filter_popup = 0; usethis_button = 0; @@ -646,9 +647,11 @@ void BC_FileBox::create_objects() y += textbox->get_h() + 10; if(!want_directory) { - add_subwindow(filter_text = new BC_FileBoxFilterText(x, y, this)); + add_subwindow(filter_title = new BC_Title(x, y, _("Specify filter:"))); + int x1 = x + filter_title->get_w() + 10; + add_subwindow(filter_text = new BC_FileBoxFilterText(x1, y, this)); add_subwindow(filter_popup = - new BC_FileBoxFilterMenu(x + filter_text->get_w(), y, this));; + new BC_FileBoxFilterMenu(x1 + filter_text->get_w(), y, this)); } // listbox has to be active because refresh might be called from newfolder_thread @@ -708,7 +711,8 @@ int BC_FileBox::resize_event(int w, int h) w - 30, 0); - + if(filter_title) filter_title->reposition_window(filter_title->get_x(), + h - (get_h() - filter_title->get_y())); if(filter_text) filter_text->reposition_window(filter_text->get_x(), h - (get_h() - filter_text->get_y()), w - (get_w() - filter_text->get_w()), diff --git a/cinelerra-5.1/guicast/bcfilebox.h b/cinelerra-5.1/guicast/bcfilebox.h index 4192077f..4d71a329 100644 --- a/cinelerra-5.1/guicast/bcfilebox.h +++ b/cinelerra-5.1/guicast/bcfilebox.h @@ -307,6 +307,7 @@ private: BC_FileBoxRecent *recent_popup; BC_FileBoxTextBox *textbox; BC_FileBoxListBox *listbox; + BC_Title *filter_title; BC_FileBoxFilterText *filter_text; BC_FileBoxFilterMenu *filter_popup; BC_TextBox *directory_title;