From a0db260daa0b725faea6d1bfa77e071e57db56d1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 13 Dec 2021 09:21:06 -0700 Subject: [PATCH] audio clip editor: hide ruler if we do not know the tempo, since we can't draw it under such circumstances --- gtk2_ardour/audio_clip_editor.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/audio_clip_editor.cc b/gtk2_ardour/audio_clip_editor.cc index 5a044ab55c..d2065ac528 100644 --- a/gtk2_ardour/audio_clip_editor.cc +++ b/gtk2_ardour/audio_clip_editor.cc @@ -93,6 +93,7 @@ AudioClipEditor::ClipBBTMetric::get_marks (std::vectorapparent_tempo() > 0.); Temporal::Tempo tempo (trigger->apparent_tempo(), 4); /* XXX don't assume 4 */ @@ -433,8 +434,17 @@ AudioClipEditor::set_region (boost::shared_ptr r, Trigger* t) waves.push_back (wv); } - ruler->set_range (0, pixel_to_sample (frame->get().width() - 2.)); - + if (t) { + if (t->apparent_tempo() == 0.) { + /* tempo unknown, hide ruler */ + ruler->hide (); + } else { + ruler->show (); + ruler->set_range (0, pixel_to_sample (frame->get().width() - 2.)); + } + } else { + ruler->hide (); + } set_spp_from_length (len); set_wave_heights (); set_waveform_colors ();