13
0

lppro: Don't unbang trigger until pad is released

This was causing issues with cues when clips were set to gate triggering. A pad
long press was causing the clip to release. Additionally, remove an extra timer
that was being set.
This commit is contained in:
dominik martinez 2023-11-03 13:00:20 -04:00 committed by Paul Davis
parent 3e8cde5ad6
commit 93a6849bdd
2 changed files with 10 additions and 6 deletions

View File

@ -413,7 +413,7 @@ LaunchPadPro::build_pad_map ()
for (int row = 0; row < 8; ++row) {
for (int col = 0; col < 8; ++col) {
int pid = (11 + (row * 10)) + col;
std::pair<int,Pad> p (pid, Pad (pid, col, 7 - row, &LaunchPadPro::pad_press, &LaunchPadPro::pad_long_press, &LaunchPadPro::relax));
std::pair<int,Pad> p (pid, Pad (pid, col, 7 - row, &LaunchPadPro::pad_press, &LaunchPadPro::pad_long_press, &LaunchPadPro::pad_release));
if (!pad_map.insert (p).second) abort();
}
}
@ -1538,16 +1538,19 @@ LaunchPadPro::pad_press (Pad& pad, int velocity)
}
session->bang_trigger_at (pad.x, pad.y, velocity / 127.0f);
start_press_timeout (pad);
}
void
LaunchPadPro::pad_long_press (Pad& pad)
{
DEBUG_TRACE (DEBUG::Launchpad, string_compose ("pad long press on %1, %2 => %3\n", pad.x, pad.y, pad.id));
session->unbang_trigger_at (pad.x, pad.y);
/* Pad was used for long press, do not invoke release action */
consumed.insert (pad.id);
}
void
LaunchPadPro::pad_release(Pad &pad)
{
DEBUG_TRACE (DEBUG::Launchpad, string_compose ("pad release on %1, %2 => %3\n", pad.x, pad.y, pad.id));
session->unbang_trigger_at(pad.x, pad.y);
}
void

View File

@ -450,6 +450,7 @@ class LaunchPadPro : public MIDISurface
void pad_press (Pad&, int velocity);
void pad_long_press (Pad&);
void pad_release (Pad&);
void trigger_property_change (PBD::PropertyChange, ARDOUR::Trigger*);
PBD::ScopedConnectionList trigger_connections;