- if ((*i).meter->divisions_per_bar() > (next_beat.beats + 1)) {
- next_beat.beats += 1;
- } else {
- next_beat.bars += 1;
- next_beat.beats = 1;
- }
-
- next_beat_pos = _session->tempo_map().frame_time(next_beat);
-
- frame_skip = (framepos_t) floor (frame_skip_error = (_session->frame_rate() * 60) / (bbt_beat_subdivision * (*i).tempo->beats_per_minute()));
- frame_skip_error -= frame_skip;
- skip = (uint32_t) (Timecode::BBT_Time::ticks_per_beat / bbt_beat_subdivision);
-
- pos = (*i).frame + frame_skip;
- accumulated_error = frame_skip_error;
-
- tick = skip;
-
- for (t = 0; (tick < Timecode::BBT_Time::ticks_per_beat) && (n < bbt_nmarks) && (pos < next_beat_pos) ; pos += frame_skip, tick += skip, ++t) {
-
- if (t % bbt_accent_modulo == (bbt_accent_modulo - 1)) {
- i_am_accented = true;
- }
-
- if (pos > bbt_position_of_helper) {
- snprintf (buf, sizeof(buf), "%" PRIu32, tick);
- } else {
- buf[0] = '\0';
- }
+ next_beat.ticks = tick;
+ pos = _session->tempo_map().frame_at_bbt (next_beat);
+ if (t % bbt_accent_modulo == (bbt_accent_modulo - 1)) {
+ i_am_accented = true;
+ }