From fbbe74a5304da4e30389bdab65779fa21d986f52 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Fri, 18 Feb 2022 11:15:43 -0600 Subject: [PATCH] triggerbox: revert gain() as a queued UISTate value It's impractical/impossible to set the gain if you have to wait for a retrigger --- libs/ardour/ardour/triggerbox.h | 4 +++- libs/ardour/triggerbox.cc | 13 ++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/libs/ardour/ardour/triggerbox.h b/libs/ardour/ardour/triggerbox.h index a713a74946..caa58b4330 100644 --- a/libs/ardour/ardour/triggerbox.h +++ b/libs/ardour/ardour/triggerbox.h @@ -219,7 +219,6 @@ class LIBARDOUR_API Trigger : public PBD::Stateful { TRIGGERBOX_PROPERTY_DECL_CONST_REF (follow_length, Temporal::BBT_Offset); TRIGGERBOX_PROPERTY_DECL (use_follow_length, bool); TRIGGERBOX_PROPERTY_DECL (legato, bool); - TRIGGERBOX_PROPERTY_DECL (gain, gain_t); TRIGGERBOX_PROPERTY_DECL (velocity_effect, float); TRIGGERBOX_PROPERTY_DECL (stretchable, bool); TRIGGERBOX_PROPERTY_DECL (cue_isolated, bool); @@ -346,6 +345,9 @@ class LIBARDOUR_API Trigger : public PBD::Stateful { Temporal::Meter meter() const { return _meter; } + gain_t gain() {return _gain;} + void set_gain (gain_t g); + void set_velocity_gain (gain_t g) {_pending_velocity_gain=g;} void set_pending (Trigger*); diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index 9c71363be2..e649594bfc 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -411,7 +411,6 @@ Trigger::name () const \ TRIGGER_UI_SET (cue_isolated,bool) TRIGGER_UI_SET (stretchable, bool) -TRIGGER_UI_SET (gain, gain_t) TRIGGER_UI_SET (velocity_effect, float) TRIGGER_UI_SET (follow_count, uint32_t) TRIGGER_UI_SET_CONST_REF (follow_action0, FollowAction) @@ -462,6 +461,18 @@ Trigger::set_ui (void* p) _ui = p; } +void +Trigger::set_gain (gain_t g) +{ + if (_gain == g) { + return; + } + + _gain = g; + send_property_change (Properties::gain); + _box.session().set_dirty(); +} + void Trigger::bang () {