From 710c5b9b788a950aee04ee92aa87faf5e1b12376 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 13 Nov 2021 17:49:03 -0700 Subject: [PATCH] do not use PublicEditor::instance() in MainClock, since these obejcts can exist before the editor The AudioEngine on the other hand is created in the global libardour init method, so use that instead --- gtk2_ardour/main_clock.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/main_clock.cc b/gtk2_ardour/main_clock.cc index 5713c48de7..d0105cf627 100644 --- a/gtk2_ardour/main_clock.cc +++ b/gtk2_ardour/main_clock.cc @@ -21,6 +21,9 @@ */ #include "pbd/unwind.h" + +#include "ardour/audioengine.h" +#include "ardour/session.h" #include "ardour/tempo.h" #include "actions.h" @@ -113,7 +116,8 @@ MainClock::set (timepos_t const & when, bool force, timecnt_t const & /*offset*/ } else { mode = UIConfiguration::instance().get_secondary_clock_delta_mode (); } - if (!PublicEditor::instance().session()) { + + if (!AudioEngine::instance()->session()) { mode = NoDelta; } @@ -126,7 +130,7 @@ MainClock::set (timepos_t const & when, bool force, timecnt_t const & /*offset*/ break; case DeltaOriginMarker: { - Location* loc = PublicEditor::instance().session()->locations()->clock_origin_location (); + Location* loc = AudioEngine::instance()->session()->locations()->clock_origin_location (); AudioClock::set (when, force, loc ? timecnt_t (loc->start()) : timecnt_t()); } break;