From 7ac80607ea5e2ef27d9807b3aa8b03cfa45f5a7e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 7 Aug 2021 16:20:36 -0600 Subject: [PATCH] triggerbox: add a useful property --- libs/ardour/ardour/triggerbox.h | 8 ++++++++ libs/ardour/globals.cc | 2 ++ libs/ardour/triggerbox.cc | 13 +++++++++++++ 3 files changed, 23 insertions(+) diff --git a/libs/ardour/ardour/triggerbox.h b/libs/ardour/ardour/triggerbox.h index f3d2379e3c..4892d6c89a 100644 --- a/libs/ardour/ardour/triggerbox.h +++ b/libs/ardour/ardour/triggerbox.h @@ -38,6 +38,12 @@ class XMLNode; +namespace ARDOUR { + namespace Properties { + LIBARDOUR_API extern PBD::PropertyDescriptor running; + } +} + namespace ARDOUR { class Session; @@ -49,6 +55,8 @@ class LIBARDOUR_API Trigger : public PBD::Stateful { Trigger (size_t index, TriggerBox&); virtual ~Trigger() {} + static void make_property_quarks (); + virtual void bang (TriggerBox&) = 0; virtual void unbang (TriggerBox&, Temporal::Beats const &, samplepos_t) = 0; diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index 80dcecf02b..18e7066b2c 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -126,6 +126,7 @@ #include "ardour/source_factory.h" #include "ardour/transport_fsm.h" #include "ardour/transport_master_manager.h" +#include "ardour/triggerbox.h" #include "ardour/uri_map.h" #include "audiographer/routines.h" @@ -560,6 +561,7 @@ ARDOUR::init (bool try_optimization, const char* localedir, bool with_gui) AudioPlaylist::make_property_quarks (); PresentationInfo::make_property_quarks (); TransportMaster::make_property_quarks (); + Trigger::make_property_quarks (); /* this is a useful ready to use PropertyChange that many things need to check. This avoids having to compose diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index ea497ab230..2722dad8e7 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -24,6 +24,19 @@ using std::string; using std::cerr; using std::endl; +namespace ARDOUR { + namespace Properties { + PBD::PropertyDescriptor running; + } +} + +void +Trigger::make_property_quarks () +{ + Properties::muted.property_id = g_quark_from_static_string (X_("running")); + DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for running = %1\n", Properties::running.property_id)); +} + TriggerBox::TriggerBox (Session& s, DataType dt) : Processor (s, _("TriggerBox"), Temporal::BeatTime) , _bang_queue (1024)