Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #25 from akmadian/develop
Browse files Browse the repository at this point in the history
v2.0.0-preview2 Merge
  • Loading branch information
Ari Madian authored Feb 23, 2019
2 parents 845b9ee + 7d4a8ac commit da9b995
Show file tree
Hide file tree
Showing 25 changed files with 1,659 additions and 101 deletions.
9 changes: 5 additions & 4 deletions NZXTSharp/COM/USB/DeviceEnumerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using System.Collections.Generic;
using System.Text;

using HidLibrary;
using NZXTSharp;

namespace NZXTSharp.COM
{
Expand All @@ -10,7 +12,6 @@ namespace NZXTSharp.COM
/// </summary>
class DeviceEnumerator
{
/*
public static IEnumerable<HidDevice> EnumAllDevices()
{
return HidDevices.Enumerate();
Expand All @@ -25,7 +26,7 @@ public static IEnumerable<HidDevice> EnumKrakenMDevices()
{
foreach (var device in EnumNZXTDevices())
{
if (device.Attributes.ProductId == (int)SerialDeviceID.KrakenM)
if (device.Attributes.ProductId == (int)HIDDeviceID.KrakenM)
{
yield return device;
}
Expand All @@ -36,11 +37,11 @@ public static IEnumerable<HidDevice> EnumKrakenXDevices()
{
foreach (var device in EnumNZXTDevices())
{
if (device.Attributes.ProductId == (int)SerialDeviceID.KrakenX)
if (device.Attributes.ProductId == (int)HIDDeviceID.KrakenX)
{
yield return device;
}
}
}*/
}
}
}
2 changes: 1 addition & 1 deletion NZXTSharp/COM/USB/USBController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal class USBController
private NZXTDeviceType _Type;
private HIDDeviceID _ID;
private int CurrProductID;
private HIDDeviceID _VendorID = HIDDeviceID.ManufacturerID;
private HIDDeviceID _VendorID = HIDDeviceID.VendorID;
private HidReport _LastReport;
private bool _IsAttached = false;
private HidDevice _Device;
Expand Down
11 changes: 10 additions & 1 deletion NZXTSharp/Core/Common/Effects/Alternating.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using NZXTSharp;
using NZXTSharp.HuePlus;
using NZXTSharp.KrakenX;
using NZXTSharp.Exceptions;

namespace NZXTSharp
Expand Down Expand Up @@ -101,7 +102,15 @@ public List<byte[]> BuildBytes(NZXTDeviceType Type, IChannel Channel) {
}
return outList;
case NZXTDeviceType.KrakenX:
// TODO
DCBWM direction = new DCBWM(Channel.ChannelByte, _Param1.IsForward, _Param1.WithMovement);
List<byte[]> KrakenXOutList = new List<byte[]>();
for (int colorIndex = 0; colorIndex < Colors.Length; colorIndex++)
{
byte[] KrakenXSettingsBytes = new byte[] { 0x42, 0x4c, direction, 0x05, new CISS(colorIndex) };
byte[] final = KrakenXSettingsBytes.ConcatenateByteArr(Channel.BuildColorBytes(Colors[colorIndex]));
KrakenXOutList.Add(final);
}
return KrakenXOutList;
default:
return null;
}
Expand Down
4 changes: 4 additions & 0 deletions NZXTSharp/Core/Common/Effects/Fading.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ public class Fading : IEffect {
/// The array of colors used by the effect.
/// </summary>
private Color[] DefaultColors = new Color[] { new Color(255, 0, 0), new Color(0, 255, 0), new Color(0, 0, 255) };

/// <summary>
/// The colors that the effect will apply.
/// </summary>
public Color[] Colors;

private CISS Param2;
Expand Down
3 changes: 2 additions & 1 deletion NZXTSharp/Core/Common/Effects/IEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public interface IEffect {
/// <summary>
/// Builds and returns the buffer queue needed to set the <see cref="IEffect"/>.
/// </summary>
/// <param name="Channel"></param>
/// <param name="Type">The <see cref="NZXTDeviceType"/> to build effect bytes for.</param>
/// <param name="Channel">The <see cref="IChannel"/> to build effect bytes for.</param>
/// <returns></returns>
List<byte[]> BuildBytes(NZXTDeviceType Type, IChannel Channel);
}
Expand Down
2 changes: 1 addition & 1 deletion NZXTSharp/Core/Common/Effects/SpectrumWave.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public List<byte[]> BuildBytes(NZXTDeviceType Type, IChannel Channel) {
return new List<byte[]>() { final };
case NZXTDeviceType.KrakenX:
DCB param = new DCB(Channel.ChannelByte, Param1.IsForward);
byte[] KrakenSettingsBytes = new byte[] { 0x42, 0x4c, param, 0x02, (byte)speed };
byte[] KrakenSettingsBytes = new byte[] { 0x42, 0x4c, (byte)param.GetValue(), 0x02, (byte)speed };
byte[] KrakenFinal = KrakenSettingsBytes.ConcatenateByteArr(Channel.BuildColorBytes(new Color(0, 0, 255)));
return new List<byte[]>() { KrakenFinal };
default:
Expand Down
Loading

0 comments on commit da9b995

Please sign in to comment.