diff --git a/gtk2_ardour/cue_editor.cc b/gtk2_ardour/cue_editor.cc index 95bf0524d7..726995ae1f 100644 --- a/gtk2_ardour/cue_editor.cc +++ b/gtk2_ardour/cue_editor.cc @@ -1572,25 +1572,17 @@ edit_last_mark_label (std::vector& marks, const std:: void CueEditor::metric_get_bbt (std::vector& marks, samplepos_t leftmost, samplepos_t rightmost, gint /*maxchars*/) { - EC_LOCAL_TEMPO_SCOPE; + // no EC_LOCAL_TEMPO_SCOPE here since we use an explicit TempoMap for + // all calculations - if (!_session) { + if (!_session || !_region) { return; } bool provided = false; - std::shared_ptr tmap; - std::shared_ptr mr = std::dynamic_pointer_cast (_region); + std::shared_ptr tmap (_region->tempo_map()); - if (mr) { - std::shared_ptr smf (std::dynamic_pointer_cast (mr->midi_source())); - - if (smf) { - tmap = smf->tempo_map (provided); - } - } - - if (!provided) { + if (!tmap) { tmap.reset (new Temporal::TempoMap (Temporal::Tempo (120, 4), Temporal::Meter (4, 4))); }