mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-10 20:46:24 +00:00
OpenRGB - Switch to file scoped namespaces
This commit is contained in:
1 parent
2d203d31ab
commit
7954b876ef
14 files changed
+562
-607
No files matched your search
@@ -2,67 +2,66 @@
|
||||
using OpenRGB.NET.Models;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.OpenRGB
|
||||
namespace RGB.NET.Devices.OpenRGB;
|
||||
|
||||
/// <inheritdoc />
|
||||
public class OpenRGBZoneDevice : AbstractOpenRGBDevice<OpenRGBDeviceInfo>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public class OpenRGBZoneDevice : AbstractOpenRGBDevice<OpenRGBZoneDeviceInfo>
|
||||
private readonly int _initialLed;
|
||||
private readonly Zone _zone;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OpenRGBZoneDevice"/> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The information provided by OpenRGB</param>
|
||||
/// <param name="initialLed">The ledId of the first led in the device that belongs to this zone.</param>
|
||||
/// <param name="zone">The Zone information provided by OpenRGB.</param>
|
||||
/// <param name="updateQueue">The queue used to update this zone.</param>
|
||||
public OpenRGBZoneDevice(OpenRGBDeviceInfo info, int initialLed, Zone zone, IUpdateQueue updateQueue)
|
||||
: base(info, updateQueue)
|
||||
{
|
||||
private readonly int _initialLed;
|
||||
private readonly Zone _zone;
|
||||
_initialLed = initialLed;
|
||||
_zone = zone;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OpenRGBZoneDevice"/> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The information provided by OpenRGB</param>
|
||||
/// <param name="initialLed">The ledId of the first led in the device that belongs to this zone.</param>
|
||||
/// <param name="zone">The Zone information provided by OpenRGB.</param>
|
||||
/// <param name="updateQueue">The queu used to update this zone.</param>
|
||||
public OpenRGBZoneDevice(OpenRGBZoneDeviceInfo info, int initialLed, Zone zone, IUpdateQueue updateQueue)
|
||||
: base(info, updateQueue)
|
||||
InitializeLayout();
|
||||
}
|
||||
|
||||
private void InitializeLayout()
|
||||
{
|
||||
Size ledSize = new Size(19);
|
||||
const int ledSpacing = 20;
|
||||
LedId initial = Helper.GetInitialLedIdForDeviceType(DeviceInfo.DeviceType) + _initialLed;
|
||||
|
||||
if (_zone.Type == ZoneType.Matrix)
|
||||
{
|
||||
_initialLed = initialLed;
|
||||
_zone = zone;
|
||||
|
||||
InitializeLayout();
|
||||
}
|
||||
|
||||
private void InitializeLayout()
|
||||
{
|
||||
Size ledSize = new Size(19);
|
||||
const int ledSpacing = 20;
|
||||
LedId initial = Helper.GetInitialLedIdForDeviceType(DeviceInfo.DeviceType) + _initialLed;
|
||||
|
||||
if (_zone.Type == ZoneType.Matrix)
|
||||
for (int row = 0; row < _zone.MatrixMap.Height; row++)
|
||||
{
|
||||
for (int row = 0; row < _zone.MatrixMap.Height; row++)
|
||||
for (int column = 0; column < _zone.MatrixMap.Width; column++)
|
||||
{
|
||||
for (int column = 0; column < _zone.MatrixMap.Width; column++)
|
||||
{
|
||||
uint index = _zone.MatrixMap.Matrix[row, column];
|
||||
uint index = _zone.MatrixMap.Matrix[row, column];
|
||||
|
||||
//will be max value if the position does not have an associated key
|
||||
if (index == uint.MaxValue)
|
||||
continue;
|
||||
//will be max value if the position does not have an associated key
|
||||
if (index == uint.MaxValue)
|
||||
continue;
|
||||
|
||||
LedId ledId = StandardKeyNames.Default.TryGetValue(DeviceInfo.OpenRGBDevice.Leds[_initialLed + index].Name, out LedId l)
|
||||
? l
|
||||
: initial++;
|
||||
LedId ledId = LedMappings.Default.TryGetValue(DeviceInfo.OpenRGBDevice.Leds[_initialLed + index].Name, out LedId l)
|
||||
? l
|
||||
: initial++;
|
||||
|
||||
while (AddLed(ledId, new Point(ledSpacing * column, ledSpacing * row), ledSize, _initialLed + (int)index) == null)
|
||||
ledId = initial++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < _zone.LedCount; i++)
|
||||
{
|
||||
LedId ledId = initial++;
|
||||
|
||||
while (AddLed(ledId, new Point(ledSpacing * i, 0), ledSize, _initialLed + i) == null)
|
||||
while (AddLed(ledId, new Point(ledSpacing * column, ledSpacing * row), ledSize, _initialLed + (int)index) == null)
|
||||
ledId = initial++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < _zone.LedCount; i++)
|
||||
{
|
||||
LedId ledId = initial++;
|
||||
|
||||
while (AddLed(ledId, new Point(ledSpacing * i, 0), ledSize, _initialLed + i) == null)
|
||||
ledId = initial++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
using RGB.NET.Core;
|
||||
using System.Collections.Generic;
|
||||
using OpenRGBDevice = OpenRGB.NET.Models.Device;
|
||||
|
||||
namespace RGB.NET.Devices.OpenRGB
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Wooting.Keyboard.WootingKeyboardRGBDevice" />.
|
||||
/// </summary>
|
||||
public class OpenRGBZoneDeviceInfo : AbstractOpenRGBDeviceInfo
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="device"></param>
|
||||
public OpenRGBZoneDeviceInfo(OpenRGBDevice device) : base(device)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user