From 26c48aae1b2b6c04ab85d2c3f0ee07cf536ae5ae Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 27 Aug 2022 08:15:17 -0600 Subject: [PATCH] control protocols: add trigger bang method to BasicUI --- libs/surfaces/control_protocol/basic_ui.cc | 23 +++++++++++++++++++ .../control_protocol/basic_ui.h | 2 ++ 2 files changed, 25 insertions(+) diff --git a/libs/surfaces/control_protocol/basic_ui.cc b/libs/surfaces/control_protocol/basic_ui.cc index 4e6a275360..6a33b96804 100644 --- a/libs/surfaces/control_protocol/basic_ui.cc +++ b/libs/surfaces/control_protocol/basic_ui.cc @@ -801,6 +801,29 @@ BasicUI::goto_nth_marker (int n) } } +void +BasicUI::bang (int x, int y) +{ + boost::shared_ptr r = session->get_remote_nth_route (x); + if (!r) { + return; + } + boost::shared_ptr tb = r->triggerbox(); + + if (!tb || !tb->active()) { + return; + } + + TriggerPtr tp (tb->trigger (y)); + + if (!tp) { + return; + } + + tp->bang (); +} + + #if 0 this stuff is waiting to go in so that all UIs can offer complex solo/mute functionality diff --git a/libs/surfaces/control_protocol/control_protocol/basic_ui.h b/libs/surfaces/control_protocol/control_protocol/basic_ui.h index e9d0e422ce..74b5a3e049 100644 --- a/libs/surfaces/control_protocol/control_protocol/basic_ui.h +++ b/libs/surfaces/control_protocol/control_protocol/basic_ui.h @@ -163,6 +163,8 @@ class LIBCONTROLCP_API BasicUI { bool rewind_button_onoff() const; bool loop_button_onoff() const; + void bang (int x, int y); + protected: BasicUI (); ARDOUR::Session* session;