summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-01-08 16:53:11 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-01-08 16:53:11 +0000
commit818aa2e2f0d2b178461ecfda996491ab17468817 (patch)
treeb608759f4b3a87fa915242e870d172892d257216 /gtk2_ardour
parent0ddff57b50dfa9f67f8ef5af1e6a36ee1e9dadda (diff)
simplify and legalize call to TempoMap::get_grid() when getting grid points
git-svn-id: svn://localhost/ardour2/branches/3.0@11195 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_tempodisplay.cc24
1 files changed, 3 insertions, 21 deletions
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc
index 14782e4bc5..005e7ff6fd 100644
--- a/gtk2_ardour/editor_tempodisplay.cc
+++ b/gtk2_ardour/editor_tempodisplay.cc
@@ -148,28 +148,10 @@ Editor::compute_current_bbt_points (framepos_t leftmost, framepos_t rightmost)
return;
}
- Timecode::BBT_Time previous_beat, next_beat; // the beats previous to the leftmost frame and after the rightmost frame
+ /* prevent negative values of leftmost from creeping into tempomap
+ */
- _session->bbt_time(leftmost, previous_beat);
- _session->bbt_time(rightmost, next_beat);
-
- if (previous_beat.beats > 1) {
- previous_beat.beats -= 1;
- } else if (previous_beat.bars > 1) {
- previous_beat.bars--;
- previous_beat.beats += 1;
- }
- previous_beat.ticks = 0;
-
- if (_session->tempo_map().meter_at(rightmost).divisions_per_bar () > next_beat.beats + 1) {
- next_beat.beats += 1;
- } else {
- next_beat.bars += 1;
- next_beat.beats = 1;
- }
- next_beat.ticks = 0;
-
- _session->tempo_map().get_grid (current_bbt_points_begin, current_bbt_points_end, _session->tempo_map().frame_time (previous_beat), _session->tempo_map().frame_time (next_beat) + 1);
+ _session->tempo_map().get_grid (current_bbt_points_begin, current_bbt_points_end, max (leftmost, (framepos_t) 0), rightmost);
}
void