- BBT_Time previous_beat, next_beat; // the beats previous to the leftmost frame and after the rightmost frame
-
- session->bbt_time(leftmost_frame, previous_beat);
- session->bbt_time(leftmost_frame + current_page_frames(), 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(leftmost_frame + current_page_frames()).beats_per_bar () > next_beat.beats + 1) {
- next_beat.beats += 1;
- } else {
- next_beat.bars += 1;
- next_beat.beats = 1;
- }
- next_beat.ticks = 0;
-
- if (current_bbt_points) {
- delete current_bbt_points;
- current_bbt_points = 0;
- }
-
- if (session) {
- current_bbt_points = session->tempo_map().get_points (session->tempo_map().frame_time (previous_beat), session->tempo_map().frame_time (next_beat));
- update_tempo_based_rulers ();
- } else {
- current_bbt_points = 0;
- }