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

Updated Layouts to contain device-image infos

This commit is contained in:
Darth Affe 2018-01-17 21:56:01 +01:00
parent 6fe54bd3ec
commit 739fbf8733
64 changed files with 143 additions and 185 deletions

View File

@ -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">

View File

@ -16,7 +16,7 @@ namespace RGB.NET.Core
/// Represents a generic RGB-device
/// </summary>
public abstract class AbstractRGBDevice<TDeviceInfo> : AbstractBindable, IRGBDevice<TDeviceInfo>
where TDeviceInfo : IRGBDeviceInfo
where TDeviceInfo : class, IRGBDeviceInfo
{
#region Properties & Fields
@ -130,13 +130,16 @@ namespace RGB.NET.Core
/// </summary>
/// <param name="layoutPath">The file containing the layout.</param>
/// <param name="imageLayout">The name of the layout used to get the images of the leds.</param>
/// <param name="imageBasePath">The path images for this device are collected in.</param>
/// <param name="createMissingLeds">If set to true a new led is initialized for every id in the layout if it doesn't already exist.</param>
protected virtual void ApplyLayoutFromFile(string layoutPath, string imageLayout, string imageBasePath, bool createMissingLeds = false)
protected virtual DeviceLayout ApplyLayoutFromFile(string layoutPath, string imageLayout, bool createMissingLeds = false)
{
DeviceLayout layout = DeviceLayout.Load(layoutPath);
if (layout != null)
{
string imageBasePath = string.IsNullOrWhiteSpace(layout.ImageBasePath) ? null : PathHelper.GetAbsolutePath(layout.ImageBasePath);
if ((imageBasePath != null) && !string.IsNullOrWhiteSpace(layout.DeviceImage) && (DeviceInfo != null))
DeviceInfo.Image = new Uri(Path.Combine(imageBasePath, layout.DeviceImage), UriKind.Absolute);
LedImageLayout ledImageLayout = layout.LedImageLayouts.FirstOrDefault(x => string.Equals(x.Layout, imageLayout, StringComparison.OrdinalIgnoreCase));
Size = new Size(layout.Width, layout.Height);
@ -158,13 +161,14 @@ namespace RGB.NET.Core
led.ShapeData = layoutLed.ShapeData;
LedImage image = ledImageLayout?.LedImages.FirstOrDefault(x => x.Id == layoutLed.Id);
led.Image = (!string.IsNullOrEmpty(image?.Image))
? new Uri(Path.Combine(imageBasePath, image.Image), UriKind.Absolute)
: new Uri(Path.Combine(imageBasePath, "Missing.png"), UriKind.Absolute);
if ((imageBasePath != null) && !string.IsNullOrEmpty(image?.Image))
led.Image = new Uri(Path.Combine(imageBasePath, image.Image), UriKind.Absolute);
}
}
}
}
return layout;
}
/// <summary>

View File

@ -37,7 +37,7 @@ namespace RGB.NET.Core
/// <summary>
/// Gets the URI of an image of the <see cref="IRGBDevice"/> or null if there is no image.
/// </summary>
Uri Image { get; }
Uri Image { get; set; }
#endregion
}

View File

@ -84,6 +84,18 @@ namespace RGB.NET.Core.Layout
[DefaultValue(19.0)]
public double LedUnitHeight { get; set; } = 19.0;
/// <summary>
/// The path images for this device are collected in.
/// </summary>
[XmlElement("ImageBasePath")]
public string ImageBasePath { get; set; }
/// <summary>
/// The image file for this device.
/// </summary>
[XmlElement("DeviceImage")]
public string DeviceImage { get; set; }
/// <summary>
/// Gets or sets a list of <see cref="LedLayout"/> representing all the <see cref="Led"/> of the <see cref="DeviceLayout"/>.
/// </summary>

View File

@ -26,9 +26,7 @@ namespace RGB.NET.Devices.Asus
/// <param name="handle">The handle of the <see cref="IRGBDevice"/>.</param>
internal AsusDramRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
: base(deviceType, handle)
{
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Asus\Drams\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
{ }
#endregion
}

View File

@ -21,7 +21,7 @@ namespace RGB.NET.Devices.Asus
public string Model { get; }
/// <inheritdoc />
public Uri Image { get; protected set; }
public Uri Image { get; set; }
/// <inheritdoc />
public RGBDeviceLighting Lighting => RGBDeviceLighting.Key;

View File

@ -33,8 +33,7 @@ namespace RGB.NET.Devices.Asus
InitializeLed(LedId.GraphicsCard1 + i, new Rectangle(i * 10, 0, 10, 10));
//TODO DarthAffe 07.10.2017: We don't know the model, how to save layouts and images?
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\GraphicsCards\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"),
null, PathHelper.GetAbsolutePath(@"Images\Asus\GraphicsCards"));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\GraphicsCards\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), null);
}
/// <inheritdoc />

View File

@ -26,9 +26,7 @@ namespace RGB.NET.Devices.Asus
/// <param name="handle">The handle of the <see cref="IRGBDevice"/>.</param>
internal AsusGraphicsCardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
: base(deviceType, handle)
{
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Asus\GraphicsCards\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
{ }
#endregion
}

View File

@ -33,8 +33,7 @@ namespace RGB.NET.Devices.Asus
InitializeLed(LedId.Keyboard_Escape + i, new Rectangle(i * 19, 0, 19, 19));
string model = DeviceInfo.Model.Replace(" ", string.Empty).ToUpper();
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Keyboards\{model}\{DeviceInfo.PhysicalLayout.ToString().ToUpper()}.xml"),
DeviceInfo.LogicalLayout.ToString(), PathHelper.GetAbsolutePath(@"Images\Asus\Keyboards"));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Keyboards\{model}\{DeviceInfo.PhysicalLayout.ToString().ToUpper()}.xml"), DeviceInfo.LogicalLayout.ToString());
}
/// <inheritdoc />

View File

@ -37,17 +37,15 @@ namespace RGB.NET.Devices.Asus
/// <param name="handle">The handle of the <see cref="IRGBDevice"/>.</param>
/// <param name="culture">The <see cref="T:System.Globalization.CultureInfo" /> of the layout this keyboard is using.</param>
internal AsusKeyboardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle, CultureInfo culture)
: base(deviceType, handle, "Asus", "Claymore")
: base(deviceType, handle, "Claymore")
{
SetLayouts(culture.KeyboardLayoutId);
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Asus\Keyboards\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
#endregion
#region Methods
private void SetLayouts(int keyboardLayoutId)
{
switch (keyboardLayoutId)

View File

@ -9,6 +9,8 @@
<Model>Prime X370-PRO</Model>
<Width>252</Width>
<Height>305</Height>
<ImageBasePath>Images\Asus\Mainboards</ImageBasePath>
<DeviceImage>PRIMEX370-PRO.png</DeviceImage>
<Leds>
<Led Id="Mainboard1">
<X>0</X>

View File

@ -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">

View File

@ -32,9 +32,8 @@ namespace RGB.NET.Devices.Asus
for (int i = 0; i < ledCount; i++)
InitializeLed(LedId.Mainboard1 + i, new Rectangle(i * 40, 0, 40, 8));
//TODO DarthAffe 07.10.2017: We don'T know the model, how to save layouts and images?
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Mainboards\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"),
null, PathHelper.GetAbsolutePath(@"Images\Asus\Mainboards"));
//TODO DarthAffe 07.10.2017: We don't know the model, how to save layouts and images?
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Mainboards\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), null);
}
/// <inheritdoc />

View File

@ -26,9 +26,7 @@ namespace RGB.NET.Devices.Asus
/// <param name="handle">The handle of the <see cref="IRGBDevice"/>.</param>
internal AsusMainboardRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
: base(deviceType, handle, WMIHelper.GetMainboardInfo()?.model ?? "Generic Asus-Device")
{
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Asus\Mainboards\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
{ }
#endregion
}

View File

@ -32,8 +32,7 @@ namespace RGB.NET.Devices.Asus
for (int i = 0; i < ledCount; i++)
InitializeLed(LedId.Mouse1 + i, new Rectangle(i * 10, 0, 10, 10));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Mouses\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"),
null, PathHelper.GetAbsolutePath(@"Images\Asus\Mouses"));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Mouses\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), null);
}
/// <inheritdoc />

View File

@ -25,10 +25,8 @@ namespace RGB.NET.Devices.Asus
/// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param>
/// <param name="handle">The handle of the <see cref="IRGBDevice"/>.</param>
internal AsusMouseRGBDeviceInfo(RGBDeviceType deviceType, IntPtr handle)
: base(deviceType, handle, "Asus", "Rog")
{
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Asus\Mouses\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
: base(deviceType, handle, "Rog")
{ }
#endregion
}

View File

@ -121,11 +121,11 @@ namespace RGB.NET.Devices.Asus.Native
private static SetRogMouseModePointer _setRogMouseModePointer;
private static SetRogMouseColorPointer _setRogMouseColorPointer;
private static EnumerateDramPointer _enumerateDramPointer;
private static SetDramModePointer _setDramModePointer;
private static GetDramLedCountPointer _getDramLedCountPointer;
private static SetDramColorPointer _setDramColorPointer;
private static GetDramColorPointer _getDramColorPointer;
//private static EnumerateDramPointer _enumerateDramPointer;
//private static SetDramModePointer _setDramModePointer;
//private static GetDramLedCountPointer _getDramLedCountPointer;
//private static SetDramColorPointer _setDramColorPointer;
//private static GetDramColorPointer _getDramColorPointer;
#endregion
@ -169,16 +169,16 @@ namespace RGB.NET.Devices.Asus.Native
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void SetRogMouseColorPointer(IntPtr handle, byte[] colors, int size);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate int EnumerateDramPointer(IntPtr handles, int size);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate int GetDramLedCountPointer(IntPtr handle);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void SetDramModePointer(IntPtr handle, int mode);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void SetDramColorPointer(IntPtr handle, byte[] colors, int size);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate int GetDramColorPointer(IntPtr handle, IntPtr colors, int size);
//[UnmanagedFunctionPointer(CallingConvention.StdCall)]
//private delegate int EnumerateDramPointer(IntPtr handles, int size);
//[UnmanagedFunctionPointer(CallingConvention.StdCall)]
//private delegate int GetDramLedCountPointer(IntPtr handle);
//[UnmanagedFunctionPointer(CallingConvention.StdCall)]
//private delegate void SetDramModePointer(IntPtr handle, int mode);
//[UnmanagedFunctionPointer(CallingConvention.StdCall)]
//private delegate void SetDramColorPointer(IntPtr handle, byte[] colors, int size);
//[UnmanagedFunctionPointer(CallingConvention.StdCall)]
//private delegate int GetDramColorPointer(IntPtr handle, IntPtr colors, int size);
#endregion

View File

@ -22,7 +22,7 @@ namespace RGB.NET.Devices.CoolerMaster
public string Model { get; }
/// <inheritdoc />
public Uri Image { get; protected set; }
public Uri Image { get; set; }
/// <inheritdoc />
public RGBDeviceLighting Lighting => RGBDeviceLighting.Key;

View File

@ -57,8 +57,7 @@ namespace RGB.NET.Devices.CoolerMaster
string model = DeviceInfo.Model.Replace(" ", string.Empty).ToUpper();
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(
$@"Layouts\CoolerMaster\Keyboards\{model}\{DeviceInfo.PhysicalLayout.ToString().ToUpper()}.xml"),
DeviceInfo.LogicalLayout.ToString(), PathHelper.GetAbsolutePath(@"Images\CoolerMaster\Keyboards"));
$@"Layouts\CoolerMaster\Keyboards\{model}\{DeviceInfo.PhysicalLayout.ToString().ToUpper()}.xml"), DeviceInfo.LogicalLayout.ToString());
}
/// <inheritdoc />

View File

@ -1,5 +1,4 @@
using System;
using System.Globalization;
using System.Globalization;
using RGB.NET.Core;
namespace RGB.NET.Devices.CoolerMaster
@ -39,8 +38,6 @@ namespace RGB.NET.Devices.CoolerMaster
this.PhysicalLayout = physicalKeyboardLayout;
SetLayouts(culture.KeyboardLayoutId);
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\CoolerMaster\Keyboards\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
private void SetLayouts(int keyboardLayoutId)

View File

@ -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">

View File

@ -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;

View File

@ -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 />

View File

@ -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
}

View File

@ -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 />

View File

@ -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
}

View File

@ -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 />

View File

@ -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

View File

@ -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">

View File

@ -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">

View File

@ -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">

View File

@ -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">

View File

@ -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 />

View File

@ -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

View File

@ -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 />

View File

@ -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
}

View File

@ -56,10 +56,9 @@ namespace RGB.NET.Devices.Logitech
protected virtual void InitializeLayout()
{
if (!(DeviceInfo is LogitechRGBDeviceInfo info)) return;
string basePath = info.ImageBasePath;
string layout = info.ImageLayout;
string layoutPath = info.LayoutPath;
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Logitech\{layoutPath}.xml"), layout, PathHelper.GetAbsolutePath($@"Images\Logitech\{basePath}"), true);
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Logitech\{layoutPath}.xml"), layout, true);
}
#endregion

View File

@ -21,7 +21,7 @@ namespace RGB.NET.Devices.Logitech
public string Model { get; }
/// <inheritdoc />
public Uri Image { get; protected set; }
public Uri Image { get; set; }
/// <inheritdoc />
public RGBDeviceLighting Lighting
@ -46,11 +46,6 @@ namespace RGB.NET.Devices.Logitech
/// </summary>
public LogitechDeviceCaps DeviceCaps { get; }
/// <summary>
/// Gets the base of the image path used to load device-images.
/// </summary>
internal string ImageBasePath { get; }
/// <summary>
/// Gets the layout used to decide which images to load.
/// </summary>
@ -74,17 +69,14 @@ namespace RGB.NET.Devices.Logitech
/// <param name="imageBasePath">The base of the image path used to load device-images.</param>
/// <param name="imageLayout">The layout used to decide which images to load.</param>
/// <param name="layoutPath">The path/name of the layout-file.</param>
internal LogitechRGBDeviceInfo(RGBDeviceType deviceType, string model, LogitechDeviceCaps deviceCaps,
string imageBasePath, string imageLayout, string layoutPath)
internal LogitechRGBDeviceInfo(RGBDeviceType deviceType, string model, LogitechDeviceCaps deviceCaps,
string imageLayout, string layoutPath)
{
this.DeviceType = deviceType;
this.Model = model;
this.DeviceCaps = deviceCaps;
this.ImageBasePath = imageBasePath;
this.ImageLayout = imageLayout;
this.LayoutPath = layoutPath;
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Logitech\{LayoutPath}.png"), UriKind.Absolute);
}
#endregion

View File

@ -13,18 +13,18 @@ namespace RGB.NET.Devices.Logitech.HID
private const int VENDOR_ID = 0x046D;
//TODO DarthAffe 14.11.2017: Add devices
private static readonly List<(string model, RGBDeviceType deviceType, int id, string imageBasePath, string imageLayout, string layoutPath)> PER_KEY_DEVICES
= new List<(string model, RGBDeviceType deviceType, int id, string imageBasePath, string imageLayout, string layoutPath)>
private static readonly List<(string model, RGBDeviceType deviceType, int id, string imageLayout, string layoutPath)> PER_KEY_DEVICES
= new List<(string model, RGBDeviceType deviceType, int id, string imageLayout, string layoutPath)>
{
("G910", RGBDeviceType.Keyboard, 0xC32B, "Keyboards", "DE", @"Keyboards\G910\UK"), //TODO DarthAffe 15.11.2017: Somehow detect the current layout
("G610", RGBDeviceType.Keyboard, 0xC333, "Keyboards", "DE", @"Keyboards\G610\UK"),
("G910", RGBDeviceType.Keyboard, 0xC32B, "DE", @"Keyboards\G910\UK"), //TODO DarthAffe 15.11.2017: Somehow detect the current layout
("G610", RGBDeviceType.Keyboard, 0xC333, "DE", @"Keyboards\G610\UK"),
};
private static readonly List<(string model, RGBDeviceType deviceType, int id, string imageBasePath, string imageLayout, string layoutPath)> PER_DEVICE_DEVICES
= new List<(string model, RGBDeviceType deviceType, int id, string imageBasePath, string imageLayout, string layoutPath)>
private static readonly List<(string model, RGBDeviceType deviceType, int id, string imageLayout, string layoutPath)> PER_DEVICE_DEVICES
= new List<(string model, RGBDeviceType deviceType, int id, string imageLayout, string layoutPath)>
{
("G403", RGBDeviceType.Mouse, 0xC083, "Mice", "default", @"Mice\G403"),
("G502", RGBDeviceType.Mouse, 0xC332, "Mice", "default", @"Mice\G502"),
("G403", RGBDeviceType.Mouse, 0xC083, "default", @"Mice\G403"),
("G502", RGBDeviceType.Mouse, 0xC332, "default", @"Mice\G502"),
};
#endregion
@ -32,10 +32,10 @@ namespace RGB.NET.Devices.Logitech.HID
#region Properties & Fields
public static bool IsPerKeyDeviceConnected { get; private set; }
public static (string model, RGBDeviceType deviceType, int id, string imageBasePath, string imageLayout, string layoutPath) PerKeyDeviceData { get; private set; }
public static (string model, RGBDeviceType deviceType, int id, string imageLayout, string layoutPath) PerKeyDeviceData { get; private set; }
public static bool IsPerDeviceDeviceConnected { get; private set; }
public static (string model, RGBDeviceType deviceType, int id, string imageBasePath, string imageLayout, string layoutPath) PerDeviceDeviceData { get; private set; }
public static (string model, RGBDeviceType deviceType, int id, string imageLayout, string layoutPath) PerDeviceDeviceData { get; private set; }
#endregion
@ -46,7 +46,7 @@ namespace RGB.NET.Devices.Logitech.HID
HidDeviceLoader loader = new HidDeviceLoader();
List<int> ids = loader.GetDevices(VENDOR_ID).Select(x => x.ProductID).Distinct().ToList();
foreach ((string model, RGBDeviceType deviceType, int id, string imageBasePath, string imageLayout, string layoutPath) deviceData in PER_KEY_DEVICES)
foreach ((string model, RGBDeviceType deviceType, int id, string imageLayout, string layoutPath) deviceData in PER_KEY_DEVICES)
if (ids.Contains(deviceData.id))
{
IsPerKeyDeviceConnected = true;
@ -54,7 +54,7 @@ namespace RGB.NET.Devices.Logitech.HID
break;
}
foreach ((string model, RGBDeviceType deviceType, int id, string imageBasePath, string imageLayout, string layoutPath) deviceData in PER_DEVICE_DEVICES)
foreach ((string model, RGBDeviceType deviceType, int id, string imageLayout, string layoutPath) deviceData in PER_DEVICE_DEVICES)
if (ids.Contains(deviceData.id))
{
IsPerDeviceDeviceConnected = true;

View File

@ -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">

View File

@ -9,6 +9,8 @@
<Model>G610</Model>
<Width>442</Width>
<Height>152</Height>
<ImageBasePath>Images\Logitech\Keyboards</ImageBasePath>
<DeviceImage></DeviceImage>
<Leds>
<!-- Esc -> Pause -->
<Led Id="Keyboard_Escape">

View File

@ -9,6 +9,8 @@
<Model>G910</Model>
<Width>491</Width>
<Height>238</Height>
<ImageBasePath>Images\Logitech\Keyboards</ImageBasePath>
<DeviceImage>G910.png</DeviceImage>
<Leds>
<!-- Esc -> Pause -->
<Led Id="Keyboard_Escape">
@ -367,7 +369,7 @@
<LedImage Id="Keyboard_RightGui" Image="Raptor_Keys\Windows.png" />
<LedImage Id="Keyboard_Application" Image="Raptor_Keys\Menu.png" />
<LedImage Id="Keyboard_RightCtrl" Image="Raptor_Keys\Strg.png" />
<LedImage Id="Keyboard_ArrowLef" Image="Raptor_Keys\CaretLeft.png" />
<LedImage Id="Keyboard_ArrowLeft" Image="Raptor_Keys\CaretLeft.png" />
<LedImage Id="Keyboard_ArrowDown" Image="Raptor_Keys\CaretDown.png" />
<LedImage Id="Keyboard_ArrowRight" Image="Raptor_Keys\CaretRight.png" />
<LedImage Id="Keyboard_Num0" Image="Raptor_Keys\Num0_Einfg.png" />

View File

@ -9,13 +9,15 @@
<Model>G403</Model>
<Width>67</Width>
<Height>125</Height>
<ImageBasePath>Images\Logitech\Mice</ImageBasePath>
<DeviceImage>G403.png</DeviceImage>
<Leds>
<Led Id="Custom1">
<Shape>m 0.7025,0.00275 -0.15,0 -0,0.26 h 0.15 z m -0.16732,0.7925 c -0.7,0.0159 -0.55,0.19383 -0.006236,0.19067 l 0.001707,-0.0416 c -0.425,-0.0115 -0.225,-0.11 0.005116,-0.10 z m 0.410,0.0779 -0.435,0 0,0.0401 0.225,0 0,0.0437 0.21,0 z</Shape>
<X>24</X>
<Y>15</Y>
<Width>17mm</Width>
<Height>81mm</Height>
<Width>17mm</Width>
<Height>81mm</Height>
</Led>
</Leds>
</Device>

View File

@ -100,10 +100,10 @@ namespace RGB.NET.Devices.Logitech
{
if (DeviceChecker.IsPerKeyDeviceConnected)
{
(string model, RGBDeviceType deviceType, int _, string imageBasePath, string imageLayout, string layoutPath) = DeviceChecker.PerKeyDeviceData;
(string model, RGBDeviceType deviceType, int _, string imageLayout, string layoutPath) = DeviceChecker.PerKeyDeviceData;
if (loadFilter.HasFlag(deviceType)) //TODO DarthAffe 07.12.2017: Check if it's worth to try another device if the one returned doesn't match the filter
{
ILogitechRGBDevice device = new LogitechPerKeyRGBDevice(new LogitechRGBDeviceInfo(deviceType, model, LogitechDeviceCaps.PerKeyRGB, imageBasePath, imageLayout, layoutPath));
ILogitechRGBDevice device = new LogitechPerKeyRGBDevice(new LogitechRGBDeviceInfo(deviceType, model, LogitechDeviceCaps.PerKeyRGB, imageLayout, layoutPath));
device.Initialize();
devices.Add(device);
}
@ -115,10 +115,10 @@ namespace RGB.NET.Devices.Logitech
{
if (DeviceChecker.IsPerDeviceDeviceConnected)
{
(string model, RGBDeviceType deviceType, int _, string imageBasePath, string imageLayout, string layoutPath) = DeviceChecker.PerDeviceDeviceData;
(string model, RGBDeviceType deviceType, int _, string imageLayout, string layoutPath) = DeviceChecker.PerDeviceDeviceData;
if (loadFilter.HasFlag(deviceType)) //TODO DarthAffe 07.12.2017: Check if it's worth to try another device if the one returned doesn't match the filter
{
ILogitechRGBDevice device = new LogitechPerDeviceRGBDevice(new LogitechRGBDeviceInfo(deviceType, model, LogitechDeviceCaps.DeviceRGB, imageBasePath, imageLayout, layoutPath));
ILogitechRGBDevice device = new LogitechPerDeviceRGBDevice(new LogitechRGBDeviceInfo(deviceType, model, LogitechDeviceCaps.DeviceRGB, imageLayout, layoutPath));
device.Initialize();
devices.Add(device);
}

View File

@ -26,7 +26,7 @@ namespace RGB.NET.Devices.Msi
public string Model { get; }
/// <inheritdoc />
public Uri Image { get; protected set; }
public Uri Image { get; set; }
/// <inheritdoc />
public bool SupportsSyncBack => false;

View File

@ -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">

View File

@ -21,7 +21,7 @@ namespace RGB.NET.Devices.Novation
public string Model { get; }
/// <inheritdoc />
public Uri Image { get; protected set; }
public Uri Image { get; set; }
/// <inheritdoc />
public RGBDeviceLighting Lighting => RGBDeviceLighting.Key;

View File

@ -47,8 +47,7 @@ namespace RGB.NET.Devices.Novation
}
string model = DeviceInfo.Model.Replace(" ", string.Empty).ToUpper();
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(
$@"Layouts\Novation\Launchpads\{model.ToUpper()}.xml"), "Default", PathHelper.GetAbsolutePath(@"Images\Novation\Launchpads"));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Novation\Launchpads\{model.ToUpper()}.xml"), "Default");
}
/// <inheritdoc />

View File

@ -1,5 +1,4 @@
using System;
using RGB.NET.Core;
using RGB.NET.Core;
namespace RGB.NET.Devices.Novation
{
@ -20,9 +19,7 @@ namespace RGB.NET.Devices.Novation
/// <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)
: base(RGBDeviceType.LedMatrix, model, deviceId, colorCapabilities)
{
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Novation\Launchpads\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Absolute);
}
{ }
#endregion
}

View File

@ -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">

View File

@ -11,6 +11,8 @@
<Height>240</Height>
<LedUnitWidth>20</LedUnitWidth>
<LedUnitHeight>20</LedUnitHeight>
<ImageBasePath>Images\Novation\Launchpads</ImageBasePath>
<DeviceImage>LaunchpadS.png</DeviceImage>
<Leds>
<!-- Custom-buttons -->
<Led Id="Custom1">

View File

@ -34,8 +34,7 @@ namespace RGB.NET.Devices.Razer
protected override void InitializeLayout()
{
string model = DeviceInfo.Model.Replace(" ", string.Empty).ToUpper();
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(
$@"Layouts\Razer\ChromaLink\{model}.xml"), null, PathHelper.GetAbsolutePath(@"Images\Razer\ChromaLink"));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Razer\ChromaLink\{model}.xml"), null);
if (LedMapping.Count == 0)
for (int i = 0; i < _Defines.CHROMALINK_MAX_LEDS; i++)

View File

@ -1,7 +1,4 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global
using System;
using System;
using RGB.NET.Core;
namespace RGB.NET.Devices.Razer
@ -22,10 +19,7 @@ namespace RGB.NET.Devices.Razer
/// <param name="model">The model of the <see cref="IRGBDevice"/>.</param>
internal RazerChromaLinkRGBDeviceInfo(Guid deviceId, string model)
: base(deviceId, RGBDeviceType.LedStripe, model)
{
string modelName = Model.Replace(" ", string.Empty).ToUpper();
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Razer\ChromaLinks\{modelName}.png"), UriKind.Absolute);
}
{ }
#endregion
}

View File

@ -26,7 +26,7 @@ namespace RGB.NET.Devices.Razer
public string Model { get; }
/// <inheritdoc />
public Uri Image { get; protected set; }
public Uri Image { get; set; }
/// <inheritdoc />
public bool SupportsSyncBack => false;

View File

@ -34,8 +34,7 @@ namespace RGB.NET.Devices.Razer
protected override void InitializeLayout()
{
string model = DeviceInfo.Model.Replace(" ", string.Empty).ToUpper();
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(
$@"Layouts\Razer\Headset\{model}.xml"), null, PathHelper.GetAbsolutePath(@"Images\Razer\Headset"));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Razer\Headset\{model}.xml"), null);
if (LedMapping.Count == 0)
for (int i = 0; i < _Defines.HEADSET_MAX_LEDS; i++)

View File

@ -1,7 +1,4 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global
using System;
using System;
using RGB.NET.Core;
namespace RGB.NET.Devices.Razer
@ -22,10 +19,7 @@ namespace RGB.NET.Devices.Razer
/// <param name="model">The model of the <see cref="IRGBDevice"/>.</param>
internal RazerHeadsetRGBDeviceInfo(Guid deviceId, string model)
: base(deviceId, RGBDeviceType.Headset, model)
{
string modelName = Model.Replace(" ", string.Empty).ToUpper();
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Razer\Headsets\{modelName}.png"), UriKind.Absolute);
}
{ }
#endregion
}

View File

@ -40,9 +40,6 @@ namespace RGB.NET.Devices.Razer
: base(deviceId, RGBDeviceType.Keyboard, model)
{
SetLayouts(culture.KeyboardLayoutId);
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Razer\Keyboards\{Model.Replace(" ", string.Empty).ToUpper()}.png"),
UriKind.Absolute);
}
#endregion

View File

@ -34,8 +34,7 @@ namespace RGB.NET.Devices.Razer
protected override void InitializeLayout()
{
string model = DeviceInfo.Model.Replace(" ", string.Empty).ToUpper();
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(
$@"Layouts\Razer\Keypad\{model}.xml"), null, PathHelper.GetAbsolutePath(@"Images\Razer\Keypad"));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Razer\Keypad\{model}.xml"), null);
if (LedMapping.Count == 0)
{

View File

@ -1,7 +1,4 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global
using System;
using System;
using RGB.NET.Core;
namespace RGB.NET.Devices.Razer
@ -22,10 +19,7 @@ namespace RGB.NET.Devices.Razer
/// <param name="model">The model of the <see cref="IRGBDevice"/>.</param>
internal RazerKeypadRGBDeviceInfo(Guid deviceId, string model)
: base(deviceId, RGBDeviceType.Keypad, model)
{
string modelName = Model.Replace(" ", string.Empty).ToUpper();
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Razer\Keypads\{modelName}.png"), UriKind.Absolute);
}
{ }
#endregion
}

View File

@ -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">

View File

@ -34,8 +34,7 @@ namespace RGB.NET.Devices.Razer
protected override void InitializeLayout()
{
string model = DeviceInfo.Model.Replace(" ", string.Empty).ToUpper();
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(
$@"Layouts\Razer\Mice\{model}.xml"), null, PathHelper.GetAbsolutePath(@"Images\Razer\Mice"));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Razer\Mice\{model}.xml"), null);
if (LedMapping.Count == 0)
{

View File

@ -1,7 +1,4 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global
using System;
using System;
using RGB.NET.Core;
namespace RGB.NET.Devices.Razer
@ -22,10 +19,7 @@ namespace RGB.NET.Devices.Razer
/// <param name="model">The model of the <see cref="IRGBDevice"/>.</param>
internal RazerMouseRGBDeviceInfo(Guid deviceId, string model)
: base(deviceId, RGBDeviceType.Mouse, model)
{
string modelName = Model.Replace(" ", string.Empty).ToUpper();
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Razer\Mice\{modelName}.png"), UriKind.Absolute);
}
{ }
#endregion
}

View File

@ -34,8 +34,7 @@ namespace RGB.NET.Devices.Razer
protected override void InitializeLayout()
{
string model = DeviceInfo.Model.Replace(" ", string.Empty).ToUpper();
ApplyLayoutFromFile(PathHelper.GetAbsolutePath(
$@"Layouts\Razer\Mousepad\{model}.xml"), null, PathHelper.GetAbsolutePath(@"Images\Razer\Mousepad"));
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Razer\Mousepad\{model}.xml"), null);
if (LedMapping.Count == 0)
for (int i = 0; i < _Defines.MOUSEPAD_MAX_LEDS; i++)

View File

@ -1,7 +1,4 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global
using System;
using System;
using RGB.NET.Core;
namespace RGB.NET.Devices.Razer
@ -22,10 +19,7 @@ namespace RGB.NET.Devices.Razer
/// <param name="model">The model of the <see cref="IRGBDevice"/>.</param>
internal RazerMousepadRGBDeviceInfo(Guid deviceId, string model)
: base(deviceId, RGBDeviceType.Mousepad, model)
{
string modelName = Model.Replace(" ", string.Empty).ToUpper();
Image = new Uri(PathHelper.GetAbsolutePath($@"Images\Razer\Mousepads\{modelName}.png"), UriKind.Absolute);
}
{ }
#endregion
}