batchrender hang on close, apply pref saves defaults, overwrite/splice tweaks, specif...
authorGood Guy <good1.2guy@gmail.com>
Fri, 22 Jun 2018 18:28:00 +0000 (12:28 -0600)
committerGood Guy <good1.2guy@gmail.com>
Fri, 22 Jun 2018 18:28:00 +0000 (12:28 -0600)
cinelerra-5.1/cinelerra/batchrender.C
cinelerra-5.1/cinelerra/batchrender.h
cinelerra-5.1/cinelerra/mwindowedit.C
cinelerra-5.1/cinelerra/preferencesthread.C
cinelerra-5.1/guicast/bcfilebox.C
cinelerra-5.1/guicast/bcfilebox.h

index 9e45b3ec0a7e13054bee3c1c161fc471516ed1d0..4c5f1d4bac8b1375afda0e996fe89eb3a88f3cfa 100644 (file)
@@ -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();
index 3350f792c3f4050abeaec85873a8bbc6f53d2482..4a81520babf3ba1180863a4f58671504ac31ae05 100644 (file)
@@ -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;
 };
index 3016050ba567e6451c6357143feeea4ff74fa016..a0856008867fa8bcff934ccd1f09479d822c7415 100644 (file)
@@ -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();
index 01fb08b2357655fef946140f5dc1f6bc31817823..c0a78d2a1014d28e025f861e4ed2f0db09ef5752 100644 (file)
@@ -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)
index ae6e15f6f196b3d35ef48320e2198ac2f0c7a126..5d755977c183bfbaa9c424d7234e1021213945f2 100644 (file)
@@ -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()),
index 4192077fdabf2b28be0e295e53ea101943605b7d..4d71a3290a8258044591dd60d2b1d060ecaa8e36 100644 (file)
@@ -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;