summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_rulers.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-05-31 21:15:28 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-05-31 21:15:28 +0000
commit52a8242a1158426caeed4757bbc3f7f71091e351 (patch)
tree43de2da9007dd8178162e80b778586f1b460eb12 /gtk2_ardour/editor_rulers.cc
parent539aa71d180d6b3d5c887707c356d3d00c0b37e8 (diff)
fixup botched xfade-as-audioregion; apply work from 2.0-ongoing
git-svn-id: svn://localhost/ardour2/trunk@1933 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_rulers.cc')
-rw-r--r--gtk2_ardour/editor_rulers.cc25
1 files changed, 4 insertions, 21 deletions
diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc
index a101d5cc03..9b57568af7 100644
--- a/gtk2_ardour/editor_rulers.cc
+++ b/gtk2_ardour/editor_rulers.cc
@@ -268,8 +268,7 @@ Editor::ruler_mouse_motion (GdkEventMotion* ev)
nframes_t where = leftmost_frame + pixel_to_frame (x);
/// ripped from maybe_autoscroll, and adapted to work here
- nframes_t one_page = (nframes_t) rint (canvas_width * frames_per_unit);
- nframes_t rightmost_frame = leftmost_frame + one_page;
+ nframes_t rightmost_frame = leftmost_frame + current_page_frames ();
jack_nframes_t frame = pixel_to_frame (cx);
@@ -730,12 +729,7 @@ Editor::update_just_smpte ()
return;
}
- /* XXX Note the potential loss of accuracy here as we convert from
- an uint32_t (or larger) to a float ... what to do ?
- */
-
- nframes_t page = (nframes_t) floor (canvas_width * frames_per_unit);
- nframes_t rightmost_frame = leftmost_frame + page;
+ nframes_t rightmost_frame = leftmost_frame + current_page_frames();
if (ruler_shown[ruler_metric_smpte]) {
gtk_custom_ruler_set_range (GTK_CUSTOM_RULER(_smpte_ruler), leftmost_frame, rightmost_frame,
@@ -752,17 +746,11 @@ Editor::update_fixed_rulers ()
return;
}
- /* XXX Note the potential loss of accuracy here as we convert from
- an uint32_t (or larger) to a float ... what to do ?
- */
-
- nframes_t page = (nframes_t) floor (canvas_width * frames_per_unit);
-
ruler_metrics[ruler_metric_smpte].units_per_pixel = frames_per_unit;
ruler_metrics[ruler_metric_frames].units_per_pixel = frames_per_unit;
ruler_metrics[ruler_metric_minsec].units_per_pixel = frames_per_unit;
- rightmost_frame = leftmost_frame + page;
+ rightmost_frame = leftmost_frame + current_page_frames ();
/* these force a redraw, which in turn will force execution of the metric callbacks
to compute the relevant ticks to display.
@@ -791,15 +779,10 @@ Editor::update_tempo_based_rulers ()
return;
}
- /* XXX Note the potential loss of accuracy here as we convert from
- an uint32_t (or larger) to a float ... what to do ?
- */
-
- nframes_t page = (nframes_t) floor (canvas_width * frames_per_unit);
ruler_metrics[ruler_metric_bbt].units_per_pixel = frames_per_unit;
if (ruler_shown[ruler_metric_bbt]) {
- gtk_custom_ruler_set_range (GTK_CUSTOM_RULER(_bbt_ruler), leftmost_frame, leftmost_frame+page,
+ gtk_custom_ruler_set_range (GTK_CUSTOM_RULER(_bbt_ruler), leftmost_frame, leftmost_frame+current_page_frames(),
leftmost_frame, session->current_end_frame());
}
}