Updated CUE.NET

This commit is contained in:
SpoinkyNL committed 2016-09-11 19:39:25 +02:00
1 parent ac0c7a2dd8
commit 61be5359d5
11 files changed
+85 -82

No files matched your search

+5 -5
View File
@@ -151,9 +151,9 @@
<HintPath>..\packages\Colore.5.0.0\lib\net35\Corale.Colore.dll</HintPath> <HintPath>..\packages\Colore.5.0.0\lib\net35\Corale.Colore.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="CUE.NET, Version=1.0.3.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="CUE.NET, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\CUE.NET.1.1.0\lib\net45\CUE.NET.dll</HintPath>
<HintPath>lib\CUE.NET.dll</HintPath> <Private>True</Private>
</Reference> </Reference>
<Reference Include="DeltaCompressionDotNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d14d6e5194e7f4a, processorArchitecture=MSIL"> <Reference Include="DeltaCompressionDotNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d14d6e5194e7f4a, processorArchitecture=MSIL">
<HintPath>..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.dll</HintPath> <HintPath>..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.dll</HintPath>
@@ -888,12 +888,12 @@
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\CUE.NET.1.0.3\build\net45\CUE.NET.targets" Condition="Exists('..\packages\CUE.NET.1.0.3\build\net45\CUE.NET.targets')" /> <Import Project="..\packages\CUE.NET.1.1.0\build\net45\CUE.NET.targets" Condition="Exists('..\packages\CUE.NET.1.1.0\build\net45\CUE.NET.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\CUE.NET.1.0.3\build\net45\CUE.NET.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CUE.NET.1.0.3\build\net45\CUE.NET.targets'))" /> <Error Condition="!Exists('..\packages\CUE.NET.1.1.0\build\net45\CUE.NET.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CUE.NET.1.1.0\build\net45\CUE.NET.targets'))" />
</Target> </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
@@ -27,7 +27,7 @@ namespace Artemis.DeviceProviders.Corsair
Logger.Debug("Attempted to enable Corsair headset. CanUse: {0}", CanUse); Logger.Debug("Attempted to enable Corsair headset. CanUse: {0}", CanUse);
if (CanUse) if (CanUse)
CueSDK.HeadsetSDK.UpdateMode = UpdateMode.Manual; CueSDK.UpdateMode = UpdateMode.Manual;
return CanUse; return CanUse;
} }
@@ -8,9 +8,9 @@ using Artemis.Properties;
using Artemis.Utilities; using Artemis.Utilities;
using CUE.NET; using CUE.NET;
using CUE.NET.Brushes; using CUE.NET.Brushes;
using CUE.NET.Devices.Generic;
using CUE.NET.Devices.Generic.Enums; using CUE.NET.Devices.Generic.Enums;
using CUE.NET.Devices.Keyboard; using CUE.NET.Devices.Keyboard;
using CUE.NET.Devices.Keyboard.Keys;
using Ninject.Extensions.Logging; using Ninject.Extensions.Logging;
using Point = System.Drawing.Point; using Point = System.Drawing.Point;
@@ -121,23 +121,23 @@ namespace Artemis.DeviceProviders.Corsair
public override KeyMatch? GetKeyPosition(Keys keyCode) public override KeyMatch? GetKeyPosition(Keys keyCode)
{ {
var widthMultiplier = Width/_keyboard.KeyboardRectangle.Width; var widthMultiplier = Width/_keyboard.Brush.RenderedRectangle.Width;
var heightMultiplier = Height/_keyboard.KeyboardRectangle.Height; var heightMultiplier = Height/_keyboard.Brush.RenderedRectangle.Height;
CorsairKey cueKey = null; CorsairLed cueLed = null;
try try
{ {
cueKey = _keyboard.Keys.FirstOrDefault(k => k.KeyId.ToString() == keyCode.ToString()) ?? cueLed = _keyboard.Leds.FirstOrDefault(k => k.Id.ToString() == keyCode.ToString()) ??
_keyboard.Keys.FirstOrDefault(k => k.KeyId == KeyMap.FormsKeys[keyCode]); _keyboard.Leds.FirstOrDefault(k => k.Id == KeyMap.FormsKeys[keyCode]);
} }
catch (Exception) catch (Exception)
{ {
// ignored // ignored
} }
if (cueKey != null) if (cueLed != null)
return new KeyMatch(keyCode, (int) (cueKey.KeyRectangle.X*widthMultiplier), return new KeyMatch(keyCode, (int) (cueLed.LedRectangle.X*widthMultiplier),
(int) (cueKey.KeyRectangle.Y*heightMultiplier)); (int) (cueLed.LedRectangle.Y*heightMultiplier));
return null; return null;
} }
@@ -27,7 +27,7 @@ namespace Artemis.DeviceProviders.Corsair
Logger.Debug("Attempted to enable Corsair mice. CanUse: {0}", CanUse); Logger.Debug("Attempted to enable Corsair mice. CanUse: {0}", CanUse);
if (CanUse) if (CanUse)
CueSDK.MouseSDK.UpdateMode = UpdateMode.Manual; CueSDK.UpdateMode = UpdateMode.Manual;
return CanUse; return CanUse;
} }
@@ -28,7 +28,7 @@ namespace Artemis.DeviceProviders.Corsair
Logger.Debug("Attempted to enable Corsair mousemat. CanUse: {0}", CanUse); Logger.Debug("Attempted to enable Corsair mousemat. CanUse: {0}", CanUse);
if (CanUse) if (CanUse)
CueSDK.MousematSDK.UpdateMode = UpdateMode.Manual; CueSDK.UpdateMode = UpdateMode.Manual;
return CanUse; return CanUse;
} }
@@ -68,15 +68,15 @@ namespace Artemis.DeviceProviders.Corsair
{ {
// Start at index 1 because the corner belongs to the left side // Start at index 1 because the corner belongs to the left side
var zoneIndex = ledIndex - 4; var zoneIndex = ledIndex - 4;
col = bitmap.GetPixel((int) (zoneIndex*xStep), 39); col = bitmap.GetPixel((int) (zoneIndex*xStep), bitmap.Height - 1);
} }
// Right side // Right side
else else
{ {
var zoneIndex = ledIndex - 10; var zoneIndex = ledIndex - 10;
col = zoneIndex == 4 col = zoneIndex == 4
? bitmap.GetPixel(39, 40 - (int) (zoneIndex*yStep)) ? bitmap.GetPixel(bitmap.Height - 1, bitmap.Height - (int) (zoneIndex*yStep))
: bitmap.GetPixel(39, 39 - (int) (zoneIndex*yStep)); : bitmap.GetPixel(bitmap.Height - 1, bitmap.Height - 1 - (int) (zoneIndex*yStep));
} }
corsairLed.Color = col; corsairLed.Color = col;
@@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows.Forms; using System.Windows.Forms;
using CUE.NET.Devices.Keyboard.Enums; using CUE.NET.Devices.Generic.Enums;
namespace Artemis.DeviceProviders.Corsair.Utilities namespace Artemis.DeviceProviders.Corsair.Utilities
{ {
@@ -8,64 +8,64 @@ namespace Artemis.DeviceProviders.Corsair.Utilities
{ {
static KeyMap() static KeyMap()
{ {
FormsKeys = new Dictionary<Keys, CorsairKeyboardKeyId> FormsKeys = new Dictionary<Keys, CorsairLedId>
{ {
{Keys.Scroll, CorsairKeyboardKeyId.ScrollLock}, {Keys.Scroll, CorsairLedId.ScrollLock},
{Keys.Pause, CorsairKeyboardKeyId.PauseBreak}, {Keys.Pause, CorsairLedId.PauseBreak},
{Keys.Back, CorsairKeyboardKeyId.Backspace}, {Keys.Back, CorsairLedId.Backspace},
{Keys.Oemtilde, CorsairKeyboardKeyId.GraveAccentAndTilde}, {Keys.Oemtilde, CorsairLedId.GraveAccentAndTilde},
{Keys.OemMinus, CorsairKeyboardKeyId.MinusAndUnderscore}, {Keys.OemMinus, CorsairLedId.MinusAndUnderscore},
{Keys.Oemplus, CorsairKeyboardKeyId.EqualsAndPlus}, {Keys.Oemplus, CorsairLedId.EqualsAndPlus},
{Keys.OemOpenBrackets, CorsairKeyboardKeyId.BracketLeft}, {Keys.OemOpenBrackets, CorsairLedId.BracketLeft},
{Keys.Oem6, CorsairKeyboardKeyId.BracketRight}, {Keys.Oem6, CorsairLedId.BracketRight},
{Keys.Return, CorsairKeyboardKeyId.Enter}, {Keys.Return, CorsairLedId.Enter},
{Keys.Next, CorsairKeyboardKeyId.PageDown}, {Keys.Next, CorsairLedId.PageDown},
{Keys.Capital, CorsairKeyboardKeyId.CapsLock}, {Keys.Capital, CorsairLedId.CapsLock},
{Keys.Oem1, CorsairKeyboardKeyId.SemicolonAndColon}, {Keys.Oem1, CorsairLedId.SemicolonAndColon},
{Keys.Oem7, CorsairKeyboardKeyId.ApostropheAndDoubleQuote}, {Keys.Oem7, CorsairLedId.ApostropheAndDoubleQuote},
{Keys.OemBackslash, CorsairKeyboardKeyId.Backslash}, {Keys.OemBackslash, CorsairLedId.Backslash},
{Keys.LShiftKey, CorsairKeyboardKeyId.LeftShift}, {Keys.LShiftKey, CorsairLedId.LeftShift},
{Keys.Oem5, CorsairKeyboardKeyId.NonUsBackslash}, {Keys.Oem5, CorsairLedId.NonUsBackslash},
{Keys.Oemcomma, CorsairKeyboardKeyId.CommaAndLessThan}, {Keys.Oemcomma, CorsairLedId.CommaAndLessThan},
{Keys.OemPeriod, CorsairKeyboardKeyId.PeriodAndBiggerThan}, {Keys.OemPeriod, CorsairLedId.PeriodAndBiggerThan},
{Keys.OemQuestion, CorsairKeyboardKeyId.SlashAndQuestionMark}, {Keys.OemQuestion, CorsairLedId.SlashAndQuestionMark},
{Keys.RShiftKey, CorsairKeyboardKeyId.RightShift}, {Keys.RShiftKey, CorsairLedId.RightShift},
{Keys.LControlKey, CorsairKeyboardKeyId.LeftCtrl}, {Keys.LControlKey, CorsairLedId.LeftCtrl},
{Keys.LWin, CorsairKeyboardKeyId.LeftGui}, {Keys.LWin, CorsairLedId.LeftGui},
{Keys.LMenu, CorsairKeyboardKeyId.LeftAlt}, {Keys.LMenu, CorsairLedId.LeftAlt},
{Keys.RMenu, CorsairKeyboardKeyId.RightAlt}, {Keys.RMenu, CorsairLedId.RightAlt},
{Keys.RWin, CorsairKeyboardKeyId.RightGui}, {Keys.RWin, CorsairLedId.RightGui},
{Keys.Apps, CorsairKeyboardKeyId.Application}, {Keys.Apps, CorsairLedId.Application},
{Keys.RControlKey, CorsairKeyboardKeyId.RightCtrl}, {Keys.RControlKey, CorsairLedId.RightCtrl},
{Keys.Left, CorsairKeyboardKeyId.LeftArrow}, {Keys.Left, CorsairLedId.LeftArrow},
{Keys.Down, CorsairKeyboardKeyId.DownArrow}, {Keys.Down, CorsairLedId.DownArrow},
{Keys.Right, CorsairKeyboardKeyId.RightArrow}, {Keys.Right, CorsairLedId.RightArrow},
{Keys.Up, CorsairKeyboardKeyId.UpArrow}, {Keys.Up, CorsairLedId.UpArrow},
{Keys.NumPad0, CorsairKeyboardKeyId.Keypad0}, {Keys.NumPad0, CorsairLedId.Keypad0},
{Keys.NumPad1, CorsairKeyboardKeyId.Keypad1}, {Keys.NumPad1, CorsairLedId.Keypad1},
{Keys.NumPad2, CorsairKeyboardKeyId.Keypad2}, {Keys.NumPad2, CorsairLedId.Keypad2},
{Keys.NumPad3, CorsairKeyboardKeyId.Keypad3}, {Keys.NumPad3, CorsairLedId.Keypad3},
{Keys.NumPad4, CorsairKeyboardKeyId.Keypad4}, {Keys.NumPad4, CorsairLedId.Keypad4},
{Keys.NumPad5, CorsairKeyboardKeyId.Keypad5}, {Keys.NumPad5, CorsairLedId.Keypad5},
{Keys.NumPad6, CorsairKeyboardKeyId.Keypad6}, {Keys.NumPad6, CorsairLedId.Keypad6},
{Keys.NumPad7, CorsairKeyboardKeyId.Keypad7}, {Keys.NumPad7, CorsairLedId.Keypad7},
{Keys.NumPad8, CorsairKeyboardKeyId.Keypad8}, {Keys.NumPad8, CorsairLedId.Keypad8},
{Keys.NumPad9, CorsairKeyboardKeyId.Keypad9}, {Keys.NumPad9, CorsairLedId.Keypad9},
{Keys.Divide, CorsairKeyboardKeyId.KeypadSlash}, {Keys.Divide, CorsairLedId.KeypadSlash},
{Keys.Multiply, CorsairKeyboardKeyId.KeypadAsterisk}, {Keys.Multiply, CorsairLedId.KeypadAsterisk},
{Keys.Subtract, CorsairKeyboardKeyId.KeypadMinus}, {Keys.Subtract, CorsairLedId.KeypadMinus},
{Keys.Add, CorsairKeyboardKeyId.KeypadPlus}, {Keys.Add, CorsairLedId.KeypadPlus},
{Keys.Decimal, CorsairKeyboardKeyId.KeypadPeriodAndDelete}, {Keys.Decimal, CorsairLedId.KeypadPeriodAndDelete},
{Keys.MediaStop, CorsairKeyboardKeyId.Stop}, {Keys.MediaStop, CorsairLedId.Stop},
{Keys.MediaPreviousTrack, CorsairKeyboardKeyId.ScanPreviousTrack}, {Keys.MediaPreviousTrack, CorsairLedId.ScanPreviousTrack},
{Keys.MediaNextTrack, CorsairKeyboardKeyId.ScanNextTrack}, {Keys.MediaNextTrack, CorsairLedId.ScanNextTrack},
{Keys.MediaPlayPause, CorsairKeyboardKeyId.PlayPause}, {Keys.MediaPlayPause, CorsairLedId.PlayPause},
{Keys.VolumeMute, CorsairKeyboardKeyId.Mute}, {Keys.VolumeMute, CorsairLedId.Mute},
{Keys.VolumeUp, CorsairKeyboardKeyId.VolumeUp}, {Keys.VolumeUp, CorsairLedId.VolumeUp},
{Keys.VolumeDown, CorsairKeyboardKeyId.VolumeDown} {Keys.VolumeDown, CorsairLedId.VolumeDown}
}; };
} }
public static Dictionary<Keys, CorsairKeyboardKeyId> FormsKeys { get; set; } public static Dictionary<Keys, CorsairLedId> FormsKeys { get; set; }
} }
} }
@@ -28,7 +28,7 @@
<Label FontSize="20" HorizontalAlignment="Left"> <Label FontSize="20" HorizontalAlignment="Left">
<Label.Content> <Label.Content>
<AccessText TextWrapping="Wrap" <AccessText TextWrapping="Wrap"
Text="For Azeroth" /> Text="Fight The Burning Legion in style with reactive lighting" />
</Label.Content> </Label.Content>
</Label> </Label>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
@@ -8,8 +8,11 @@ namespace Artemis.Profiles.Layers.Conditions
public class DataModelCondition : ILayerCondition public class DataModelCondition : ILayerCondition
{ {
public bool ConditionsMet(LayerModel layer, IDataModel dataModel) public bool ConditionsMet(LayerModel layer, IDataModel dataModel)
{
lock (layer.Properties.Conditions)
{ {
return layer.Properties.Conditions.All(cm => cm.ConditionMet(dataModel)); return layer.Properties.Conditions.All(cm => cm.ConditionMet(dataModel));
} }
} }
} }
}
@@ -21,7 +21,7 @@
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- Left --> <!-- Left -->
<ComboBox x:Name="DataModelProps" Grid.Column="0" Width="210" MaxDropDownHeight="125" <ComboBox x:Name="DataModelProps" Grid.Column="0" Width="210" MaxDropDownHeight="400"
HorizontalAlignment="Center" VerticalAlignment="Top"> HorizontalAlignment="Center" VerticalAlignment="Top">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
@@ -31,11 +31,11 @@
<TextBlock x:Name="Name" Grid.Column="0" Margin="10" FontSize="13.333" VerticalAlignment="Center" Height="18" /> <TextBlock x:Name="Name" Grid.Column="0" Margin="10" FontSize="13.333" VerticalAlignment="Center" Height="18" />
<!-- Target property --> <!-- Target property -->
<ComboBox x:Name="Targets" Grid.Column="1" Margin="10,0" MaxDropDownHeight="125" VerticalAlignment="Center" <ComboBox x:Name="Targets" Grid.Column="1" Margin="10,0" MaxDropDownHeight="300" VerticalAlignment="Center"
Height="22"> Height="22">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid MinWidth="435"> <Grid MinWidth="482">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
@@ -62,7 +62,7 @@
<!-- PercentageOfProperty --> <!-- PercentageOfProperty -->
<StackPanel Grid.Column="3" x:Name="SourcesIsVisible" VerticalAlignment="Center"> <StackPanel Grid.Column="3" x:Name="SourcesIsVisible" VerticalAlignment="Center">
<ComboBox x:Name="Sources" Margin="10,0" MaxDropDownHeight="125" Height="22" <ComboBox x:Name="Sources" Margin="10,0" MaxDropDownHeight="300" Height="22"
IsEnabled="{Binding Path=ControlsEnabled}"> IsEnabled="{Binding Path=ControlsEnabled}">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
+1 -1
View File
@@ -4,7 +4,7 @@
<package id="Caliburn.Micro.Core" version="3.0.1" targetFramework="net452" /> <package id="Caliburn.Micro.Core" version="3.0.1" targetFramework="net452" />
<package id="Castle.Core" version="3.3.3" targetFramework="net452" /> <package id="Castle.Core" version="3.3.3" targetFramework="net452" />
<package id="Colore" version="5.0.0" targetFramework="net461" /> <package id="Colore" version="5.0.0" targetFramework="net461" />
<package id="CUE.NET" version="1.0.3" targetFramework="net452" /> <package id="CUE.NET" version="1.1.0" targetFramework="net461" />
<package id="DeltaCompressionDotNet" version="1.0.0" targetFramework="net461" /> <package id="DeltaCompressionDotNet" version="1.0.0" targetFramework="net461" />
<package id="DynamicExpresso.Core" version="1.3.1.0" targetFramework="net452" /> <package id="DynamicExpresso.Core" version="1.3.1.0" targetFramework="net452" />
<package id="Extended.Wpf.Toolkit" version="2.9" targetFramework="net461" /> <package id="Extended.Wpf.Toolkit" version="2.9" targetFramework="net461" />