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

Added Id to devices

This commit is contained in:
Darth Affe 2018-07-10 20:06:38 +02:00
parent 38f62e0a37
commit a86d5f7e84
19 changed files with 52 additions and 12 deletions

View File

@ -9,6 +9,11 @@ namespace RGB.NET.Core
{
#region Properties & Fields
/// <summary>
/// Gets an unique identifier of the <see cref="IRGBDevice"/> this info belongs to.
/// </summary>
object DeviceId { get; }
/// <summary>
/// Gets the <see cref="RGBDeviceType"/> of the <see cref="IRGBDevice"/>.
/// </summary>

View File

@ -11,6 +11,9 @@ namespace RGB.NET.Devices.Asus
{
#region Properties & Fields
/// <inheritdoc />
public object DeviceId => Handle.ToInt32();
/// <inheritdoc />
public RGBDeviceType DeviceType { get; }

View File

@ -12,6 +12,9 @@ namespace RGB.NET.Devices.CoolerMaster
{
#region Properties & Fields
/// <inheritdoc />
public object DeviceId => DeviceIndex;
/// <inheritdoc />
public RGBDeviceType DeviceType { get; }

View File

@ -14,6 +14,9 @@ namespace RGB.NET.Devices.Corsair
{
#region Properties & Fields
/// <inheritdoc />
public object DeviceId => CorsairDeviceIndex;
/// <summary>
/// Gets the corsair specific device type.
/// </summary>

View File

@ -21,6 +21,9 @@ namespace RGB.NET.Devices.DMX.E131
#region Properties & Fields
/// <inheritdoc />
public object DeviceId => CID;
/// <inheritdoc />
public RGBDeviceType DeviceType { get; }

View File

@ -11,6 +11,9 @@ namespace RGB.NET.Devices.Debug
{
#region Properties & Fields
/// <inheritdoc />
public object DeviceId { get; }
/// <inheritdoc />
public RGBDeviceType DeviceType { get; }
@ -41,13 +44,15 @@ namespace RGB.NET.Devices.Debug
/// <param name="model">The model of the device.</param>
/// <param name="lighting">The <see cref="RGBDeviceLighting"/> of the device.</param>
/// <param name="supportsSyncBack">True if the device supports syncback; false if not.</param>
internal DebugRGBDeviceInfo(RGBDeviceType deviceType, string manufacturer, string model, RGBDeviceLighting lighting, bool supportsSyncBack)
/// <param name="deviceId">The unique identifier of this device.</param>
internal DebugRGBDeviceInfo(RGBDeviceType deviceType, string manufacturer, string model, RGBDeviceLighting lighting, bool supportsSyncBack, object deviceId = null)
{
this.DeviceType = deviceType;
this.Manufacturer = manufacturer;
this.Model = model;
this.Lighting = lighting;
this.SupportsSyncBack = supportsSyncBack;
this.DeviceId = deviceId;
}
#endregion

View File

@ -11,6 +11,9 @@ namespace RGB.NET.Devices.Logitech
{
#region Properties & Fields
/// <inheritdoc />
public object DeviceId => Lighting;
/// <inheritdoc />
public RGBDeviceType DeviceType { get; }

View File

@ -11,6 +11,9 @@ namespace RGB.NET.Devices.Msi
{
#region Properties & Fields
/// <inheritdoc />
public object DeviceId => MsiDeviceType;
/// <inheritdoc />
public RGBDeviceType DeviceType { get; }

View File

@ -58,7 +58,7 @@ namespace RGB.NET.Devices.Novation
}
if (DeviceInfo.ColorCapabilities == NovationColorCapabilities.LimitedRG)
UpdateQueue = new LimitedColorUpdateQueue(updateTrigger, DeviceInfo.DeviceId);
UpdateQueue = new LimitedColorUpdateQueue(updateTrigger, DeviceInfo.MidiDeviceId);
}
/// <summary>

View File

@ -11,6 +11,9 @@ namespace RGB.NET.Devices.Novation
{
#region Properties & Fields
/// <inheritdoc />
public object DeviceId => MidiDeviceId;
/// <inheritdoc />
public RGBDeviceType DeviceType { get; }
@ -37,7 +40,7 @@ namespace RGB.NET.Devices.Novation
/// <summary>
/// Gets the (midi)-id of the <see cref="IRGBDevice"/>..
/// </summary>
public int DeviceId { get; }
public int MidiDeviceId { get; }
#endregion
@ -54,7 +57,7 @@ namespace RGB.NET.Devices.Novation
{
this.DeviceType = deviceType;
this.Model = model;
this.DeviceId = deviceId;
this.MidiDeviceId = deviceId;
this.ColorCapabilities = colorCapabilities;
}

View File

@ -42,7 +42,7 @@ namespace RGB.NET.Devices.Razer
protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Custom1;
/// <inheritdoc />
protected override RazerUpdateQueue CreateUpdateQueue(IDeviceUpdateTrigger updateTrigger) => new RazerChromaLinkUpdateQueue(updateTrigger, DeviceInfo.DeviceId);
protected override RazerUpdateQueue CreateUpdateQueue(IDeviceUpdateTrigger updateTrigger) => new RazerChromaLinkUpdateQueue(updateTrigger, DeviceInfo.RazerDeviceId);
#endregion
}

View File

@ -11,10 +11,13 @@ namespace RGB.NET.Devices.Razer
{
#region Properties & Fields
/// <inheritdoc />
public object DeviceId => RazerDeviceId;
/// <summary>
/// Gets the Id of the <see cref="RazerRGBDevice{TDeviceInfo}"/>.
/// </summary>
public Guid DeviceId { get; }
public Guid RazerDeviceId { get; }
/// <inheritdoc />
public RGBDeviceType DeviceType { get; }
@ -46,7 +49,7 @@ namespace RGB.NET.Devices.Razer
/// <param name="model">The model of the <see cref="IRGBDevice"/>.</param>
internal RazerRGBDeviceInfo(Guid deviceId, RGBDeviceType deviceType, string model)
{
this.DeviceId = deviceId;
this.RazerDeviceId = deviceId;
this.DeviceType = deviceType;
this.Model = model;
}

View File

@ -42,7 +42,7 @@ namespace RGB.NET.Devices.Razer
protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Headset1;
/// <inheritdoc />
protected override RazerUpdateQueue CreateUpdateQueue(IDeviceUpdateTrigger updateTrigger) => new RazerHeadsetUpdateQueue(updateTrigger, DeviceInfo.DeviceId);
protected override RazerUpdateQueue CreateUpdateQueue(IDeviceUpdateTrigger updateTrigger) => new RazerHeadsetUpdateQueue(updateTrigger, DeviceInfo.RazerDeviceId);
#endregion
}

View File

@ -48,7 +48,7 @@ namespace RGB.NET.Devices.Razer
protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Keyboard_Escape;
/// <inheritdoc />
protected override RazerUpdateQueue CreateUpdateQueue(IDeviceUpdateTrigger updateTrigger) => new RazerKeyboardUpdateQueue(updateTrigger, DeviceInfo.DeviceId);
protected override RazerUpdateQueue CreateUpdateQueue(IDeviceUpdateTrigger updateTrigger) => new RazerKeyboardUpdateQueue(updateTrigger, DeviceInfo.RazerDeviceId);
#endregion
}

View File

@ -45,7 +45,7 @@ namespace RGB.NET.Devices.Razer
protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Keypad1;
/// <inheritdoc />
protected override RazerUpdateQueue CreateUpdateQueue(IDeviceUpdateTrigger updateTrigger) => new RazerKeypadUpdateQueue(updateTrigger, DeviceInfo.DeviceId);
protected override RazerUpdateQueue CreateUpdateQueue(IDeviceUpdateTrigger updateTrigger) => new RazerKeypadUpdateQueue(updateTrigger, DeviceInfo.RazerDeviceId);
#endregion
}

View File

@ -45,7 +45,7 @@ namespace RGB.NET.Devices.Razer
protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Mouse1;
/// <inheritdoc />
protected override RazerUpdateQueue CreateUpdateQueue(IDeviceUpdateTrigger updateTrigger) => new RazerMouseUpdateQueue(updateTrigger, DeviceInfo.DeviceId);
protected override RazerUpdateQueue CreateUpdateQueue(IDeviceUpdateTrigger updateTrigger) => new RazerMouseUpdateQueue(updateTrigger, DeviceInfo.RazerDeviceId);
#endregion
}

View File

@ -42,7 +42,7 @@ namespace RGB.NET.Devices.Razer
protected override object CreateLedCustomData(LedId ledId) => (int)ledId - (int)LedId.Mousepad1;
/// <inheritdoc />
protected override RazerUpdateQueue CreateUpdateQueue(IDeviceUpdateTrigger updateTrigger) => new RazerMousepadUpdateQueue(updateTrigger, DeviceInfo.DeviceId);
protected override RazerUpdateQueue CreateUpdateQueue(IDeviceUpdateTrigger updateTrigger) => new RazerMousepadUpdateQueue(updateTrigger, DeviceInfo.RazerDeviceId);
#endregion
}

View File

@ -11,6 +11,9 @@ namespace RGB.NET.Devices.SoIP.Client
{
#region Properties & Fields
/// <inheritdoc />
public object DeviceId => $"{Hostname}:{Port}";
/// <inheritdoc />
public RGBDeviceType DeviceType => RGBDeviceType.Unknown;

View File

@ -11,6 +11,9 @@ namespace RGB.NET.Devices.SoIP.Server
{
#region Properties & Fields
/// <inheritdoc />
public object DeviceId => Port;
/// <inheritdoc />
public RGBDeviceType DeviceType => RGBDeviceType.Unknown;