From 7339aa7c0d7eb645f9386183dd9579d5e55b0b65 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 24 Oct 2021 09:25:11 -0600 Subject: [PATCH] triggerbox: new API to set from region (selection) --- libs/ardour/ardour/triggerbox.h | 1 + libs/ardour/triggerbox.cc | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/libs/ardour/ardour/triggerbox.h b/libs/ardour/ardour/triggerbox.h index 8c0003310a..29eac5ea3b 100644 --- a/libs/ardour/ardour/triggerbox.h +++ b/libs/ardour/ardour/triggerbox.h @@ -346,6 +346,7 @@ class LIBARDOUR_API TriggerBox : public Processor int set_state (const XMLNode&, int version); int set_from_path (uint64_t slot, std::string const & path); + int set_from_selection (uint64_t slot, boost::shared_ptr); DataType data_type() const { return _data_type; } diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index 080a1d1bb4..684d769b88 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -1285,6 +1285,16 @@ TriggerBox::get_next_trigger () return 0; } +int +TriggerBox::set_from_selection (uint64_t slot, boost::shared_ptr region) +{ + if (slot >= all_triggers.size()) { + return 0; + } + + return all_triggers[slot]->set_region (region); +} + int TriggerBox::set_from_path (uint64_t slot, std::string const & path) {