tempo_lines->tempo_map_changed();
}
- compute_current_bbt_points(leftmost_frame, leftmost_frame + current_page_frames());
+ compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_frames());
_session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks); // redraw metric markers
redraw_measures ();
update_tempo_based_rulers ();
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;
-
- delete current_bbt_points;
- current_bbt_points = 0;
-
- current_bbt_points = _session->tempo_map().get_points (_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
void
Editor::draw_measures ()
{
- if (_session == 0 || _show_measures == false ||
- !current_bbt_points || current_bbt_points->empty()) {
+ if (_session == 0 || _show_measures == false || distance (current_bbt_points_begin, current_bbt_points_end) == 0) {
return;
}
tempo_lines = new TempoLines(*track_canvas, time_line_group, physical_screen_height(get_window()));
}
- tempo_lines->draw(*current_bbt_points, frames_per_unit);
+ tempo_lines->draw (current_bbt_points_begin, current_bbt_points_end, frames_per_unit);
}
void