mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2026-11-10 20:46:24 +00:00
Added support for mouse and headset devices. This *should* work out of the box but needs to be tested.
This commit is contained in:
1 parent
0f402a6ecd
commit
57ad0f30e2
3 files changed
+122
-14
No files matched your search
@@ -1,29 +1,70 @@
|
||||
using CUE.NET.Devices.Generic;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using CUE.NET.Devices.Generic;
|
||||
using CUE.NET.Devices.Headset.Enums;
|
||||
|
||||
namespace CUE.NET.Devices.Headset
|
||||
{
|
||||
//TODO DarthAffe 20.09.2015: Find someone to test this
|
||||
/// <summary>
|
||||
/// Stub for planned headset-support.
|
||||
/// </summary>
|
||||
public class CorsairHeadset : AbstractCueDevice
|
||||
public class CorsairHeadset : AbstractCueDevice, IEnumerable<CorsairLed>
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
#region Indexer
|
||||
|
||||
public CorsairLed this[CorsairHeadsetLedId ledId]
|
||||
{
|
||||
get
|
||||
{
|
||||
CorsairLed led;
|
||||
return base.Leds.TryGetValue((int)ledId, out led) ? led : null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public CorsairHeadsetDeviceInfo HeadsetDeviceInfo { get; }
|
||||
|
||||
protected override bool HasEffect => false;
|
||||
|
||||
public new IEnumerable<CorsairLed> Leds => new ReadOnlyCollection<CorsairLed>(base.Leds.Values.ToList());
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
internal CorsairHeadset(CorsairHeadsetDeviceInfo info)
|
||||
: base(info)
|
||||
{ }
|
||||
{
|
||||
this.HeadsetDeviceInfo = info;
|
||||
InitializeLeds();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
private void InitializeLeds()
|
||||
{
|
||||
GetLed((int)CorsairHeadsetLedId.LeftLogo);
|
||||
GetLed((int)CorsairHeadsetLedId.RightLogo);
|
||||
}
|
||||
|
||||
#region IEnumerable
|
||||
|
||||
public IEnumerator<CorsairLed> GetEnumerator()
|
||||
{
|
||||
return Leds.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user