basic_ui: use session-provided bang/unbang functions
This commit is contained in:
parent
29dc388bbc
commit
6c292a83da
|
@ -836,43 +836,15 @@ BasicUI::find_trigger (int x, int y)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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);
|
session->bang_trigger_at (x, y);
|
||||||
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
|
void
|
||||||
BasicUI::unbang (int x)
|
BasicUI::unbang_trigger_at (int x, int y)
|
||||||
{
|
{
|
||||||
boost::shared_ptr<Route> r = session->get_remote_nth_route (x);
|
session->unbang_trigger_at (x, y);
|
||||||
if (!r) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
boost::shared_ptr<TriggerBox> tb = r->triggerbox();
|
|
||||||
|
|
||||||
if (!tb || !tb->active()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
tb->stop_all_quantized ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -167,9 +167,9 @@ class LIBCONTROLCP_API BasicUI {
|
||||||
bool rewind_button_onoff() const;
|
bool rewind_button_onoff() const;
|
||||||
bool loop_button_onoff() const;
|
bool loop_button_onoff() const;
|
||||||
|
|
||||||
void bang (int x, int y);
|
void bang_trigger_at (int x, int y);
|
||||||
/* stop whatever is playing in the nth triggerbox */
|
void unbang_trigger_at (int x, int y);
|
||||||
void unbang (int x);
|
|
||||||
/* it would be nice to use TriggerPtr here but that implies including ardour/triggerbox.h */
|
/* 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);
|
boost::shared_ptr<ARDOUR::Trigger> find_trigger (int x, int y);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue