From 8d1684e1f7a2c38ff321df71a80bd13c944c7881 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 21 Jan 2022 10:11:32 -0700 Subject: [PATCH] triggerbox: store cue bangs in process thread when discovered --- libs/ardour/ardour/triggerbox.h | 5 ++++- libs/ardour/session_process.cc | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libs/ardour/ardour/triggerbox.h b/libs/ardour/ardour/triggerbox.h index 42c6f94089..06a82f4a10 100644 --- a/libs/ardour/ardour/triggerbox.h +++ b/libs/ardour/ardour/triggerbox.h @@ -524,7 +524,10 @@ class LIBARDOUR_API TriggerBoxThread struct CueRecord { int32_t cue_number; - timepos_t when; + samplepos_t when; + + CueRecord (int32_t cn, samplepos_t t): cue_number (cn), when (t) {} + CueRecord () : cue_number (0), when (0) {} }; typedef PBD::RingBuffer CueRecords; diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc index ee7f55ac9d..e059ad79cb 100644 --- a/libs/ardour/session_process.cc +++ b/libs/ardour/session_process.cc @@ -1671,6 +1671,12 @@ Session::maybe_find_pending_cue () int32_t ac = _pending_cue.exchange (-1); if (ac >= 0) { _active_cue.store (ac); + + if (TriggerBox::cue_recording()) { + CueRecord cr (ac, _transport_sample); + TriggerBox::cue_records.write (&cr, 1); + /* failure is acceptable, but unlikely */ + } } }