From bebe6587a2d19afaf5a81487b9d8666254b6c031 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 7 Oct 2023 11:43:07 -0600 Subject: [PATCH] tweak launchpad pro port name for probe to be x-platform --- libs/surfaces/launchpad_pro/lppro.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/surfaces/launchpad_pro/lppro.cc b/libs/surfaces/launchpad_pro/lppro.cc index 3813d41cef..14e2fcd527 100644 --- a/libs/surfaces/launchpad_pro/lppro.cc +++ b/libs/surfaces/launchpad_pro/lppro.cc @@ -113,9 +113,13 @@ LaunchPadPro::probe (std::string& i, std::string& o) AudioEngine::instance()->get_ports ("", DataType::MIDI, PortFlags (IsOutput|IsTerminal), midi_inputs); AudioEngine::instance()->get_ports ("", DataType::MIDI, PortFlags (IsInput|IsTerminal), midi_outputs); + /* the name "Launchpad Pro MK3" is the prefix used on all platforms, + * according to Novation. + */ + auto has_lppro = [](string const& s) { std::string pn = AudioEngine::instance()->get_hardware_port_name_by_name (s); - return pn.find ("Launchpad Pro MK3 MIDI 1") != string::npos; + return pn.find ("Launchpad Pro MK3") != string::npos; }; auto pi = std::find_if (midi_inputs.begin (), midi_inputs.end (), has_lppro);