Relayer punch/loop range rects, fix display of punch-in with no punch-out, ensure...
authorNick Mainsbridge <beatroute@iprimus.com.au>
Mon, 29 Sep 2008 18:21:33 +0000 (18:21 +0000)
committerNick Mainsbridge <beatroute@iprimus.com.au>
Mon, 29 Sep 2008 18:21:33 +0000 (18:21 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3835 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor.cc
gtk2_ardour/editor_canvas.cc
gtk2_ardour/editor_markers.cc
gtk2_ardour/editor_mouse.cc
gtk2_ardour/editor_rulers.cc

index b171304f6f9ae256addc4fc612294ef11531a147..2b10e2421d0d7086bed8441d9c105055d79240a2 100644 (file)
@@ -4397,10 +4397,8 @@ Editor::idle_visual_changer ()
                /* if we seek beyond the current end of the canvas, move the end */
 
                if (current_time_origin != pending_visual_change.time_origin) {
-                       //if (horizontal_adjustment.get_upper() < pending_visual_change.time_origin) {
                        last_canvas_frame = (cef > (pending_visual_change.time_origin + current_page_frames())) ? cef : pending_visual_change.time_origin + current_page_frames();
                        horizontal_adjustment.set_upper ((cef - csf) / frames_per_unit);
-                       //}
                        horizontal_adjustment.set_value (pending_visual_change.time_origin / frames_per_unit);
                } else {
                        update_fixed_rulers();
index a0f6c8513f624ec59025e24c7a7d8b180ef217ef..53f114c962919e4b830ce93267316d9bb39b13d8 100644 (file)
@@ -127,9 +127,20 @@ Editor::initialize_canvas ()
 
        _master_group = new ArdourCanvas::Group (*track_canvas->root());
 
+       transport_loop_range_rect = new ArdourCanvas::SimpleRect (*_master_group, 0.0, 0.0, 0.0, 0.0);
+       transport_loop_range_rect->property_outline_pixels() = 1;
+       transport_loop_range_rect->hide();
+
+       transport_punch_range_rect = new ArdourCanvas::SimpleRect (*_master_group, 0.0, 0.0, 0.0, 0.0);
+       transport_punch_range_rect->property_outline_pixels() = 0;
+       transport_punch_range_rect->hide();
+
        /* a group to hold time (measure) lines */      
        time_line_group = new ArdourCanvas::Group (*_master_group, 0.0, 0.0);
 
+       range_marker_drag_rect = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, 0.0);
+       range_marker_drag_rect->hide ();
+
        _trackview_group = new ArdourCanvas::Group (*_master_group);
        _region_motion_group = new ArdourCanvas::Group (*_trackview_group);
 
@@ -163,9 +174,6 @@ Editor::initialize_canvas ()
        cd_marker_bar->property_outline_what() = (0x1 | 0x8);
        cd_marker_bar->property_outline_pixels() = 0;
 
-       range_marker_drag_rect = new ArdourCanvas::SimpleRect (*time_line_group, 0.0, 0.0, 0.0, 0.0);
-       range_marker_drag_rect->hide ();
-
        timebar_group =  new ArdourCanvas::Group (*track_canvas->root(), 0.0, 0.0);
        cursor_group = new ArdourCanvas::Group (*track_canvas->root(), 0.0, 0.0);
 
@@ -196,16 +204,6 @@ Editor::initialize_canvas ()
        transport_bar_drag_rect->property_outline_pixels() = 0;
        transport_bar_drag_rect->hide ();
 
-       transport_loop_range_rect = new ArdourCanvas::SimpleRect (*_master_group, 0.0, 0.0, 0.0, 0.0);
-       transport_loop_range_rect->property_outline_pixels() = 1;
-       transport_loop_range_rect->hide();
-
-       transport_punch_range_rect = new ArdourCanvas::SimpleRect (*_master_group, 0.0, 0.0, 0.0, 0.0);
-       transport_punch_range_rect->property_outline_pixels() = 0;
-       transport_punch_range_rect->hide();
-       
-       transport_loop_range_rect->lower_to_bottom (); // loop on the bottom
-
        transport_punchin_line = new ArdourCanvas::SimpleLine (*_master_group);
        transport_punchin_line->property_x1() = 0.0;
        transport_punchin_line->property_y1() = 0.0;
index c51297063b2cf22ede30c69deaefe11768f410e6..f70cf2092b0833a5a58df39547a5972816ae521f 100644 (file)
@@ -1170,51 +1170,22 @@ Editor::update_punch_range_view (bool visibility)
        Location* tpl;
 
        if ((Config->get_punch_in() || Config->get_punch_out()) && ((tpl = transport_punch_location()) != 0)) {
-
-               double x1 = frame_to_pixel (tpl->start());
-               double x2 = frame_to_pixel (tpl->end());
-               
                guint track_canvas_width,track_canvas_height;
                track_canvas->get_size(track_canvas_width,track_canvas_height);
-               
-               transport_punch_range_rect->property_x1() = x1;
-               transport_punch_range_rect->property_x2() = x2;
-               
-               transport_punch_range_rect->property_x1() = (Config->get_punch_in() ? x1 : 0);
-               transport_punch_range_rect->property_x2() = (Config->get_punch_out() ? x2 : track_canvas_width);
+               if (Config->get_punch_in()) {
+                       transport_punch_range_rect->property_x1() = frame_to_pixel (tpl->start());
+                       transport_punch_range_rect->property_x2() = (Config->get_punch_out() ? frame_to_pixel (tpl->end()) : frame_to_pixel (JACK_MAX_FRAMES));
+               } else {
+                       transport_punch_range_rect->property_x1() = 0;
+                       transport_punch_range_rect->property_x2() = (Config->get_punch_out() ? frame_to_pixel (tpl->end()) : track_canvas_width);
+               }
                
                if (visibility) {
                        transport_punch_range_rect->show();
                }
-       }
-       else if (visibility) {
+       } else if (visibility) {
                transport_punch_range_rect->hide();
        }
-
-//     if (session->get_punch_in()) {
-//             double x = frame_to_pixel (transport_punch_location->start());
-//             gnome_canvas_item_set (transport_punchin_line, "x1", x, "x2", x, NULL);
-               
-//             if (visibility) {
-//                     gnome_canvas_item_show (transport_punchin_line);
-//             }
-//     }
-//     else if (visibility) {
-//             gnome_canvas_item_hide (transport_punchin_line);
-//     }
-       
-//     if (session->get_punch_out()) {
-//             double x = frame_to_pixel (transport_punch_location->end());
-               
-//             gnome_canvas_item_set (transport_punchout_line, "x1", x, "x2", x, NULL);
-               
-//             if (visibility) {
-//                     gnome_canvas_item_show (transport_punchout_line);
-//             }
-//     }
-//     else if (visibility) {
-//             gnome_canvas_item_hide (transport_punchout_line);
-//     }
 }
 
 void
index 048ac955c15ae8f7a40fe3e2f8d8636d751b6677..2ec7ba4c688a4aa255378baec31f0a264d429356 100644 (file)
@@ -1806,6 +1806,7 @@ Editor::finalize_drag ()
        drag_info.last_pointer_frame = 0;
        drag_info.current_pointer_frame = 0;
        drag_info.brushing = false;
+       range_marker_drag_rect->hide();
        drag_info.clear_copied_locations ();
 }
 
index 04e66d5ae1e994b95d233017407c6f084a852314..415945b36df73371d2aa7b26efca1baa9cc413d8 100644 (file)
@@ -782,7 +782,7 @@ Editor::update_ruler_visibility ()
        }
        
        gdouble old_canvas_timebars_vsize = canvas_timebars_vsize;
-       canvas_timebars_vsize = timebar_height * visible_timebars;
+       canvas_timebars_vsize = (timebar_height * visible_timebars) - 1;
        gdouble vertical_pos_delta = canvas_timebars_vsize - old_canvas_timebars_vsize;
 
        if (vertical_pos_delta < 0 && (vertical_adjustment.get_value() + canvas_height) >= vertical_adjustment.get_upper()) {