From f63c049d87a42aa56ea414d90b8a8291c011b7b2 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 21 Jan 2022 09:30:12 -0700 Subject: [PATCH] triggerbox: add struct and ringbuffer for recording cues --- libs/ardour/ardour/triggerbox.h | 8 ++++++++ libs/ardour/triggerbox.cc | 1 + 2 files changed, 9 insertions(+) diff --git a/libs/ardour/ardour/triggerbox.h b/libs/ardour/ardour/triggerbox.h index b88723dc39..f38369c47e 100644 --- a/libs/ardour/ardour/triggerbox.h +++ b/libs/ardour/ardour/triggerbox.h @@ -522,6 +522,12 @@ class LIBARDOUR_API TriggerBoxThread void delete_trigger (Trigger*); }; +struct CueRecord { + int32_t cue_number; + timepos_t when; +}; + +typedef PBD::RingBuffer CueRecords; class LIBARDOUR_API TriggerBox : public Processor { @@ -529,6 +535,8 @@ class LIBARDOUR_API TriggerBox : public Processor TriggerBox (Session&, DataType dt); ~TriggerBox (); + static CueRecords cue_records; + void run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes, bool result_required); bool can_support_io_configuration (const ChanCount& in, ChanCount& out); bool configure_io (ChanCount in, ChanCount out); diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index 6fc2926156..11d1d30c57 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -2183,6 +2183,7 @@ TriggerBox::TriggerMidiMapMode TriggerBox::_midi_map_mode (TriggerBox::Sequentia int TriggerBox::_first_midi_note = 60; std::atomic TriggerBox::active_trigger_boxes (0); TriggerBoxThread* TriggerBox::worker = 0; +CueRecords TriggerBox::cue_records (256); void TriggerBox::init ()