diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index c670014c2e..d49d2d07e8 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1857,7 +1857,7 @@ private: void compute_current_bbt_points (Temporal::TempoMapPoints& grid, samplepos_t left, samplepos_t right); void reassociate_metric_markers (Temporal::TempoMap::SharedPtr const &); - void reassociate_metric_marker (Temporal::TempoMap::SharedPtr const & tmap, Temporal::TempoMap::Metrics & metric, MetricMarker& marker); + void reassociate_metric_marker (Temporal::TempoMap::SharedPtr const& tmap, Temporal::TempoMap::Metrics const& metric, MetricMarker& marker); void make_bbt_marker (Temporal::MusicTimePoint const *, Marks::iterator before); void make_meter_marker (Temporal::MeterPoint const *, Marks::iterator before); void make_tempo_marker (Temporal::TempoPoint const * ts, double& min_tempo, double& max_tempo, Temporal::TempoPoint const *& prev_ts, uint32_t tc_color, samplecnt_t sr3, Marks::iterator before); diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index 8af7aee33d..4cf3d83958 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -89,24 +89,24 @@ Editor::remove_metric_marks () } void -Editor::reassociate_metric_markers (TempoMap::SharedPtr const & tmap) +Editor::reassociate_metric_markers (TempoMap::SharedPtr const& tmap) { TempoMap::Metrics metrics; tmap->get_metrics (metrics); - for (auto & m : tempo_marks) { + for (auto const& m : tempo_marks) { reassociate_metric_marker (tmap, metrics, *m); } - for (auto & m : meter_marks) { + for (auto const& m : meter_marks) { reassociate_metric_marker (tmap, metrics, *m); } - for (auto & m : bbt_marks) { + for (auto const& m : bbt_marks) { reassociate_metric_marker (tmap, metrics, *m); } } void -Editor::reassociate_metric_marker (TempoMap::SharedPtr const & tmap, TempoMap::Metrics & metrics, MetricMarker& marker) +Editor::reassociate_metric_marker (TempoMap::SharedPtr const& tmap, TempoMap::Metrics const& metrics, MetricMarker& marker) { TempoMarker* tm; MeterMarker* mm; @@ -117,14 +117,13 @@ Editor::reassociate_metric_marker (TempoMap::SharedPtr const & tmap, TempoMap::M Temporal::MusicTimePoint const * mtp; if ((tm = dynamic_cast (&marker)) != 0) { - - for (TempoMap::Metrics::iterator m = metrics.begin(); m != metrics.end(); ++m) { - if ((mtp = dynamic_cast(*m)) != 0) { + for (auto const& m : metrics) { + if ((mtp = dynamic_cast(m)) != 0) { /* do nothing .. but we had to catch this first because MusicTimePoint IS-A TempoPoint */ - } else if ((tp = dynamic_cast(*m)) != 0) { + } else if ((tp = dynamic_cast(m)) != 0) { if (tm->tempo().sclock() == tp->sclock()) { tm->reset_tempo (*tp); tm->curve().reset_point (*tp); @@ -133,14 +132,14 @@ Editor::reassociate_metric_marker (TempoMap::SharedPtr const & tmap, TempoMap::M } } } else if ((mm = dynamic_cast (&marker)) != 0) { - for (TempoMap::Metrics::iterator m = metrics.begin(); m != metrics.end(); ++m) { - if ((mtp = dynamic_cast(*m)) != 0) { + for (auto const& m : metrics) { + if ((mtp = dynamic_cast(m)) != 0) { /* do nothing .. but we had to catch this first because MusicTimePoint IS-A TempoPoint */ - } else if ((mp = dynamic_cast(*m)) != 0) { + } else if ((mp = dynamic_cast(m)) != 0) { if (mm->meter().sclock() == mp->sclock()) { mm->reset_meter (*mp); break; @@ -149,9 +148,8 @@ Editor::reassociate_metric_marker (TempoMap::SharedPtr const & tmap, TempoMap::M } } else if ((bm = dynamic_cast (&marker)) != 0) { - - for (TempoMap::Metrics::iterator m = metrics.begin(); m != metrics.end(); ++m) { - if ((mtp = dynamic_cast(*m)) != 0) { + for (auto const& m : metrics) { + if ((mtp = dynamic_cast(m)) != 0) { if (bm->point().sclock() == mtp->sclock()) { bm->reset_point (*mtp); break;