+ const uint32_t base = UIConfiguration::instance().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(8, (int)rint(UINT_RGBA_A(base) / (0.8 * log2(level))));
+ const uint32_t c = UINT_RGBA_CHANGE_A(base, a);
+ const samplepos_t f = _bfc->to (Temporal::Beats (grid.begin()->qn + (l / (double) divisions))) + _bfc->origin_b();
+
+ if (f > leftmost_sample) {
+ lines.add (PublicEditor::instance().sample_to_pixel_unrounded (f), 1.0, c);
+ }
+ }
+}
+
+void
+TempoLines::draw (std::vector<ARDOUR::TempoMap::BBTPoint>& grid,
+ unsigned divisions,
+ samplecnt_t leftmost_sample,
+ samplecnt_t sample_rate)
+{
+ std::vector<ARDOUR::TempoMap::BBTPoint>::const_iterator i;