Updated Layouts to contain device-image infos

This commit is contained in:
DarthAffe committed 2018-01-17 21:56:01 +01:00
1 parent 6fe54bd3ec
commit 739fbf8733
64 files changed
+143 -185

No files matched your search

@@ -33,7 +33,7 @@ namespace RGB.NET.Devices.Corsair
public string Model { get; }
/// <inheritdoc />
public Uri Image { get; protected set; }
public Uri Image { get; set; }
/// <inheritdoc />
public bool SupportsSyncBack => true;
@@ -32,8 +32,7 @@ namespace RGB.NET.Devices.Corsair
InitializeLed(LedId.Headset1, new Rectangle(0, 0, 10, 10));
InitializeLed(LedId.Headset2, new Rectangle(10, 0, 10, 10));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Corsair\Headsets\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"),
null, PathHelper.GetAbsolutePath(@"Images\Corsair\Headsets"));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Corsair\Headsets\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), null);
}
/// <inheritdoc />
@@ -1,5 +1,4 @@
using System;
using RGB.NET.Core;
using RGB.NET.Core;
using RGB.NET.Devices.Corsair.Native;
namespace RGB.NET.Devices.Corsair
@@ -20,9 +19,7 @@ namespace RGB.NET.Devices.Corsair
/// <param name="nativeInfo">The native <see cref="T:RGB.NET.Devices.Corsair.Native._CorsairDeviceInfo" />-struct</param>
internal CorsairHeadsetRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo)
: base(deviceIndex, RGBDeviceType.Headset, nativeInfo)
{
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Corsair\Headsets\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
{ }
#endregion
}
@@ -51,8 +51,7 @@ namespace RGB.NET.Devices.Corsair
foreach (_CorsairLedPosition ledPosition in positions.OrderBy(p => p.LedId))
InitializeLed(mapping.TryGetValue(ledPosition.LedId, out LedId ledId) ? ledId : LedId.Invalid, new Rectangle(ledPosition.left, ledPosition.top, ledPosition.width, ledPosition.height));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Corsair\HeadsetStands\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"),
null, PathHelper.GetAbsolutePath(@"Images\Corsair\HeadsetStands"));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Corsair\HeadsetStands\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), null);
}
/// <inheritdoc />
@@ -1,5 +1,4 @@
using System;
using RGB.NET.Core;
using RGB.NET.Core;
using RGB.NET.Devices.Corsair.Native;
namespace RGB.NET.Devices.Corsair
@@ -20,9 +19,7 @@ namespace RGB.NET.Devices.Corsair
/// <param name="nativeInfo">The native <see cref="T:RGB.NET.Devices.Corsair.Native._CorsairDeviceInfo" />-struct</param>
internal CorsairHeadsetStandRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo)
: base(deviceIndex, RGBDeviceType.HeadsetStand, nativeInfo)
{
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Corsair\HeadsetStands\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
{ }
#endregion
}
@@ -50,8 +50,7 @@ namespace RGB.NET.Devices.Corsair
string model = DeviceInfo.Model.Replace(" ", string.Empty).ToUpper();
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(
$@"Layouts\Corsair\Keyboards\{model}\{DeviceInfo.PhysicalLayout.ToString().ToUpper()}.xml"),
DeviceInfo.LogicalLayout.ToString(), PathHelper.GetAbsolutePath(@"Images\Corsair\Keyboards"));
$@"Layouts\Corsair\Keyboards\{model}\{DeviceInfo.PhysicalLayout.ToString().ToUpper()}.xml"), DeviceInfo.LogicalLayout.ToString());
}
/// <inheritdoc />
@@ -1,7 +1,6 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global
using System;
using RGB.NET.Core;
using RGB.NET.Devices.Corsair.Native;
@@ -40,9 +39,6 @@ namespace RGB.NET.Devices.Corsair
{
this.PhysicalLayout = (CorsairPhysicalKeyboardLayout)nativeInfo.physicalLayout;
this.LogicalLayout = (CorsairLogicalKeyboardLayout)nativeInfo.logicalLayout;
string model = Model.Replace(" ", string.Empty).ToUpper();
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Corsair\Keyboards\{model}.png"), UriKind.Absolute);
}
#endregion
@@ -9,6 +9,8 @@
<Model>K70 RGB</Model>
<Width>436</Width>
<Height>165</Height>
<ImageBasePath>Images\Corsair\Keyboards</ImageBasePath>
<DeviceImage>K70RGB.png</DeviceImage>
<Leds>
<!-- Extra-Keys: Brightness -> Mute -->
<Led Id="Keyboard_Brightness">
@@ -9,6 +9,8 @@
<Model>K95 RGB</Model>
<Width>500</Width>
<Height>165</Height>
<ImageBasePath>Images\Corsair\Keyboards</ImageBasePath>
<DeviceImage>K95RGB.png</DeviceImage>
<Leds>
<!-- Extra-Keys: MR -> Mute -->
<Led Id="Keyboard_MacroRecording">
@@ -9,6 +9,8 @@
<Model>K95 RGB Platinum</Model>
<Width>465</Width>
<Height>169</Height>
<ImageBasePath>Images\Corsair\Keyboards</ImageBasePath>
<DeviceImage>K95RGBPLATINUM.png</DeviceImage>
<Leds>
<!-- Extra-Keys: ? -> Mute -->
<Led Id="Keyboard_Brightness">
@@ -13,6 +13,8 @@
<xsd:element name="Shape" type="xsd:string" />
<xsd:element name="Width" type="xsd:double" />
<xsd:element name="Height" type="xsd:double" />
<xsd:element name="ImageBasePath" type="xsd:string" />
<xsd:element name="DeviceImage" type="xsd:string" />
<xsd:element name="LedUnitWidth" type="xsd:double" />
<xsd:element name="LedUnitHeight" type="xsd:double" />
<xsd:element name="Leds">
@@ -54,8 +54,7 @@ namespace RGB.NET.Devices.Corsair
throw new RGBDeviceException($"Can't initialize mouse with layout '{DeviceInfo.PhysicalLayout}'");
}
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Corsair\Mice\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"),
null, PathHelper.GetAbsolutePath(@"Images\Corsair\Mice"));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Corsair\Mice\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), null);
}
/// <inheritdoc />
@@ -1,5 +1,4 @@
using System;
using RGB.NET.Core;
using RGB.NET.Core;
using RGB.NET.Devices.Corsair.Native;
namespace RGB.NET.Devices.Corsair
@@ -31,8 +30,6 @@ namespace RGB.NET.Devices.Corsair
: base(deviceIndex, RGBDeviceType.Mouse, nativeInfo)
{
this.PhysicalLayout = (CorsairPhysicalMouseLayout)nativeInfo.physicalLayout;
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Corsair\Mice\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
#endregion
@@ -51,8 +51,7 @@ namespace RGB.NET.Devices.Corsair
foreach (_CorsairLedPosition ledPosition in positions.OrderBy(p => p.LedId))
InitializeLed(mapping.TryGetValue(ledPosition.LedId, out LedId ledId) ? ledId : LedId.Invalid, new Rectangle(ledPosition.left, ledPosition.top, ledPosition.width, ledPosition.height));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Corsair\Mousepads\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"),
null, PathHelper.GetAbsolutePath(@"Images\Corsair\Mousepads"));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Corsair\Mousepads\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), null);
}
/// <inheritdoc />
@@ -1,5 +1,4 @@
using System;
using RGB.NET.Core;
using RGB.NET.Core;
using RGB.NET.Devices.Corsair.Native;
namespace RGB.NET.Devices.Corsair
@@ -20,9 +19,7 @@ namespace RGB.NET.Devices.Corsair
/// <param name="nativeInfo">The native <see cref="T:RGB.NET.Devices.Corsair.Native._CorsairDeviceInfo" />-struct</param>
internal CorsairMousepadRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo)
: base(deviceIndex, RGBDeviceType.Mousepad, nativeInfo)
{
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Corsair\Mousepad\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
{ }
#endregion
}