+ lines.hide ();
+}
+
+void
+TempoLines::draw_ticks (const ARDOUR::TempoMap::BBTPointList::const_iterator& b,
+ unsigned divisions,
+ framecnt_t leftmost_frame,
+ framecnt_t frame_rate)
+{
+ const double fpb = b->tempo->frames_per_beat(frame_rate);
+ const uint32_t base = ARDOUR_UI::config()->color_mod("measure line beat", "measure line beat");
+
+ for (unsigned l = 1; l < divisions; ++l) {
+ /* find the coarsest division level this tick falls on */
+ unsigned level = divisions;
+ for (unsigned d = divisions; d >= 4; d /= 2) {
+ if (l % (divisions / d) == 0) {
+ level = d;
+ }
+ }
+
+ /* draw line with alpha corresponding to coarsest level */
+ const uint8_t a = max(0, (int)rint(UINT_RGBA_A(base) / log2(level)));
+ const uint32_t c = UINT_RGBA_CHANGE_A(base, a);
+ const framepos_t f = b->frame + (l * (fpb / (double)divisions));
+ if (f > leftmost_frame) {
+ lines.add (PublicEditor::instance().sample_to_pixel_unrounded (f), 1.0, c);
+ }
+ }