mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-10 20:46:24 +00:00
Fixed code issues
This commit is contained in:
1 parent
59e11e5b82
commit
7c0a216ccd
64 files changed
+278
-34
No files matched your search
@@ -51,11 +51,11 @@ namespace RGB.NET.Devices.Novation
|
||||
_outputDevice.SendShort(message.Message);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates a update-message out of a specified data set.
|
||||
/// </summary>
|
||||
/// <param name="data">The data set to create the message from.</param>
|
||||
/// <param name="key">The key used to identify the LED to update.</param>
|
||||
/// <param name="color">The color to send.</param>
|
||||
/// <returns>The message created out of the data set.</returns>
|
||||
protected abstract ShortMessage? CreateMessage(object key, in Color color);
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace RGB.NET.Devices.Novation
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.Novation.NovationLaunchpadRGBDevice" /> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The specific information provided by Novation for the launchpad</param>
|
||||
/// <param name="updateTrigger">The update trigger used to update this device.</param>
|
||||
internal NovationLaunchpadRGBDevice(NovationLaunchpadRGBDeviceInfo info, IDeviceUpdateTrigger updateTrigger)
|
||||
: base(info, updateTrigger)
|
||||
{
|
||||
@@ -44,8 +45,13 @@ namespace RGB.NET.Devices.Novation
|
||||
protected override object GetLedCustomData(LedId ledId) => GetDeviceMapping().TryGetValue(ledId, out (byte mode, byte id, int _, int __) data) ? (data.mode, data.id) : ((byte)0x00, (byte)0x00);
|
||||
// ReSharper restore RedundantCast
|
||||
|
||||
/// <summary>
|
||||
/// Gets the mapping used to access the LEDs of the device based on <see cref="NovationLaunchpadRGBDeviceInfo.LedMapping"/>.
|
||||
/// </summary>
|
||||
/// <returns>The mapping of the device.</returns>
|
||||
/// <exception cref="ArgumentOutOfRangeException">Thrown if the value of <see cref="NovationLaunchpadRGBDeviceInfo.LedMapping"/> is not known.</exception>
|
||||
protected virtual Dictionary<LedId, (byte mode, byte id, int x, int y)> GetDeviceMapping()
|
||||
=> DeviceInfo.LedIdMapping switch
|
||||
=> DeviceInfo.LedMapping switch
|
||||
{
|
||||
LedIdMappings.Current => LaunchpadIdMapping.CURRENT,
|
||||
LedIdMappings.Legacy => LaunchpadIdMapping.LEGACY,
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace RGB.NET.Devices.Novation
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
internal LedIdMappings LedIdMapping { get; }
|
||||
internal LedIdMappings LedMapping { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -23,11 +23,11 @@ namespace RGB.NET.Devices.Novation
|
||||
/// <param name="model">The represented device model.</param>
|
||||
/// <param name="deviceId"></param>
|
||||
/// <param name="colorCapabilities">The <see cref="T:RGB.NET.Devices.Novation.NovationColorCapabilities" /> of the <see cref="T:RGB.NET.Core.IRGBDevice" />.</param>
|
||||
internal NovationLaunchpadRGBDeviceInfo(string model, int deviceId, NovationColorCapabilities colorCapabilities,
|
||||
LedIdMappings ledIdMapping)
|
||||
/// <param name="ledMapping">A mapping of leds this device is initialized with.</param>
|
||||
internal NovationLaunchpadRGBDeviceInfo(string model, int deviceId, NovationColorCapabilities colorCapabilities, LedIdMappings ledMapping)
|
||||
: base(RGBDeviceType.LedMatrix, model, deviceId, colorCapabilities)
|
||||
{
|
||||
this.LedIdMapping = ledIdMapping;
|
||||
this.LedMapping = ledMapping;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -41,8 +41,10 @@ namespace RGB.NET.Devices.Novation
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void InitializeSDK() { }
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override IEnumerable<IRGBDevice> LoadDevices()
|
||||
{
|
||||
for (int index = 0; index < OutputDeviceBase.DeviceCount; index++)
|
||||
|
||||
Reference in new issue
Block a user