- BBT_Time previous_beat, next_beat; // the beats previous to the leftmost frame and after the rightmost frame
-
- 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).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;
- }