control protocols: fix design of trigger unbang method
This commit is contained in:
parent
3cffca9178
commit
19db8f9c68
@ -826,19 +826,41 @@ BasicUI::find_trigger (int x, int y)
|
||||
void
|
||||
BasicUI::bang (int x, int y)
|
||||
{
|
||||
TriggerPtr tp = find_trigger (x, 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 ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
BasicUI::unbang (int x, int y)
|
||||
BasicUI::unbang (int x)
|
||||
{
|
||||
TriggerPtr tp = find_trigger (x, y);
|
||||
if (tp) {
|
||||
tp->unbang ();
|
||||
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 ();
|
||||
}
|
||||
|
||||
|
||||
|
@ -165,7 +165,8 @@ class LIBCONTROLCP_API BasicUI {
|
||||
bool loop_button_onoff() const;
|
||||
|
||||
void bang (int x, int y);
|
||||
void unbang (int x, int y);
|
||||
/* stop whatever is playing in the nth triggerbox */
|
||||
void unbang (int x);
|
||||
/* 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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user