1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 10:08:31 +00:00

Compare commits

...

4 Commits

Author SHA1 Message Date
af43c0ae87
Merge pull request #365 from DarthAffe/Devices/Novation
Added Novation Launchpad Mini MK3
2024-01-04 20:12:24 +01:00
7898c50eed Fixed unexpected name of the Launchpad Mini MK3 2024-01-04 18:10:31 +01:00
505e7481f7 Small Novation-detection refactoring 2024-01-04 18:10:20 +01:00
4f478879c2 Added Novation Launchpad Mini MK3 2024-01-04 17:29:59 +01:00
2 changed files with 7 additions and 3 deletions

View File

@ -34,5 +34,10 @@ public enum NovationDevices
[DeviceId("Launchpad Open")]
[ColorCapability(NovationColorCapabilities.RGB)]
[LedIdMapping(LedIdMappings.Pro)]
LaunchpadCustomFirmware
LaunchpadCustomFirmware,
[DeviceId("LPMiniMK3")]
[ColorCapability(NovationColorCapabilities.RGB)]
[LedIdMapping(LedIdMappings.Current)]
LaunchpadMiniMK3,
}

View File

@ -65,11 +65,10 @@ public sealed class NovationDeviceProvider : AbstractRGBDeviceProvider
MidiOutCaps outCaps = OutputDeviceBase.GetDeviceCapabilities(index);
if (outCaps.name == null) continue;
string deviceName = outCaps.name.ToUpperInvariant();
NovationDevices? deviceId = (NovationDevices?)Enum.GetValues(typeof(NovationDevices))
.Cast<Enum>()
.Where(x => x.GetDeviceId() != null)
.FirstOrDefault(x => deviceName.Contains(x.GetDeviceId()!.ToUpperInvariant()));
.FirstOrDefault(x => outCaps.name.Contains(x.GetDeviceId()!, StringComparison.InvariantCultureIgnoreCase));
if (deviceId == null) continue;