summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mainsbridge <beatroute@iprimus.com.au>2008-09-29 18:21:33 +0000
committerNick Mainsbridge <beatroute@iprimus.com.au>2008-09-29 18:21:33 +0000
commitc1f85106cc8dc8e9234b3774e2457c0adcfbeabd (patch)
treeb0cabd05484f9296d80c03d6bd10624cd2302de2
parent3f81ed9bdd091271dc57f56ea545734142229102 (diff)
Relayer punch/loop range rects, fix display of punch-in with no punch-out, ensure range selection rect is hidden after single click, move the track canvas up one pixel now that headers are all one size.
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3835 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/editor.cc2
-rw-r--r--gtk2_ardour/editor_canvas.cc24
-rw-r--r--gtk2_ardour/editor_markers.cc45
-rw-r--r--gtk2_ardour/editor_mouse.cc1
-rw-r--r--gtk2_ardour/editor_rulers.cc2
5 files changed, 21 insertions, 53 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index b171304f6f..2b10e2421d 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -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();
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index a0f6c8513f..53f114c962 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -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;
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc
index c51297063b..f70cf2092b 100644
--- a/gtk2_ardour/editor_markers.cc
+++ b/gtk2_ardour/editor_markers.cc
@@ -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
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index 048ac955c1..2ec7ba4c68 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -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 ();
}
diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc
index 04e66d5ae1..415945b36d 100644
--- a/gtk2_ardour/editor_rulers.cc
+++ b/gtk2_ardour/editor_rulers.cc
@@ -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()) {