From 25c151bd8d97c5d5691281e380d4c7c701f38013 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 29 May 2022 14:42:23 -0600 Subject: [PATCH] fix errors in drawing BBT markers This was hastily added and inadequately checked code before --- gtk2_ardour/editor_tempodisplay.cc | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index 8b8904d7e5..f7f1e6df7f 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -232,6 +232,7 @@ Editor::draw_tempo_marks () Temporal::TempoPoint const & metric_point (*t); if (dynamic_cast (&metric_point)) { + ++t; continue; } @@ -274,8 +275,13 @@ Editor::draw_tempo_marks () } if ((mm == tempo_marks.end()) && (t != tempi.end())) { + while (t != tempi.end()) { - make_tempo_marker (&*t, min_tempo, max_tempo, prev_ts, tc_color, sr); + + if (!dynamic_cast (&(*t))) { + make_tempo_marker (&*t, min_tempo, max_tempo, prev_ts, tc_color, sr); + } + ++t; } } @@ -300,6 +306,7 @@ Editor::draw_meter_marks () Temporal::MeterPoint const & metric_point (*m); if (dynamic_cast (&metric_point)) { + ++m; continue; } @@ -335,8 +342,13 @@ Editor::draw_meter_marks () } if ((mm == meter_marks.end()) && (m != meters.end())) { + while (m != meters.end()) { - make_meter_marker (&*m); + + if (!dynamic_cast (&(*m))) { + make_meter_marker (&*m); + } + ++m; } } @@ -357,7 +369,7 @@ Editor::draw_bbt_marks () while (m != bartimes.end() && mm != bbt_marks.end()) { Temporal::Point const & mark_point ((*mm)->point()); - Temporal::MeterPoint const & metric_point (*m); + Temporal::MusicTimePoint const & metric_point (*m); if (mark_point.sclock() < metric_point.sclock()) { @@ -368,7 +380,7 @@ Editor::draw_bbt_marks () } else if (metric_point.sclock() < mark_point.sclock()) { - make_meter_marker (&metric_point); + make_bbt_marker (&metric_point); ++m; } else { @@ -390,7 +402,7 @@ Editor::draw_bbt_marks () if ((mm == bbt_marks.end()) && (m != bartimes.end())) { while (m != bartimes.end()) { - make_meter_marker (&*m); + make_bbt_marker (&*m); ++m; } }