mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 04:57:15 +00:00
Added layout-functionality to corsair devices
This commit is contained in:
1 parent
cedd220789
commit
f83b08af5e
12 files changed
+99
-31
No files matched your search
@@ -1,7 +1,11 @@
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using RGB.NET.Core;
|
||||
using RGB.NET.Core.Layout;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
@@ -35,13 +39,14 @@ namespace RGB.NET.Devices.Corsair
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the <see cref="Led"/> of the headset.
|
||||
/// </summary>
|
||||
protected override void InitializeLeds()
|
||||
/// <inheritdoc />
|
||||
protected override void InitializeLayout()
|
||||
{
|
||||
InitializeLed(new CorsairLedId(this, CorsairLedIds.LeftLogo), new Rectangle(0, 0, 10, 10));
|
||||
InitializeLed(new CorsairLedId(this, CorsairLedIds.RightLogo), new Rectangle(10, 0, 10, 10));
|
||||
|
||||
ApplyLayoutFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location),
|
||||
$@"Layouts\Corsair\Headsets\{HeadsetDeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using RGB.NET.Devices.Corsair.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
@@ -18,7 +20,8 @@ namespace RGB.NET.Devices.Corsair
|
||||
internal CorsairHeadsetRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo)
|
||||
: base(deviceIndex, Core.RGBDeviceType.Headset, nativeInfo)
|
||||
{
|
||||
Image = new Uri($"pack://application:,,,/RGB.NET.Devices.Corsair;component/Images/Headsets/{Model.Replace(" ", string.Empty).ToUpper()}.png", UriKind.Absolute);
|
||||
Image = new Uri(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location),
|
||||
$@"Images\Corsair\Headsets\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Relative);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in new issue
Block a user