From c628099814c50e4dd8e9fb39ad96d230de07c198 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 31 Jan 2024 17:13:10 -0700 Subject: [PATCH] launchpad Mini/X: tweak regex to account for weird cases IRC user MikeLupe reports a Linux/ALSA system that has ports named Launchpad Mini MK3 LPMiniMK3 DA Launchpad Mini MK3 LPMiniMK3 MI (note the truncations). Unclear if this is a failure of some specific version of ALSA or something unusual about his device, but this should fix the situation without breaking for anyone else --- libs/surfaces/launchpad_x/lpx.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/surfaces/launchpad_x/lpx.cc b/libs/surfaces/launchpad_x/lpx.cc index 36a59b19b8..600e5e117c 100644 --- a/libs/surfaces/launchpad_x/lpx.cc +++ b/libs/surfaces/launchpad_x/lpx.cc @@ -121,9 +121,9 @@ LaunchPadX::probe (std::string& i, std::string& o) } #ifdef LAUNCHPAD_MINI - std::regex rx (X_("Launchpad Mini.*MIDI")); + std::regex rx (X_("Launchpad Mini.*MI")); #else - std::regex rx (X_("Launchpad X.*MIDI")); + std::regex rx (X_("Launchpad X.*MI")); #endif auto has_lppro = [&rx](string const &s) { @@ -769,9 +769,9 @@ LaunchPadX::connect_daw_ports () */ #ifdef LAUNCHPAD_MINI - std::regex rx (X_("Launchpad Mini.*(DAW|MIDI 1)"), std::regex::extended); + std::regex rx (X_("Launchpad Mini.*(DAW|MIDI 1|DA$)"), std::regex::extended); #else - std::regex rx (X_("Launchpad X.*(DAW|MIDI 1)"), std::regex::extended); + std::regex rx (X_("Launchpad X.*(DAW|MIDI 1|DA$)"), std::regex::extended); #endif auto is_dawport = [&rx](string const &s) {