mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Added shape to led and improved layout-loading
This commit is contained in:
parent
bc8e5d54db
commit
bdf446581e
@ -51,10 +51,10 @@ namespace RGB.NET.Core.Layout
|
|||||||
public string Model { get; set; }
|
public string Model { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the <see cref="LayoutShape"/> of the <see cref="DeviceLayout"/>.
|
/// Gets or sets the <see cref="Core.Shape"/> of the <see cref="DeviceLayout"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[XmlElement("Shape")]
|
[XmlElement("Shape")]
|
||||||
public LayoutShape Shape { get; set; }
|
public Shape Shape { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the width of the <see cref="DeviceLayout"/>.
|
/// Gets or sets the width of the <see cref="DeviceLayout"/>.
|
||||||
|
|||||||
@ -19,10 +19,10 @@ namespace RGB.NET.Core.Layout
|
|||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the <see cref="LayoutShape"/> of the <see cref="LedLayout"/>.
|
/// Gets or sets the <see cref="RGB.NET.Core.Shape"/> of the <see cref="LedLayout"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[XmlElement("Shape")]
|
[XmlElement("Shape")]
|
||||||
public LayoutShape Shape { get; set; }
|
public Shape Shape { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the x-position of the <see cref="LedLayout"/>.
|
/// Gets or sets the x-position of the <see cref="LedLayout"/>.
|
||||||
|
|||||||
@ -22,6 +22,16 @@ namespace RGB.NET.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ILedId Id { get; }
|
public ILedId Id { get; }
|
||||||
|
|
||||||
|
private Shape _shape = Shape.Rectangle;
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the <see cref="Core.Shape"/> of the <see cref="Led"/>.
|
||||||
|
/// </summary>
|
||||||
|
public Shape Shape
|
||||||
|
{
|
||||||
|
get { return _shape; }
|
||||||
|
set { SetProperty(ref _shape, value); }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a rectangle representing the physical location of the <see cref="Led"/> relative to the <see cref="Device"/>.
|
/// Gets a rectangle representing the physical location of the <see cref="Led"/> relative to the <see cref="Device"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -1,16 +1,22 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using RGB.NET.Core.Layout;
|
||||||
|
|
||||||
namespace RGB.NET.Core.Layout
|
namespace RGB.NET.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Contains a list of different shapes used by <see cref="DeviceLayout"/>.
|
/// Contains a list of different shapes used by <see cref="DeviceLayout"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public enum LayoutShape
|
public enum Shape
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A simple rectangle.
|
/// A simple rectangle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Rectangle = 0
|
Rectangle = 0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A simple circle.
|
||||||
|
/// </summary>
|
||||||
|
Circle = 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -49,7 +49,7 @@
|
|||||||
<Compile Include="ColorCorrection\IColorCorrection.cs" />
|
<Compile Include="ColorCorrection\IColorCorrection.cs" />
|
||||||
<Compile Include="Devices\AbstractRGBDevice.cs" />
|
<Compile Include="Devices\AbstractRGBDevice.cs" />
|
||||||
<Compile Include="Devices\RGBDeviceLighting.cs" />
|
<Compile Include="Devices\RGBDeviceLighting.cs" />
|
||||||
<Compile Include="Devices\Layout\LayoutShape.cs" />
|
<Compile Include="Positioning\Shape.cs" />
|
||||||
<Compile Include="Devices\Layout\LedLayout.cs" />
|
<Compile Include="Devices\Layout\LedLayout.cs" />
|
||||||
<Compile Include="Devices\Layout\DeviceLayout.cs" />
|
<Compile Include="Devices\Layout\DeviceLayout.cs" />
|
||||||
<Compile Include="Devices\RGBDeviceType.cs" />
|
<Compile Include="Devices\RGBDeviceType.cs" />
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using RGB.NET.Core;
|
using RGB.NET.Core;
|
||||||
using RGB.NET.Core.Layout;
|
using RGB.NET.Core.Layout;
|
||||||
@ -82,6 +80,8 @@ namespace RGB.NET.Devices.Corsair
|
|||||||
led.LedRectangle.Location.Y = layoutLed.Y;
|
led.LedRectangle.Location.Y = layoutLed.Y;
|
||||||
led.LedRectangle.Size.Width = layoutLed.Width;
|
led.LedRectangle.Size.Width = layoutLed.Width;
|
||||||
led.LedRectangle.Size.Height = layoutLed.Height;
|
led.LedRectangle.Size.Height = layoutLed.Height;
|
||||||
|
|
||||||
|
led.Shape = layoutLed.Shape;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,6 +34,9 @@ namespace RGB.NET.Devices.Corsair
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Uri Image { get; protected set; }
|
public Uri Image { get; protected set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public RGBDeviceLighting Lighting => RGBDeviceLighting.Key;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a flag that describes device capabilities. (<see cref="CorsairDeviceCaps" />)
|
/// Gets a flag that describes device capabilities. (<see cref="CorsairDeviceCaps" />)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
// ReSharper disable MemberCanBePrivate.Global
|
// ReSharper disable MemberCanBePrivate.Global
|
||||||
// ReSharper disable UnusedMember.Global
|
// ReSharper disable UnusedMember.Global
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using RGB.NET.Core;
|
using RGB.NET.Core;
|
||||||
using RGB.NET.Core.Layout;
|
|
||||||
|
|
||||||
namespace RGB.NET.Devices.Corsair
|
namespace RGB.NET.Devices.Corsair
|
||||||
{
|
{
|
||||||
|
|||||||
@ -59,7 +59,7 @@ namespace RGB.NET.Devices.Corsair
|
|||||||
}
|
}
|
||||||
|
|
||||||
ApplyLayoutFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location),
|
ApplyLayoutFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location),
|
||||||
$@"Layouts\Corsair\Keyboards\{KeyboardDeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}\{KeyboardDeviceInfo.LogicalLayout.ToString().ToUpper()}.xml"));
|
$@"Layouts\Corsair\Keyboards\{KeyboardDeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}\{KeyboardDeviceInfo.PhysicalLayout.ToString().ToUpper()}.xml"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user