From 6c292a83dab9ae01dfd8219317ef60a15ec7bc9e Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Sat, 1 Oct 2022 07:48:40 -0500 Subject: [PATCH] basic_ui: use session-provided bang/unbang functions --- libs/surfaces/control_protocol/basic_ui.cc | 36 +++---------------- .../control_protocol/basic_ui.h | 6 ++-- 2 files changed, 7 insertions(+), 35 deletions(-) diff --git a/libs/surfaces/control_protocol/basic_ui.cc b/libs/surfaces/control_protocol/basic_ui.cc index ac0040ebb1..98d0e5d8ff 100644 --- a/libs/surfaces/control_protocol/basic_ui.cc +++ b/libs/surfaces/control_protocol/basic_ui.cc @@ -836,43 +836,15 @@ BasicUI::find_trigger (int x, int y) } void -BasicUI::bang (int x, int y) +BasicUI::bang_trigger_at (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; - } - - if (tp) { - tp->bang (); - } + session->bang_trigger_at (x, y); } void -BasicUI::unbang (int x) +BasicUI::unbang_trigger_at (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; - } - - tb->stop_all_quantized (); + session->unbang_trigger_at (x, y); } diff --git a/libs/surfaces/control_protocol/control_protocol/basic_ui.h b/libs/surfaces/control_protocol/control_protocol/basic_ui.h index f2b8452ced..b17d568e0b 100644 --- a/libs/surfaces/control_protocol/control_protocol/basic_ui.h +++ b/libs/surfaces/control_protocol/control_protocol/basic_ui.h @@ -167,9 +167,9 @@ class LIBCONTROLCP_API BasicUI { bool rewind_button_onoff() const; bool loop_button_onoff() const; - void bang (int x, int y); - /* stop whatever is playing in the nth triggerbox */ - void unbang (int x); + void bang_trigger_at (int x, int y); + void unbang_trigger_at (int x, int y); + /* it would be nice to use TriggerPtr here but that implies including ardour/triggerbox.h */ boost::shared_ptr find_trigger (int x, int y);