Skip to content

Commit

Permalink
Merge pull request #365 from DarthAffe/Devices/Novation
Browse files Browse the repository at this point in the history
Added Novation Launchpad Mini MK3
  • Loading branch information
DarthAffe authored Jan 4, 2024
2 parents 79f71ba + 7898c50 commit af43c0a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion RGB.NET.Devices.Novation/Enum/NovationDevices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
3 changes: 1 addition & 2 deletions RGB.NET.Devices.Novation/NovationDeviceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ protected override IEnumerable<IRGBDevice> LoadDevices()
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;

Expand Down

0 comments on commit af43c0a

Please sign in to comment.