push2: adapt to new unbang and 'stop' semantics (needs testing)

This commit is contained in:
Ben Loftis 2022-10-01 07:49:41 -05:00
parent 6c292a83da
commit 7fe7adb83c
2 changed files with 24 additions and 11 deletions

View File

@ -274,16 +274,19 @@ CueLayout::show_knob_function ()
void void
CueLayout::button_lower (uint32_t n) CueLayout::button_lower (uint32_t n)
{ {
boost::shared_ptr<Route> r = _session.get_remote_nth_route (n);
if (!r) {
return;
}
if (_p2.stop_down() || _long_stop) { if (_p2.stop_down() || _long_stop) {
_p2.unbang (n + track_base); boost::shared_ptr<TriggerBox> tb = r->triggerbox();
if (tb) {
tb->stop_all_quantized();
}
} else { } else {
/* select track */ /* select track */
_session.selection().set (r, boost::shared_ptr<AutomationControl>());
boost::shared_ptr<Route> r = _session.get_remote_nth_route (n);
if (r) {
_session.selection().set (r, boost::shared_ptr<AutomationControl>());
}
} }
} }
@ -576,15 +579,24 @@ CueLayout::pad_press (int y, int x) /* fix coordinate order one day */
return; return;
} }
if (!tb->trigger (y + scene_base)->region()) { tb->bang_trigger_at (y + scene_base);
_p2.unbang (x + track_base); }
void
CueLayout::pad_release (int y, int x) /* fix coordinate order one day */
{
if (!_route[x]) {
return; return;
} }
_p2.bang (x + track_base, y + scene_base); boost::shared_ptr<TriggerBox> tb = _route[x]->triggerbox();
if (!tb) {
/* unpossible! */
return;
}
tb->unbang_trigger_at (y + scene_base);
} }
void void

View File

@ -83,6 +83,7 @@ class CueLayout : public Push2Layout
void strip_vpot_touch (int, bool); void strip_vpot_touch (int, bool);
void pad_press (int x, int y); void pad_press (int x, int y);
void pad_release (int x, int y);
/* override to use for clip progress */ /* override to use for clip progress */
void update_meters(); void update_meters();