Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / timebar.C
index 7dfc7c01e62242886496d644e66b8e17261681ec..4b32cb6a6fceba265fc15d8cacf01f62f52e0bb0 100644 (file)
@@ -2,6 +2,7 @@
 /*
  * CINELERRA
  * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
+ * Copyright (C) 2003-2016 Cinelerra CV contributors
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -746,7 +747,8 @@ int TimeBar::button_press_event()
                        stop_playback();
 
 // Select region between two labels
-                       if( !is_vwindow() && get_double_click() ) {
+                       if( !is_vwindow() && get_double_click() &&
+                           get_edl()->labels->first ) {
                                int x = get_relative_cursor_x();
                                double position = pixel_to_position(x);
 // Test labels
@@ -848,21 +850,21 @@ int TimeBar::button_release_event()
 //printf("TimeBar::button_release_event %d %d\n", __LINE__, current_operation);
        int result = 0;
        int need_redraw = 0;
-       switch( current_operation )
-       {
-               case TIMEBAR_DRAG:
-                       mwindow->gui->get_focused_pane()->canvas->stop_dragscroll();
+       switch( current_operation ) {
+       case TIMEBAR_DRAG: {
+               mwindow->gui->get_focused_pane()->canvas->stop_dragscroll();
+               current_operation = TIMEBAR_NONE;
+               need_redraw = 1;
+               CWindowCanvas *canvas = mwindow->cwindow->gui->canvas;
+               canvas->draw_scope(canvas->refresh_frame, -1);
+               result = 1;
+               break; }
+       default:
+               if( current_operation != TIMEBAR_NONE ) {
                        current_operation = TIMEBAR_NONE;
-                       need_redraw = 1;
                        result = 1;
-                       break;
-
-               default:
-                       if( current_operation != TIMEBAR_NONE ) {
-                               current_operation = TIMEBAR_NONE;
-                               result = 1;
-                       }
-                       break;
+               }
+               break;
        }
 
        if( (!cursor_above() && highlighted) || need_redraw ) {
@@ -918,16 +920,16 @@ int TimeBar::select_region(double position)
        }
 
 // Que the CWindow
-       mwindow->cwindow->gui->lock_window("TimeBar::select_region");
+       unlock_window();
        mwindow->cwindow->update(1, 0, 0);
-       mwindow->cwindow->gui->unlock_window();
-       mwindow->gui->lock_window("TimeBar::select_region");
+       mwindow->gui->lock_window("TimeBar::select_region 3");
        mwindow->gui->hide_cursor(0);
        mwindow->gui->draw_cursor(1);
        mwindow->gui->flash_canvas(0);
        mwindow->gui->activate_timeline();
        mwindow->gui->zoombar->update();
        mwindow->gui->unlock_window();
+       lock_window("TimeBar::select_region 4");
        update_highlights();
        return 0;
 }