RafaMar + programmer friend Help button in Batch Render addition
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / timebar.C
index 44e321724135526a203b68c2d3286f1165131ca6..68f42b5a13eaf47fb5f71b0f04111b458b0f0768 100644 (file)
@@ -277,20 +277,16 @@ void TimeBar::update_labels()
 // Create new label
                                if( output >= labels.total ) {
                                        LabelGUI *new_label;
-                                       add_subwindow(new_label =
-                                               new LabelGUI(mwindow,
-                                                       this,
-                                                       pixel,
-                                                       LabelGUI::get_y(mwindow, this),
+                                       add_subwindow(new_label = new LabelGUI(mwindow, this,
+                                                       pixel, LabelGUI::get_y(mwindow, this),
                                                        current->position));
                                        new_label->set_cursor(INHERIT_CURSOR, 0, 0);
                                        new_label->set_tooltip(current->textstr);
                                        new_label->label = current;
                                        labels.append(new_label);
                                }
-                               else
 // Reposition old label
-                               {
+                               else {
                                        LabelGUI *gui = labels.values[output];
                                        if( gui->pixel != pixel ) {
                                                gui->pixel = pixel;
@@ -362,7 +358,7 @@ void TimeBar::draw_inout_highlight()
        CLAMP(in_x, 0, get_w());
        CLAMP(out_x, 0, get_w());
        set_color(mwindow->theme->inout_highlight_color);
-       int lw = 5;
+       int lw = xS(5);
        set_line_width(lw);
        set_inverse();
        draw_line(in_x, get_h()-2*lw, out_x, get_h()-2*lw);
@@ -537,14 +533,10 @@ EDL* TimeBar::get_edl()
 
 void TimeBar::draw_range()
 {
-
-
 //printf("TimeBar::draw_range %d %p\n", __LINE__, get_edl());
        if( has_preview() && get_edl() ) {
                int x1, x2;
                get_preview_pixels(x1, x2);
-
-//printf("TimeBar::draw_range %f %d %d\n", edl_length, x1, x2);
                draw_3segmenth(0, 0, x1, mwindow->theme->timebar_view_data);
                draw_top_background(get_parent(), x1, 0, x2 - x1, get_h());
                draw_3segmenth(x2, 0, get_w() - x2, mwindow->theme->timebar_view_data);
@@ -754,7 +746,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
@@ -856,21 +849,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 ) {
@@ -926,23 +919,21 @@ 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;
 }
 
 
-
-
 int TimeBar::delete_arrows()
 {
        return 0;