basic_ui: use session-provided bang/unbang functions

This commit is contained in:
Ben Loftis 2022-10-01 07:48:40 -05:00
parent 29dc388bbc
commit 6c292a83da
2 changed files with 7 additions and 35 deletions

View File

@ -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<Route> r = session->get_remote_nth_route (x);
if (!r) {
return;
}
boost::shared_ptr<TriggerBox> 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<Route> r = session->get_remote_nth_route (x);
if (!r) {
return;
}
boost::shared_ptr<TriggerBox> tb = r->triggerbox();
if (!tb || !tb->active()) {
return;
}
tb->stop_all_quantized ();
session->unbang_trigger_at (x, y);
}

View File

@ -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<ARDOUR::Trigger> find_trigger (int x, int y);