From bad18350e2cb477981c0fd779abf80830fb20df0 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Wed, 22 Dec 2021 12:28:48 -0600 Subject: [PATCH] triggerbox: implement set_all_X for triggers (libardour part) --- libs/ardour/ardour/triggerbox.h | 5 +++++ libs/ardour/triggerbox.cc | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/libs/ardour/ardour/triggerbox.h b/libs/ardour/ardour/triggerbox.h index 4830f11f1e..b794857c48 100644 --- a/libs/ardour/ardour/triggerbox.h +++ b/libs/ardour/ardour/triggerbox.h @@ -502,6 +502,11 @@ class LIBARDOUR_API TriggerBox : public Processor TriggerPtr currently_playing() const { return _currently_playing; } + void set_all_follow_action (ARDOUR::Trigger::FollowAction, uint32_t n=0); + void set_all_launch_style (ARDOUR::Trigger::LaunchStyle); + void set_all_quantization (Temporal::BBT_Offset const&); + void set_all_probability (int zero_to_a_hundred); + /* Returns a negative value is there is no active Trigger, or a value between 0 * and 1.0 if there is, corresponding to the value of position_as_fraction() for * the active Trigger. diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index 5c15efbd95..354c9d3bff 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -1926,6 +1926,38 @@ TriggerBox::request_stop_all () _requests.stop_all = true; } +void +TriggerBox::set_all_launch_style (ARDOUR::Trigger::LaunchStyle ls) +{ + for (uint64_t n = 0; n < all_triggers.size(); ++n) { + all_triggers[n]->set_launch_style (ls); + } +} + +void +TriggerBox::set_all_follow_action (ARDOUR::Trigger::FollowAction fa, uint32_t fa_n) +{ + for (uint64_t n = 0; n < all_triggers.size(); ++n) { + all_triggers[n]->set_follow_action (fa, fa_n); + } +} + +void +TriggerBox::set_all_probability (int zero_to_hundred) +{ + for (uint64_t n = 0; n < all_triggers.size(); ++n) { + all_triggers[n]->set_follow_action_probability (zero_to_hundred); + } +} + +void +TriggerBox::set_all_quantization (Temporal::BBT_Offset const& q) +{ + for (uint64_t n = 0; n < all_triggers.size(); ++n) { + all_triggers[n]->set_quantization (q); + } +} + void TriggerBox::stop_all () {