shuttlerc, boobytraps, vwindow hang, lock cleanup
authorGood Guy <[email protected]>
Thu, 14 Feb 2019 19:47:07 +0000 (12:47 -0700)
committerGood Guy <[email protected]>
Thu, 14 Feb 2019 19:47:07 +0000 (12:47 -0700)
15 files changed:
cinelerra-5.1/cinelerra/awindowgui.C
cinelerra-5.1/cinelerra/channeledit.C
cinelerra-5.1/cinelerra/cwindowgui.C
cinelerra-5.1/cinelerra/keyframegui.C
cinelerra-5.1/cinelerra/mainerror.C
cinelerra-5.1/cinelerra/manualgoto.C
cinelerra-5.1/cinelerra/preferencesthread.C
cinelerra-5.1/cinelerra/vtimebar.C
cinelerra-5.1/cinelerra/vwindow.C
cinelerra-5.1/cinelerra/vwindow.h
cinelerra-5.1/cinelerra/vwindowgui.C
cinelerra-5.1/guicast/bcdialog.C
cinelerra-5.1/guicast/bcdialog.h
cinelerra-5.1/guicast/mutex.C
cinelerra-5.1/shuttlerc

index 2597f52e61c9d809153e4a194de357ba8b4b8ad4..a36c4191e6fffddb55ecdd07a4bbff29313e58a4 100644 (file)
@@ -399,7 +399,7 @@ int AssetViewPopup::button_press_event()
                vedl->set_outpoint(end);
                vedl->local_session->set_selectionstart(start);
                vedl->local_session->set_selectionend(end);
-               vwindow->update_position(CHANGE_NONE, 0, 1, 0);
+               vwindow->update_position();
                return 1;
        }
        else {
index 9a81984e5d907a981f89d0b2058a472f9fe94963..db680c171d9b0b2646bca50c108af0c943e0e492 100644 (file)
@@ -703,7 +703,6 @@ void ConfirmScanThread::handle_done_event(int result)
        gui->channel_picker->save_scan_defaults(&gui->thread->scan_params);
        if(!result)
        {
-               get_gui()->hide_window();
                gui->lock_window("ConfirmScanThread::handle_done_event");
                gui->scan();
                gui->unlock_window();
index e88b9a3f0e6d95ca88caa67dbc2c6d433fe2ed8c..a8472145fd4463c749a683bac6b1e5a18253d3e1 100644 (file)
@@ -841,6 +841,7 @@ CWindowEditing::CWindowEditing(MWindow *mwindow, CWindow *cwindow)
 #define panel_btn(fn, args, s) \
  panel_fn(panel_##fn, args, mwindow->gui->mbuttons->edit_panel->panel_##s)
 
+
 double CWindowEditing::get_position()
 {
        relock_cm("get_position");
@@ -852,18 +853,19 @@ double CWindowEditing::get_position()
 void CWindowEditing::set_position(double position)
 {
        relock_cm("set_position");
-       set_position(position);
+       mwindow->gui->mbuttons->edit_panel->set_position(position);
        relock_mc("set_position");
 }
 
 void CWindowEditing::set_click_to_play(int v)
 {
-       relock_cm("set_click_to_play");
+       relock_cm("set_position");
        mwindow->edl->session->cwindow_click2play = v;
+       relock_mc("set_position");
        click2play->update(v);
-       relock_mc("set_click_to_play");
 }
 
+
 void panel_btn(stop_transport,(), stop_transport())
 void panel_btn(toggle_label,(), toggle_label())
 void panel_btn(next_label,(int cut), next_label(cut))
index a8f99a73c51f2003c35d51dc3112a0bcbe6855a2..49c9022900ce2e35620e8d0fdc00346af5c8f46c 100644 (file)
@@ -218,13 +218,13 @@ void KeyFrameThread::handle_close_event(int result)
 
 void KeyFrameThread::close_window()
 {
-       lock_window("KeyFrameThread::close_window");
+       lock_dialog("KeyFrameThread::close_window");
        if( get_gui() ) {
                get_gui()->lock_window("KeyFrameThread::close_window");
                get_gui()->set_done(1);
                get_gui()->unlock_window();
        }
-       unlock_window();
+       unlock_dialog();
 }
 
 
@@ -261,7 +261,7 @@ void KeyFrameThread::update_gui(int update_value_text)
                update_values();
                mwindow->gui->unlock_window();
 
-               lock_window("KeyFrameThread::update_gui");
+               lock_dialog("KeyFrameThread::update_gui");
                KeyFrameWindow *window = (KeyFrameWindow*)get_gui();
                if( window ) {
                        window->lock_window("KeyFrameThread::update_gui");
@@ -280,7 +280,7 @@ void KeyFrameThread::update_gui(int update_value_text)
                        }
                        window->unlock_window();
                }
-               unlock_window();
+               unlock_dialog();
        }
 #endif
 }
index 61ffa7c46b433c09611844598cd704b87cd70115..4fdc592f49bd00cea67db480960150ef84236548 100644 (file)
@@ -168,7 +168,7 @@ void MainError::append_error(const char *string)
 void MainError::show_error_local(const char *string)
 {
 // assume user won't get to closing the GUI here
-       lock_window("MainError::show_error_local");
+       lock_dialog("MainError::show_error_local");
        if( get_gui() ) {
                MainErrorGUI *gui = (MainErrorGUI*)get_gui();
                gui->lock_window("MainError::show_error_local");
@@ -186,7 +186,7 @@ void MainError::show_error_local(const char *string)
                append_error(string);
                start();
        }
-       unlock_window();
+       unlock_dialog();
 }
 
 
index 966def18e5190cb06902e9d1e99f3b136afdc2eb..8aa5cabd690f7018b9a4e93a170e1ef3ae8427e4 100644 (file)
@@ -64,7 +64,9 @@ void ManualGoto::handle_done_event(int result)
        case '-':  new_position = current_position - new_position;  break;
        default: break;
        }
+       panel->subwindow->lock_window("ManualGoto::handle_done_event");
        panel->set_position(new_position);
+       panel->subwindow->unlock_window();
 }
 
 
@@ -81,7 +83,7 @@ ManualGotoWindow::~ManualGotoWindow()
 
 void ManualGotoWindow::reset_data(double position)
 {
-       lock_window();
+       lock_window("ManualGotoWindow::reset_data");
        update_position(position);
        signtitle->update("=");
        unlock_window();
index 6c4707dda15000939dc8ebcfb22db1d43c84db7b..58b659c43a94153ca78dde74fe10b8b1e983a391 100644 (file)
@@ -174,10 +174,10 @@ int PreferencesThread::update_framerate()
 {
        if(thread_running)
        {
-               lock_gui("PreferencesThread::update_framerate");
+               lock_dialog("PreferencesThread::update_framerate");
                PreferencesWindow *window = (PreferencesWindow*)get_gui();
                if(window) window->update_framerate();
-               unlock_gui();
+               unlock_dialog();
        }
        return 0;
 }
@@ -187,10 +187,10 @@ void PreferencesThread::update_rates()
 {
        if(thread_running)
        {
-               lock_gui("PreferencesThread::update_framerate");
+               lock_dialog("PreferencesThread::update_framerate");
                PreferencesWindow *window = (PreferencesWindow*)get_gui();
                if(window) window->update_rates();
-               unlock_gui();
+               unlock_dialog();
        }
 }
 
index 6e79b89eb8dde10be73e213d8e6b41507cc5064a..80447e881351ccdd668105cb0ab2f0f3a52b84c5 100644 (file)
@@ -92,10 +92,7 @@ void VTimeBar::select_label(double position)
                }
 
 // Que the CWindow
-               gui->vwindow->update_position(CHANGE_NONE,
-                       0,
-                       1,
-                       0);
+               gui->vwindow->update_position();
                update(1);
        }
 }
index df7bef70e0b0b24e7520084b02ca256ef29b3d5d..0b75fc0ccfb0dfe58854ad1b5efa143c6455f803 100644 (file)
@@ -188,7 +188,7 @@ void VWindow::change_source(int edl_number)
                this->edl = mwindow->edl->get_vwindow_edl(edl_number);
                this->edl->Garbage::add_user();
                gui->change_source(get_edl(), get_edl()->local_session->clip_title);
-               update_position(CHANGE_ALL, 1, 1, 1);
+               update_position(CHANGE_ALL);
        }
        else
        {
@@ -230,8 +230,7 @@ void VWindow::change_source(Indexable *indexable)
 
 // Update GUI
        gui->change_source(this->edl, title);
-       update_position(CHANGE_ALL, 1, 1, 1);
-
+       update_position(CHANGE_ALL);
        gui->unlock_window();
 }
 
@@ -265,7 +264,7 @@ void VWindow::change_source(EDL *edl)
 
 // Update GUI
                gui->change_source(edl, edl->local_session->clip_title);
-               update_position(CHANGE_ALL, 1, 1, 1);
+               update_position(CHANGE_ALL);
        }
        else
                gui->change_source(edl, _("Viewer"));
@@ -275,28 +274,20 @@ void VWindow::change_source(EDL *edl)
 
 void VWindow::goto_start()
 {
-       if(get_edl())
-       {
+       if( get_edl() ) {
                get_edl()->local_session->set_selectionstart(0);
                get_edl()->local_session->set_selectionend(0);
-               update_position(CHANGE_NONE,
-                       0,
-                       1,
-                       0);
+               update_position();
        }
 }
 
 void VWindow::goto_end()
 {
-       if(get_edl())
-       {
+       if( get_edl() ) {
                double position = get_edl()->tracks->total_length();
                get_edl()->local_session->set_selectionstart(position);
                get_edl()->local_session->set_selectionend(position);
-               update_position(CHANGE_NONE,
-                       0,
-                       1,
-                       0);
+               update_position();
        }
 }
 
@@ -307,23 +298,16 @@ void VWindow::update(int do_timebar)
        gui->edit_panel->update();
 }
 
-void VWindow::update_position(int change_type,
-       int use_slider,
-       int update_slider,
-       int lock_window)
+void VWindow::update_position(int change_type)
 {
        EDL *edl = get_edl();
-       if(edl)
-       {
-//printf("VWindow::update_position %d\n", __LINE__);
-//edl->dump();
+       if(edl) {
+               gui->unlock_window();
                playback_engine->refresh_frame(change_type, edl);
-
+               gui->lock_window("VWindow::update_position");
                double position = edl->local_session->get_selectionstart(1);
-               if(lock_window) gui->lock_window("VWindow::update_position");
                gui->clock->update(position);
                gui->timebar->update(1);
-               if(lock_window) gui->unlock_window();
        }
 }
 
@@ -332,23 +316,23 @@ void VWindow::stop_playback(int wait)
        playback_engine->stop_playback(wait);
 }
 
+void VWindow::interrupt_playback(int wait)
+{
+       gui->unlock_window();
+       playback_engine->interrupt_playback(wait);
+       gui->lock_window("VWindow::interrupt_playback");
+}
+
 int VWindow::update_position(double position)
 {
        EDL *edl = get_edl();
-       if(edl)
-       {
-               gui->unlock_window();
-
-               playback_engine->interrupt_playback(1);
-
+       if(edl) {
+               interrupt_playback(1);
                position = mwindow->edl->align_to_frame(position, 0);
                position = MAX(0, position);
-
                edl->local_session->set_selectionstart(position);
                edl->local_session->set_selectionend(position);
-
-               gui->lock_window("VWindow::update_position 1");
-               update_position(CHANGE_NONE, 0, 1, 0);
+               update_position();
        }
 
        return 1;
@@ -357,8 +341,7 @@ int VWindow::update_position(double position)
 void VWindow::set_inpoint()
 {
        EDL *edl = get_edl();
-       if(edl)
-       {
+       if(edl) {
                edl->set_inpoint(edl->local_session->get_selectionstart(1));
                gui->timebar->update(1);
        }
index d2a789a4e01659635376560ffcc06a5cdb51f9bf..5d13e672ecf7b17d7897c16b43fa099baadab3ca 100644 (file)
@@ -62,10 +62,7 @@ public:
        Indexable* get_source();
        void update(int do_timebar);
 
-       void update_position(int change_type = CHANGE_NONE,
-               int use_slider = 1,
-               int update_slider = 0,
-               int lock_window = 0);
+       void update_position(int change_type = CHANGE_NONE);
        int update_position(double position);
        void set_inpoint();
        void set_outpoint();
@@ -77,6 +74,7 @@ public:
        void goto_start();
        void goto_end();
        void stop_playback(int wait);
+       void interrupt_playback(int wait);
 
        VTracking *playback_cursor;
 
index 52ef387e38dae4295bb698777a7f5839fce105d4..814161b67854d1286a0d72aafa4612228c6697fd 100644 (file)
@@ -590,7 +590,7 @@ void VWindowEditing::set_position(double position)
                if( position < 0 ) position = 0;
                edl->local_session->set_selectionstart(position);
                edl->local_session->set_selectionend(position);
-               vwindow->update_position(CHANGE_NONE, 0, 1);
+               vwindow->update_position();
        }
 }
 
@@ -620,9 +620,7 @@ void VWindowEditing::panel_toggle_label()
 void VWindowEditing::panel_next_label(int cut)
 {
        if( !vwindow->get_edl() ) return;
-       vwindow->gui->unlock_window();
-       vwindow->playback_engine->interrupt_playback(1);
-       vwindow->gui->lock_window("VWindowEditing::next_label");
+       vwindow->interrupt_playback(1);
 
        EDL *edl = vwindow->get_edl();
        Label *current = edl->labels->next_label(
@@ -631,16 +629,14 @@ void VWindowEditing::panel_next_label(int cut)
                edl->tracks->total_length();
        edl->local_session->set_selectionstart(position);
        edl->local_session->set_selectionend(position);
-       vwindow->update_position(CHANGE_NONE, 0, 1, 0);
+       vwindow->update_position();
        vwindow->gui->timebar->update(1);
 }
 
 void VWindowEditing::panel_prev_label(int cut)
 {
        if( !vwindow->get_edl() ) return;
-       vwindow->gui->unlock_window();
-       vwindow->playback_engine->interrupt_playback(1);
-       vwindow->gui->lock_window("VWindowEditing::prev_label");
+       vwindow->interrupt_playback(1);
 
        EDL *edl = vwindow->get_edl();
        Label *current = edl->labels->prev_label(
@@ -648,7 +644,7 @@ void VWindowEditing::panel_prev_label(int cut)
        double position = !current ? 0 : current->position;
        edl->local_session->set_selectionstart(position);
        edl->local_session->set_selectionend(position);
-       vwindow->update_position(CHANGE_NONE, 0, 1, 0);
+       vwindow->update_position();
        vwindow->gui->timebar->update(1);
 }
 
@@ -818,9 +814,7 @@ void VWindowCanvas::zoom_resize_window(float percentage)
 
 void VWindowCanvas::close_source()
 {
-       gui->unlock_window();
-       gui->vwindow->playback_engine->interrupt_playback(1);
-       gui->lock_window("VWindowCanvas::close_source");
+       gui->vwindow->interrupt_playback(1);
        gui->vwindow->delete_source(1, 1);
 }
 
index ef834919c6f250388c974eae0a881a1761d2d521..64960351f68e3e041bfe93655c96d8a8175866f8 100644 (file)
@@ -51,12 +51,12 @@ BC_DialogThread::~BC_DialogThread()
        delete window_lock;
 }
 
-void BC_DialogThread::lock_window(const char *location)
+void BC_DialogThread::lock_dialog(const char *location)
 {
        window_lock->lock(location);
 }
 
-void BC_DialogThread::unlock_window()
+void BC_DialogThread::unlock_dialog()
 {
        window_lock->unlock();
 }
@@ -107,17 +107,6 @@ void BC_DialogThread::run()
        handle_close_event(result);
 }
 
-void BC_DialogThread::lock_gui(const char *location)
-{
-       window_lock->lock(location);
-}
-
-void BC_DialogThread::unlock_gui()
-{
-       window_lock->unlock();
-}
-
-
 BC_Window* BC_DialogThread::new_gui()
 {
        printf("BC_DialogThread::new_gui called\n");
@@ -139,14 +128,14 @@ void BC_DialogThread::handle_close_event(int result)
 
 void BC_DialogThread::close_window()
 {
-       lock_window("BC_DialogThread::close_window");
+       lock_dialog("BC_DialogThread::close_window");
        if(gui)
        {
                gui->lock_window("BC_DialogThread::close_window");
                gui->set_done(1);
                gui->unlock_window();
        }
-       unlock_window();
+       unlock_dialog();
        join();
 }
 
index bbdef7c7396afa32bdf967c853515d8b7042232f..1318a996c699b1cd6f92cdbec00c08612f60ae92 100644 (file)
@@ -63,8 +63,8 @@ public:
        BC_Window* get_gui();
 
 // Called by user to access the gui pointer
-       void lock_window(const char *location);
-       void unlock_window();
+       void lock_dialog(const char *location);
+       void unlock_dialog();
 
 // Called by user to close the GUI from outside the thread
        void close_window();
index 36dbfb925bdcda8b99ff953881c65a9405120fb5..9acbfc9f70aea726bee4dd2f298a59d6a33addd7 100644 (file)
@@ -91,6 +91,7 @@ int Mutex::unlock()
 {
        if( count <= 0 ) {
                printf("Mutex::unlock not locked: %s\n", title);
+               booby();
                return 0;
        }
 // Remove from recursive status
index 1f5758f9d389d88668c709a65c24c8904c5392e5..2bb7bfd1d43c1b68fb9781b7a12cd11e2d884018 100644 (file)
@@ -1,7 +1,7 @@
 
 # uncomment to enable diagnostics
 #DEBUG
-# uncommet to use direct usb
+# uncomment to use direct usb
 #USB_DIRECT
 
 # redefine default, use
 
 # Most useful functions have to be on K5-K9 because Xpress only has 5 keys
  K5 XK_Home    # Beginning
- K6 XK_KP_3    # Play, or if playing Stop
+ K6 XK_KP_6    # Reverse, or if playing Stop
  K7 XK_KP_0    # Stop
- K8 XK_KP_6    # Reverse, or if playing Stop
+ K8 XK_KP_3    # Play, or if playing Stop
  K9 XK_End     # End
 
-# K10 "["      # Switch if K14 not working
-# K11 "]"      # Switch if K15 not working
- K10 Alt-XK_Left
- K11 Alt-XK_Right
- K12 XK_Home    # Beginning
- K13 XK_End     # End
+ K10 Alt-XK_Left  # Go to previous edit
+ K11 Alt-XK_Right # Go to next edit
+ K12 Ctrl-XK_Left  # Go to previous label
+ K13 Ctrl-XK_Right # Go to next label 
  K14 "["        # Toggle in
  K15 "]"        # Toggle out
 
 
 # Most useful functions have to be on K5-K9 because Xpress only has 5 keys
  K5 XK_Home    # Beginning
- K6 XK_KP_3    # Play, or if playing Stop
+ K6 XK_KP_6    # Reverse, or if playing Stop
  K7 "f"                # Go in or out of Fullscreen mode
- K8 XK_KP_6    # Reverse, of if playing Stop
+ K8 XK_KP_3    # Play, of if playing Stop
  K9 XK_End     # End
 
- K10 "["       # Temporary until K14 Pro fixed
- K11 "]"       # Temporary until K15 Pro fixed
- K12 XK_Home    # Beginning
- K13 XK_End     # End
+ K10 Alt-XK_Left  # Go to previous edit
+ K11 Alt-XK_Right # Go to next edit
+ K12 Ctrl-XK_Left  # Go to previous label
+ K13 Ctrl-XK_Right # Go to next label 
  K14 "["        # Toggle in
  K15 "]"        # Toggle out
-
  K1 "i"                # Clip
  K2 "x"                # Cut
  K3 "c"                # Copy
 
 # Most useful functions have to be on K6-K9 because Xpress only has 5 keys
  K5 XK_Home    # Beginning
- K6 XK_KP_3    # Play, or if playing Stop
+ K6 XK_KP_6    # Reverse, or if playing Stop
  K7 "f"                # Go in or out of Fullscreen mode
- K8 XK_KP_6    # Reverse, or if playing Stop
+ K8 XK_KP_3    # Play, or if playing Stop
  K9 XK_End     # End
 
- K10 "["       # Temporary until K14 Pro fixed
- K11 "]"       # Temporary until K15 Pro fixed
- K12 XK_Home    # Beginning
- K13 XK_End     # End
+ K10 "["       # Toggle in if no K14
+ K11 "]"       # Toggle in if no K15
+ K12 Alt-XK_Left  # Go to previous edit
+ K13 Alt-XK_Right # Go to next edit
  K14 "["        # Toggle in
  K15 "]"        # Toggle out
-
  K1 "i"                # Clip
  K2 "v"                # Splice
  K3 "c"                # Copy