13
0

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
This commit is contained in:
Paul Davis 2021-11-13 17:49:03 -07:00
parent 1532ebb38f
commit 710c5b9b78

View File

@ -21,6 +21,9 @@
*/ */
#include "pbd/unwind.h" #include "pbd/unwind.h"
#include "ardour/audioengine.h"
#include "ardour/session.h"
#include "ardour/tempo.h" #include "ardour/tempo.h"
#include "actions.h" #include "actions.h"
@ -113,7 +116,8 @@ MainClock::set (timepos_t const & when, bool force, timecnt_t const & /*offset*/
} else { } else {
mode = UIConfiguration::instance().get_secondary_clock_delta_mode (); mode = UIConfiguration::instance().get_secondary_clock_delta_mode ();
} }
if (!PublicEditor::instance().session()) {
if (!AudioEngine::instance()->session()) {
mode = NoDelta; mode = NoDelta;
} }
@ -126,7 +130,7 @@ MainClock::set (timepos_t const & when, bool force, timecnt_t const & /*offset*/
break; break;
case DeltaOriginMarker: 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()); AudioClock::set (when, force, loc ? timecnt_t (loc->start()) : timecnt_t());
} }
break; break;