From 5deea0c0778a9cdbf8f9c138a11e74aa0e17a8d9 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 22 Aug 2023 17:29:09 -0600 Subject: [PATCH] libpbd: change static trigger property change signal to take Trigger* When we add a region to a slot, we create a new Trigger, set its region, then arrange for an "atomic" swap with the existing Trigger. This means that the property change signal is emitted on a Trigger that does not yet exist inside a TriggerBox, and so cannot be found using row/col or x,y coordinates. Pass a raw pointer instead (lifetime management is not an issue ... or is it. --- libs/ardour/ardour/triggerbox.h | 2 +- libs/ardour/triggerbox.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/ardour/ardour/triggerbox.h b/libs/ardour/ardour/triggerbox.h index 4bd68926c2..c3eeb657b2 100644 --- a/libs/ardour/ardour/triggerbox.h +++ b/libs/ardour/ardour/triggerbox.h @@ -415,7 +415,7 @@ class LIBARDOUR_API Trigger : public PBD::Stateful { void get_ui_state (UIState &state) const; void set_ui_state (UIState &state); - static PBD::Signal3 TriggerPropertyChange; + static PBD::Signal2 TriggerPropertyChange; protected: struct UIRequests { diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index d9661c2371..6b44bdd96e 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -202,7 +202,7 @@ FollowAction::to_string () const Trigger * const Trigger::MagicClearPointerValue = (Trigger*) 0xfeedface; -PBD::Signal3 Trigger::TriggerPropertyChange; +PBD::Signal2 Trigger::TriggerPropertyChange; Trigger::Trigger (uint32_t n, TriggerBox& b) : _launch_style (Properties::launch_style, OneShot) @@ -423,7 +423,7 @@ Trigger::send_property_change (PropertyChange pc) PropertyChanged (pc); /* emit static signal for global observers */ - TriggerPropertyChange (pc, _box.order(), _index); + TriggerPropertyChange (pc, this); } void