+ break;
+
+ case bbt_show_ticks_super_detail:
+
+ beats = current_bbt_points->size();
+ bbt_nmarks = (beats + 2) * bbt_beat_subdivision;
+
+ bbt_position_of_helper = lower + (30 * Editor::get_current_zoom ());
+ *marks = (GtkCustomRulerMark *) g_malloc (sizeof(GtkCustomRulerMark) * bbt_nmarks);
+
+ (*marks)[0].label = g_strdup(" ");
+ (*marks)[0].position = lower;
+ (*marks)[0].style = GtkCustomRulerMarkMicro;
+
+ for (n = 1, i = current_bbt_points->begin(); n < bbt_nmarks && i != current_bbt_points->end(); ++i) {
+ if ((*i).type != TempoMap::Beat) {
+ continue;
+ }
+ if ((*i).frame < lower && (bbt_bar_helper_on)) {
+ snprintf (buf, sizeof(buf), "<%" PRIu32 "|%" PRIu32, (*i).bar, (*i).beat);
+ (*marks)[0].label = g_strdup (buf);
+ helper_active = true;
+ } else {
+
+ if ((*i).beat == 1) {
+ (*marks)[n].style = GtkCustomRulerMarkMajor;
+ snprintf (buf, sizeof(buf), "%" PRIu32, (*i).bar);
+ } else {
+ (*marks)[n].style = GtkCustomRulerMarkMinor;
+ snprintf (buf, sizeof(buf), "%" PRIu32, (*i).beat);
+ }
+ if (((*i).frame < bbt_position_of_helper) && helper_active) {
+ snprintf (buf, sizeof(buf), " ");
+ }
+ (*marks)[n].label = g_strdup (buf);
+ (*marks)[n].position = (*i).frame;
+ n++;
+ }
+
+ /* Add the tick marks */
+
+ /* Find the next beat */
+
+ next_beat.beats = (*i).beat;
+ next_beat.bars = (*i).bar;
+
+ if ((*i).meter->beats_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 = (nframes64_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) (Meter::ticks_per_beat / bbt_beat_subdivision);
+
+ pos = (*i).frame + frame_skip;
+ accumulated_error = frame_skip_error;
+
+ tick = skip;
+
+ for (t = 0; (tick < Meter::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 {
+ snprintf (buf, sizeof(buf), " ");
+ }
+
+ (*marks)[n].label = g_strdup (buf);
+
+ /* Error compensation for float to nframes64_t*/
+ accumulated_error += frame_skip_error;
+ if (accumulated_error > 1) {
+ pos += 1;
+ accumulated_error -= 1.0f;
+ }
+
+ (*marks)[n].position = pos;
+
+ if ((bbt_beat_subdivision > 4) && i_am_accented) {
+ (*marks)[n].style = GtkCustomRulerMarkMinor;
+ } else {
+ (*marks)[n].style = GtkCustomRulerMarkMicro;
+ }
+ i_am_accented = false;
+ n++;
+ }
+ }