mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Spotify fixes and project cleanup
This commit is contained in:
parent
390e93b6b6
commit
a9aa9f4df6
@ -2,22 +2,56 @@
|
||||
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<section name="Artemis.Modules.Games.Overwatch.Overwatch" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.TheDivision.TheDivision" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.Dota2.Dota2" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Overlays.VolumeDisplay.VolumeDisplay" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.RocketLeague.RocketLeague" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.Offsets" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.Witcher3.Witcher3" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Effects.AudioVisualizer.AudioVisualization" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.CounterStrike.CounterStrike" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.CounterStrike" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.AudioVisualization" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.RocketLeague" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.TypeWave" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.General" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<sectionGroup name="userSettings"
|
||||
type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<section name="Artemis.Modules.Effects.WindowsProfile.WindowsProfile"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.Overwatch.Overwatch"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.TheDivision.TheDivision"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.Dota2.Dota2"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Overlays.VolumeDisplay.VolumeDisplay"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.RocketLeague.RocketLeague"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.Offsets"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.Witcher3.Witcher3"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Effects.AudioVisualizer.AudioVisualization"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.CounterStrike.CounterStrike"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.CounterStrike"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.AudioVisualization"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.RocketLeague"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Properties.Settings"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.TypeWave"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.General"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<connectionStrings />
|
||||
@ -25,6 +59,11 @@
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
<userSettings>
|
||||
<Artemis.Modules.Effects.WindowsProfile.WindowsProfile>
|
||||
<setting name="LastProfile" serializeAs="String">
|
||||
<value>Demo (Duplicate to keep changes)</value>
|
||||
</setting>
|
||||
</Artemis.Modules.Effects.WindowsProfile.WindowsProfile>
|
||||
<Artemis.Modules.Games.Overwatch.Overwatch>
|
||||
<setting name="Enabled" serializeAs="String">
|
||||
<value>True</value>
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
using System.Security.Principal;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
using Artemis.Utilities;
|
||||
using NLog;
|
||||
using WpfExceptionViewer;
|
||||
|
||||
@ -21,6 +20,8 @@ namespace Artemis
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public bool DoHandle { get; set; }
|
||||
|
||||
private static bool IsRunAsAdministrator()
|
||||
{
|
||||
var wi = WindowsIdentity.GetCurrent();
|
||||
@ -29,8 +30,6 @@ namespace Artemis
|
||||
return wp.IsInRole(WindowsBuiltInRole.Administrator);
|
||||
}
|
||||
|
||||
public bool DoHandle { get; set; }
|
||||
|
||||
private void Application_Startup(object sender, StartupEventArgs e)
|
||||
{
|
||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||
|
||||
@ -219,6 +219,8 @@
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.IO.Compression.FileSystem" />
|
||||
<Reference Include="System.Linq.Dynamic, Version=1.0.5840.25917, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Linq.Dynamic.1.0.6\lib\net40\System.Linq.Dynamic.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@ -339,6 +341,12 @@
|
||||
<Compile Include="Modules\Effects\AudioVisualizer\AudioVisualizerModel.cs" />
|
||||
<Compile Include="Modules\Effects\AudioVisualizer\Utilities\FftEventArgs.cs" />
|
||||
<Compile Include="Modules\Effects\AudioVisualizer\Utilities\SampleAggregator.cs" />
|
||||
<Compile Include="Modules\Effects\WindowsProfile\WindowsProfile.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<DependentUpon>WindowsProfile.settings</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Modules\Effects\WindowsProfile\WindowsProfileSettings.cs" />
|
||||
<Compile Include="Modules\Effects\WindowsProfile\WindowsProfileView.xaml.cs">
|
||||
<DependentUpon>WindowsProfileView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@ -583,6 +591,10 @@
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>TypeWave.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Modules\Effects\WindowsProfile\WindowsProfile.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>WindowsProfile.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Modules\Games\CounterStrike\CounterStrike.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>CounterStrike.Designer.cs</LastGenOutput>
|
||||
@ -644,6 +656,7 @@
|
||||
<Resource Include="Resources\Entypo-license.txt" />
|
||||
<None Include="Resources\RzChromaSDK64.dll" />
|
||||
<Resource Include="Resources\Keyboards\blackwidow.png" />
|
||||
<None Include="Resources\Keyboards\none.png" />
|
||||
<Content Include="Resources\Witcher3\playerWitcher.txt" />
|
||||
<Content Include="Resources\Witcher3\artemis.txt" />
|
||||
<None Include="Settings\Offsets.settings">
|
||||
|
||||
@ -1,22 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Xml.Serialization;
|
||||
using Artemis.DeviceProviders;
|
||||
using Artemis.Models;
|
||||
using Artemis.Models.Profiles;
|
||||
using Artemis.Utilities;
|
||||
using NLog;
|
||||
|
||||
namespace Artemis.DAL
|
||||
{
|
||||
public static class ProfileProvider
|
||||
{
|
||||
private static readonly Logger _logger = LogManager.GetCurrentClassLogger();
|
||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private static readonly string ProfileFolder =
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Artemis\profiles";
|
||||
private static readonly string ProfileFolder = Environment
|
||||
.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Artemis\profiles";
|
||||
|
||||
private static bool _installedDefaults;
|
||||
|
||||
/// <summary>
|
||||
/// Get all profiles
|
||||
@ -93,7 +97,7 @@ namespace Artemis.DAL
|
||||
}
|
||||
catch (InvalidOperationException e)
|
||||
{
|
||||
_logger.Error("Failed to load profile: {0} - {1}", path, e.InnerException.Message);
|
||||
Logger.Error("Failed to load profile: {0} - {1}", path, e.InnerException.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,13 +109,20 @@ namespace Artemis.DAL
|
||||
/// </summary>
|
||||
private static void InstallDefaults()
|
||||
{
|
||||
var test = Assembly.GetExecutingAssembly().GetManifestResourceNames();
|
||||
//var stream =
|
||||
// Assembly.GetExecutingAssembly()
|
||||
// .GetManifestResourceStream("Artemis.Properties.Resources.logo.jpg");
|
||||
// Only install the defaults once per session
|
||||
if (_installedDefaults)
|
||||
return;
|
||||
_installedDefaults = true;
|
||||
|
||||
//Resources.
|
||||
//ZipPackage.Open(Re.defaultProfiles)
|
||||
// Load the ZIP from resources
|
||||
var stream = Assembly.GetExecutingAssembly()
|
||||
.GetManifestResourceStream("Artemis.Resources.Keyboards.default-profiles.zip");
|
||||
|
||||
// Extract it over the old defaults in case one was updated
|
||||
if (stream == null)
|
||||
return;
|
||||
var archive = new ZipArchive(stream);
|
||||
archive.ExtractToDirectory(ProfileFolder, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -41,12 +41,12 @@ namespace Artemis.DeviceProviders.Corsair
|
||||
return;
|
||||
|
||||
var leds = CueSDK.HeadsetSDK.Leds.Count();
|
||||
var rect = new Rect(new Size(leds * 20, leds * 20));
|
||||
var rect = new Rect(new Size(leds*20, leds*20));
|
||||
|
||||
var visual = new DrawingVisual();
|
||||
using (var c = visual.RenderOpen())
|
||||
c.DrawRectangle(brush, null, rect);
|
||||
var img = ImageUtilities.DrawinVisualToBitmap(visual, rect);
|
||||
var img = ImageUtilities.DrawinVisualToBitmap(visual, rect);
|
||||
|
||||
var ledIndex = 0;
|
||||
// Color each LED according to one of the pixels
|
||||
@ -54,7 +54,7 @@ namespace Artemis.DeviceProviders.Corsair
|
||||
{
|
||||
corsairLed.Color = ledIndex == 0
|
||||
? img.GetPixel(0, 0)
|
||||
: img.GetPixel((ledIndex + 1) * 20 - 1, (ledIndex + 1) * 20 - 1);
|
||||
: img.GetPixel((ledIndex + 1)*20 - 1, (ledIndex + 1)*20 - 1);
|
||||
ledIndex++;
|
||||
}
|
||||
|
||||
|
||||
@ -41,12 +41,12 @@ namespace Artemis.DeviceProviders.Corsair
|
||||
return;
|
||||
|
||||
var leds = CueSDK.MouseSDK.Leds.Count();
|
||||
var rect = new Rect(new Size(leds * 20, leds * 20));
|
||||
var rect = new Rect(new Size(leds*20, leds*20));
|
||||
|
||||
var visual = new DrawingVisual();
|
||||
using (var c = visual.RenderOpen())
|
||||
c.DrawRectangle(brush, null, rect);
|
||||
var img = ImageUtilities.DrawinVisualToBitmap(visual, rect);
|
||||
var img = ImageUtilities.DrawinVisualToBitmap(visual, rect);
|
||||
|
||||
var ledIndex = 0;
|
||||
// Color each LED according to one of the pixels
|
||||
@ -54,7 +54,7 @@ namespace Artemis.DeviceProviders.Corsair
|
||||
{
|
||||
corsairLed.Color = ledIndex == 0
|
||||
? img.GetPixel(0, 0)
|
||||
: img.GetPixel((ledIndex + 1) * 20 - 1, (ledIndex + 1) * 20 - 1);
|
||||
: img.GetPixel((ledIndex + 1)*20 - 1, (ledIndex + 1)*20 - 1);
|
||||
ledIndex++;
|
||||
}
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ namespace Artemis.DeviceProviders.Corsair
|
||||
PreviewSettings = new PreviewSettings(665, 215, new Thickness(0, -5, 0, 0), Resources.strafe);
|
||||
break;
|
||||
}
|
||||
Slug = "corsair-"+_keyboard.DeviceInfo.Model.Replace(' ', '-').ToLower();
|
||||
Slug = "corsair-" + _keyboard.DeviceInfo.Model.Replace(' ', '-').ToLower();
|
||||
_keyboard.Brush = _keyboardBrush ?? (_keyboardBrush = new ImageBrush());
|
||||
}
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using Microsoft.Win32;
|
||||
using Artemis.DeviceProviders.Logitech.Utilities;
|
||||
using Artemis.Properties;
|
||||
using Artemis.Utilities;
|
||||
using Artemis.Utilities.LogitechDll;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Artemis.DeviceProviders.Logitech
|
||||
{
|
||||
@ -28,12 +28,14 @@ namespace Artemis.DeviceProviders.Logitech
|
||||
{
|
||||
//Check to see if VC++ 2012 x64 is installed.
|
||||
|
||||
if (Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Classes\Installer\Dependencies\{ca67548a-5ebe-413a-b50c-4b9ceb6d66c6}") == null)
|
||||
if (
|
||||
Registry.LocalMachine.OpenSubKey(
|
||||
@"SOFTWARE\Classes\Installer\Dependencies\{ca67548a-5ebe-413a-b50c-4b9ceb6d66c6}") == null)
|
||||
{
|
||||
CantEnableText = "Couldn't connect to your Logitech G910.\n" +
|
||||
"The Visual C 2012 Redistributable could not be found, which is required.\n" +
|
||||
"Please download it by going to the following URL:\n\n" +
|
||||
"https://www.microsoft.com/download/confirmation.aspx?id=30679";
|
||||
"The Visual C 2012 Redistributable could not be found, which is required.\n" +
|
||||
"Please download it by going to the following URL:\n\n" +
|
||||
"https://www.microsoft.com/download/confirmation.aspx?id=30679";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Models.Profiles;
|
||||
using Artemis.Services;
|
||||
using Artemis.ViewModels.Profiles;
|
||||
|
||||
namespace Artemis.InjectionFactories
|
||||
|
||||
@ -15,8 +15,8 @@ namespace Artemis.Managers
|
||||
/// </summary>
|
||||
public class EffectManager
|
||||
{
|
||||
private readonly IEventAggregator _events;
|
||||
private readonly DeviceManager _deviceManager;
|
||||
private readonly IEventAggregator _events;
|
||||
private readonly ILogger _logger;
|
||||
private EffectModel _activeEffect;
|
||||
|
||||
@ -107,7 +107,7 @@ namespace Artemis.Managers
|
||||
_logger.Debug("Cancelling effect change, provided game not enabled");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var wasNull = false;
|
||||
if (ActiveEffect == null)
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Timers;
|
||||
@ -19,7 +18,6 @@ namespace Artemis.Managers
|
||||
private readonly IEventAggregator _events;
|
||||
private readonly ILogger _logger;
|
||||
private readonly Timer _loopTimer;
|
||||
private int _fpsCount;
|
||||
|
||||
public LoopManager(ILogger logger, IEventAggregator events, EffectManager effectManager,
|
||||
DeviceManager deviceManager)
|
||||
@ -33,14 +31,6 @@ namespace Artemis.Managers
|
||||
_loopTimer = new Timer(40);
|
||||
_loopTimer.Elapsed += Render;
|
||||
_loopTimer.Start();
|
||||
|
||||
var fpsTimer = new Timer(1000);
|
||||
fpsTimer.Elapsed += delegate
|
||||
{
|
||||
Debug.WriteLine(_fpsCount);
|
||||
_fpsCount = 0;
|
||||
};
|
||||
fpsTimer.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -155,10 +145,7 @@ namespace Artemis.Managers
|
||||
|
||||
// If no bitmap was generated this frame is done
|
||||
if (bitmap == null)
|
||||
{
|
||||
_fpsCount++;
|
||||
return;
|
||||
}
|
||||
|
||||
// Fill the bitmap's background with black to avoid trailing colors on some keyboards
|
||||
var fixedBmp = new Bitmap(bitmap.Width, bitmap.Height);
|
||||
@ -172,8 +159,6 @@ namespace Artemis.Managers
|
||||
|
||||
// Update the keyboard
|
||||
_deviceManager.ActiveKeyboard?.DrawBitmap(bitmap);
|
||||
|
||||
_fpsCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ namespace Artemis.Managers
|
||||
_logger.Info("Intializing MainManager");
|
||||
|
||||
_events = events;
|
||||
|
||||
|
||||
_processTimer = new Timer(1000);
|
||||
_processTimer.Elapsed += ScanProcesses;
|
||||
_processTimer.Start();
|
||||
|
||||
@ -43,7 +43,7 @@ namespace Artemis.Models
|
||||
mouse = null;
|
||||
headset = null;
|
||||
|
||||
if (Profile == null || DataModel == null)
|
||||
if (Profile == null || DataModel == null || MainManager.DeviceManager.ActiveKeyboard == null)
|
||||
return;
|
||||
|
||||
// Get all enabled layers who's conditions are met
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Models.Profiles;
|
||||
|
||||
namespace Artemis.Models
|
||||
{
|
||||
public abstract class GameModel : EffectModel
|
||||
{
|
||||
protected GameModel(MainManager mainManager, GameSettings settings, IDataModel dataModel) : base(mainManager, dataModel)
|
||||
protected GameModel(MainManager mainManager, GameSettings settings, IDataModel dataModel)
|
||||
: base(mainManager, dataModel)
|
||||
{
|
||||
Settings = settings;
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ namespace Artemis.Models.Profiles
|
||||
|
||||
// Update animations
|
||||
AnimationUpdater.UpdateAnimation((KeyboardPropertiesModel) Properties, updateAnimations);
|
||||
|
||||
|
||||
if (LayerType == LayerType.Keyboard)
|
||||
Drawer.Draw(c, (KeyboardPropertiesModel) Properties, appliedProperties);
|
||||
else if (LayerType == LayerType.KeyboardGif)
|
||||
@ -214,22 +214,6 @@ namespace Artemis.Models.Profiles
|
||||
}
|
||||
}
|
||||
|
||||
#region IChildItem<Parent> Members
|
||||
|
||||
LayerModel IChildItem<LayerModel>.Parent
|
||||
{
|
||||
get { return Parent; }
|
||||
set { Parent = value; }
|
||||
}
|
||||
|
||||
ProfileModel IChildItem<ProfileModel>.Parent
|
||||
{
|
||||
get { return Profile; }
|
||||
set { Profile = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Generates a flat list containing all layers that must be rendered on the keyboard,
|
||||
/// the first mouse layer to be rendered and the first headset layer to be rendered
|
||||
@ -240,7 +224,8 @@ namespace Artemis.Models.Profiles
|
||||
/// <param name="includeHeadsets">Whether or not to include headsets in the list</param>
|
||||
/// <param name="ignoreConditions"></param>
|
||||
/// <returns>A flat list containing all layers that must be rendered</returns>
|
||||
public List<LayerModel> GetRenderLayers<T>(IDataModel dataModel, bool includeMice, bool includeHeadsets, bool ignoreConditions = false)
|
||||
public List<LayerModel> GetRenderLayers<T>(IDataModel dataModel, bool includeMice, bool includeHeadsets,
|
||||
bool ignoreConditions = false)
|
||||
{
|
||||
var layers = new List<LayerModel>();
|
||||
foreach (var layerModel in Children.OrderByDescending(c => c.Order))
|
||||
@ -262,6 +247,22 @@ namespace Artemis.Models.Profiles
|
||||
|
||||
return layers;
|
||||
}
|
||||
|
||||
#region IChildItem<Parent> Members
|
||||
|
||||
LayerModel IChildItem<LayerModel>.Parent
|
||||
{
|
||||
get { return Parent; }
|
||||
set { Parent = value; }
|
||||
}
|
||||
|
||||
ProfileModel IChildItem<ProfileModel>.Parent
|
||||
{
|
||||
get { return Profile; }
|
||||
set { Profile = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public enum LayerType
|
||||
|
||||
@ -126,7 +126,8 @@ namespace Artemis.Models.Profiles
|
||||
/// <param name="includeHeadsets">Whether or not to include headsets in the list</param>
|
||||
/// <param name="ignoreConditions"></param>
|
||||
/// <returns>A flat list containing all layers that must be rendered</returns>
|
||||
public List<LayerModel> GetRenderLayers<T>(IDataModel dataModel, bool includeMice, bool includeHeadsets, bool ignoreConditions = false)
|
||||
public List<LayerModel> GetRenderLayers<T>(IDataModel dataModel, bool includeMice, bool includeHeadsets,
|
||||
bool ignoreConditions = false)
|
||||
{
|
||||
var layers = new List<LayerModel>();
|
||||
foreach (var layerModel in Layers.OrderByDescending(l => l.Order))
|
||||
|
||||
@ -63,7 +63,7 @@ namespace Artemis.Models.Profiles.Properties
|
||||
|
||||
private void ApplyWidth(ref AppliedProperties properties, double percentage)
|
||||
{
|
||||
var newWidth = percentage * properties.Width;
|
||||
var newWidth = percentage*properties.Width;
|
||||
var difference = properties.Width - newWidth;
|
||||
properties.Width = newWidth;
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Utilities;
|
||||
|
||||
namespace Artemis.Models.Profiles.Properties
|
||||
{
|
||||
|
||||
@ -2,10 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Xml.Serialization;
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Utilities;
|
||||
|
||||
namespace Artemis.Models.Profiles.Properties
|
||||
{
|
||||
|
||||
@ -2,7 +2,6 @@ using System.Collections.Generic;
|
||||
using System.Windows.Media;
|
||||
using System.Xml.Serialization;
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Utilities;
|
||||
|
||||
namespace Artemis.Models.Profiles.Properties
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@ namespace Artemis.Models.Profiles.Properties
|
||||
{
|
||||
public override AppliedProperties GetAppliedProperties(IDataModel dataModel, bool ignoreDynamic = false)
|
||||
{
|
||||
return new AppliedProperties { Brush = Brush };
|
||||
return new AppliedProperties {Brush = Brush};
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -140,7 +140,7 @@ namespace Artemis.Modules.Effects.AudioVisualizer
|
||||
}
|
||||
_generating = false;
|
||||
}
|
||||
|
||||
|
||||
private void OnDataAvailable(object sender, WaveInEventArgs e)
|
||||
{
|
||||
var buffer = e.Buffer;
|
||||
@ -190,7 +190,8 @@ namespace Artemis.Modules.Effects.AudioVisualizer
|
||||
return null;
|
||||
}
|
||||
|
||||
public override void Render(out Bitmap keyboard, out Brush mouse, out Brush headset, bool renderMice, bool renderHeadsets)
|
||||
public override void Render(out Bitmap keyboard, out Brush mouse, out Brush headset, bool renderMice,
|
||||
bool renderHeadsets)
|
||||
{
|
||||
keyboard = null;
|
||||
mouse = null;
|
||||
|
||||
@ -14,7 +14,7 @@ namespace Artemis.Modules.Effects.AudioVisualizer
|
||||
events.Subscribe(this);
|
||||
|
||||
MainManager.EffectManager.EffectModels.Add(EffectModel);
|
||||
EffectSettings = ((AudioVisualizerModel)EffectModel).Settings;
|
||||
EffectSettings = ((AudioVisualizerModel) EffectModel).Settings;
|
||||
}
|
||||
|
||||
public void Handle(ActiveEffectChanged message)
|
||||
|
||||
@ -35,7 +35,8 @@ namespace Artemis.Modules.Effects.ProfilePreview
|
||||
return Profile.GetRenderLayers<ProfilePreviewDataModel>(DataModel, renderMice, renderHeadsets, true);
|
||||
}
|
||||
|
||||
public override void Render(out Bitmap keyboard, out Brush mouse, out Brush headset, bool renderMice, bool renderHeadsets)
|
||||
public override void Render(out Bitmap keyboard, out Brush mouse, out Brush headset, bool renderMice,
|
||||
bool renderHeadsets)
|
||||
{
|
||||
keyboard = null;
|
||||
mouse = null;
|
||||
@ -48,11 +49,13 @@ namespace Artemis.Modules.Effects.ProfilePreview
|
||||
var renderLayers = GetRenderLayers(renderMice, renderHeadsets);
|
||||
|
||||
// Render the keyboard layer-by-layer
|
||||
keyboard = Profile?.GenerateBitmap(renderLayers, DataModel, MainManager.DeviceManager.ActiveKeyboard.KeyboardRectangle(4), true, true);
|
||||
keyboard = Profile?.GenerateBitmap(renderLayers, DataModel,
|
||||
MainManager.DeviceManager.ActiveKeyboard.KeyboardRectangle(4), true, true);
|
||||
// Render the first enabled mouse (will default to null if renderMice was false)
|
||||
mouse = Profile?.GenerateBrush(renderLayers.LastOrDefault(l => l.LayerType == LayerType.Mouse), DataModel);
|
||||
// Render the first enabled headset (will default to null if renderHeadsets was false)
|
||||
headset = Profile?.GenerateBrush(renderLayers.LastOrDefault(l => l.LayerType == LayerType.Headset), DataModel);
|
||||
headset = Profile?.GenerateBrush(renderLayers.LastOrDefault(l => l.LayerType == LayerType.Headset),
|
||||
DataModel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -98,7 +98,8 @@ namespace Artemis.Modules.Effects.TypeWave
|
||||
return null;
|
||||
}
|
||||
|
||||
public override void Render(out Bitmap keyboard, out Brush mouse, out Brush headset, bool renderMice, bool renderHeadsets)
|
||||
public override void Render(out Bitmap keyboard, out Brush mouse, out Brush headset, bool renderMice,
|
||||
bool renderHeadsets)
|
||||
{
|
||||
keyboard = null;
|
||||
mouse = null;
|
||||
@ -120,7 +121,7 @@ namespace Artemis.Modules.Effects.TypeWave
|
||||
if (_waves[i].Size == 0)
|
||||
continue;
|
||||
var path = new GraphicsPath();
|
||||
path.AddEllipse(_waves[i].Point.X - _waves[i].Size / 2, _waves[i].Point.Y - _waves[i].Size / 2,
|
||||
path.AddEllipse(_waves[i].Point.X - _waves[i].Size/2, _waves[i].Point.Y - _waves[i].Size/2,
|
||||
_waves[i].Size, _waves[i].Size);
|
||||
|
||||
Color fillColor;
|
||||
@ -131,7 +132,7 @@ namespace Artemis.Modules.Effects.TypeWave
|
||||
|
||||
var pthGrBrush = new PathGradientBrush(path)
|
||||
{
|
||||
SurroundColors = new[] { _waves[i].Color },
|
||||
SurroundColors = new[] {_waves[i].Color},
|
||||
CenterColor = fillColor
|
||||
};
|
||||
|
||||
@ -139,8 +140,8 @@ namespace Artemis.Modules.Effects.TypeWave
|
||||
pthGrBrush.FocusScales = new PointF(0.3f, 0.8f);
|
||||
|
||||
g.FillPath(pthGrBrush, path);
|
||||
g.DrawEllipse(new Pen(pthGrBrush, 1), _waves[i].Point.X - _waves[i].Size / 2,
|
||||
_waves[i].Point.Y - _waves[i].Size / 2, _waves[i].Size, _waves[i].Size);
|
||||
g.DrawEllipse(new Pen(pthGrBrush, 1), _waves[i].Point.X - _waves[i].Size/2,
|
||||
_waves[i].Point.Y - _waves[i].Size/2, _waves[i].Size, _waves[i].Size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ namespace Artemis.Modules.Effects.TypeWave
|
||||
events.Subscribe(this);
|
||||
|
||||
MainManager.EffectManager.EffectModels.Add(EffectModel);
|
||||
EffectSettings = ((TypeWaveModel)EffectModel).Settings;
|
||||
EffectSettings = ((TypeWaveModel) EffectModel).Settings;
|
||||
}
|
||||
|
||||
public void Handle(ActiveEffectChanged message)
|
||||
|
||||
38
Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfile.Designer.cs
generated
Normal file
38
Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfile.Designer.cs
generated
Normal file
@ -0,0 +1,38 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Artemis.Modules.Effects.WindowsProfile {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
||||
internal sealed partial class WindowsProfile : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static WindowsProfile defaultInstance = ((WindowsProfile)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new WindowsProfile())));
|
||||
|
||||
public static WindowsProfile Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Demo (Duplicate to keep changes)")]
|
||||
public string LastProfile {
|
||||
get {
|
||||
return ((string)(this["LastProfile"]));
|
||||
}
|
||||
set {
|
||||
this["LastProfile"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
||||
GeneratedClassNamespace="Artemis.Modules.Effects.WindowsProfile" GeneratedClassName="WindowsProfile">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="LastProfile" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">Demo (Duplicate to keep changes)</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
@ -1,18 +1,17 @@
|
||||
using Artemis.Models.Interfaces;
|
||||
using SpotifyAPI.Local.Models;
|
||||
|
||||
namespace Artemis.Modules.Effects.WindowsProfile
|
||||
{
|
||||
public class WindowsProfileDataModel : IDataModel
|
||||
{
|
||||
public CpuDataModel Cpu { get; set; }
|
||||
public Spotify Spotify { get; set; }
|
||||
|
||||
public WindowsProfileDataModel()
|
||||
{
|
||||
Spotify = new Spotify();
|
||||
Cpu = new CpuDataModel();
|
||||
}
|
||||
|
||||
public CpuDataModel Cpu { get; set; }
|
||||
public Spotify Spotify { get; set; }
|
||||
}
|
||||
|
||||
public class CpuDataModel
|
||||
@ -26,6 +25,7 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
public int Core7Usage { get; set; }
|
||||
public int Core8Usage { get; set; }
|
||||
}
|
||||
|
||||
public class Spotify
|
||||
{
|
||||
public bool Running { get; set; }
|
||||
@ -37,5 +37,6 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
public bool Repeat { get; set; }
|
||||
public bool Shuffle { get; set; }
|
||||
public bool Playing { get; set; }
|
||||
public int SongLength { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Models;
|
||||
using Artemis.Models.Profiles;
|
||||
using SpotifyAPI.Local;
|
||||
using SpotifyAPI.Local.Models;
|
||||
|
||||
namespace Artemis.Modules.Effects.WindowsProfile
|
||||
{
|
||||
@ -13,14 +14,14 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
{
|
||||
private List<PerformanceCounter> _cores;
|
||||
private int _cpuFrames;
|
||||
private readonly SpotifyLocalAPI _spotify;
|
||||
private SpotifyLocalAPI _spotify;
|
||||
private bool _spotifySetupBusy;
|
||||
|
||||
public WindowsProfileModel(MainManager mainManager, WindowsProfileSettings settings)
|
||||
: base(mainManager, new WindowsProfileDataModel())
|
||||
{
|
||||
Name = "WindowsProfile";
|
||||
Settings = settings;
|
||||
_spotify = new SpotifyLocalAPI();
|
||||
}
|
||||
|
||||
public WindowsProfileSettings Settings { get; set; }
|
||||
@ -32,19 +33,8 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
|
||||
public override void Enable()
|
||||
{
|
||||
// Setup CPU cores
|
||||
_cores = GetPerformanceCounters();
|
||||
var coreCount = _cores.Count;
|
||||
while (coreCount < 8)
|
||||
{
|
||||
_cores.Add(null);
|
||||
coreCount++;
|
||||
}
|
||||
|
||||
if (SpotifyLocalAPI.IsSpotifyRunning())
|
||||
{
|
||||
_spotify.Connect();
|
||||
}
|
||||
SetupCpu();
|
||||
SetupSpotify();
|
||||
|
||||
Initialized = true;
|
||||
}
|
||||
@ -56,6 +46,19 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
UpdateSpotify(dataModel);
|
||||
}
|
||||
|
||||
#region CPU
|
||||
|
||||
private void SetupCpu()
|
||||
{
|
||||
_cores = GetPerformanceCounters();
|
||||
var coreCount = _cores.Count;
|
||||
while (coreCount < 8)
|
||||
{
|
||||
_cores.Add(null);
|
||||
coreCount++;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateCpu(WindowsProfileDataModel dataModel)
|
||||
{
|
||||
// CPU is only updated every 15 frames, the performance counter gives 0 if updated too often
|
||||
@ -67,26 +70,26 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
|
||||
// Update cores, not ideal but data models don't support lists.
|
||||
if (_cores[0] != null)
|
||||
dataModel.Cpu.Core1Usage = (int)_cores[0].NextValue();
|
||||
dataModel.Cpu.Core1Usage = (int) _cores[0].NextValue();
|
||||
if (_cores[1] != null)
|
||||
dataModel.Cpu.Core2Usage = (int)_cores[1].NextValue();
|
||||
dataModel.Cpu.Core2Usage = (int) _cores[1].NextValue();
|
||||
if (_cores[2] != null)
|
||||
dataModel.Cpu.Core3Usage = (int)_cores[2].NextValue();
|
||||
dataModel.Cpu.Core3Usage = (int) _cores[2].NextValue();
|
||||
if (_cores[3] != null)
|
||||
dataModel.Cpu.Core4Usage = (int)_cores[3].NextValue();
|
||||
dataModel.Cpu.Core4Usage = (int) _cores[3].NextValue();
|
||||
if (_cores[4] != null)
|
||||
dataModel.Cpu.Core5Usage = (int)_cores[4].NextValue();
|
||||
dataModel.Cpu.Core5Usage = (int) _cores[4].NextValue();
|
||||
if (_cores[5] != null)
|
||||
dataModel.Cpu.Core6Usage = (int)_cores[5].NextValue();
|
||||
dataModel.Cpu.Core6Usage = (int) _cores[5].NextValue();
|
||||
if (_cores[6] != null)
|
||||
dataModel.Cpu.Core7Usage = (int)_cores[6].NextValue();
|
||||
dataModel.Cpu.Core7Usage = (int) _cores[6].NextValue();
|
||||
if (_cores[7] != null)
|
||||
dataModel.Cpu.Core8Usage = (int)_cores[7].NextValue();
|
||||
dataModel.Cpu.Core8Usage = (int) _cores[7].NextValue();
|
||||
}
|
||||
|
||||
public override List<LayerModel> GetRenderLayers(bool renderMice, bool renderHeadsets)
|
||||
{
|
||||
return Profile.GetRenderLayers<WindowsProfileDataModel>(DataModel, renderMice, renderHeadsets, true);
|
||||
return Profile.GetRenderLayers<WindowsProfileDataModel>(DataModel, renderMice, renderHeadsets, false);
|
||||
}
|
||||
|
||||
public static List<PerformanceCounter> GetPerformanceCounters()
|
||||
@ -101,29 +104,66 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
return performanceCounters;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Spotify
|
||||
|
||||
public void SetupSpotify()
|
||||
{
|
||||
if (_spotifySetupBusy)
|
||||
return;
|
||||
|
||||
_spotifySetupBusy = true;
|
||||
_spotify = new SpotifyLocalAPI {ListenForEvents = true};
|
||||
_spotify.OnPlayStateChange += UpdateSpotifyPlayState;
|
||||
_spotify.OnTrackChange += UpdateSpotifyTrack;
|
||||
_spotify.OnTrackTimeChange += UpdateSpotifyTrackTime;
|
||||
|
||||
// Connecting can sometimes use a little bit more conviction
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
var tryCount = 0;
|
||||
while (tryCount <= 10)
|
||||
{
|
||||
tryCount++;
|
||||
var connected = _spotify.Connect();
|
||||
if (connected)
|
||||
break;
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
_spotifySetupBusy = false;
|
||||
});
|
||||
}
|
||||
|
||||
public void UpdateSpotify(WindowsProfileDataModel dataModel)
|
||||
{
|
||||
StatusResponse status = _spotify.GetStatus();
|
||||
if (status == null)
|
||||
{
|
||||
dataModel.Spotify.Running = false;
|
||||
return;
|
||||
}
|
||||
if (!dataModel.Spotify.Running && SpotifyLocalAPI.IsSpotifyRunning())
|
||||
SetupSpotify();
|
||||
|
||||
dataModel.Spotify.Running = true;
|
||||
dataModel.Spotify.SpotifyVolume = (int)(status.Volume * 100);
|
||||
dataModel.Spotify.Repeat = status.Repeat;
|
||||
dataModel.Spotify.Shuffle = status.Shuffle;
|
||||
dataModel.Spotify.Playing = status.Playing;
|
||||
|
||||
// Only update track info if not null
|
||||
if (status.Track == null)
|
||||
return;
|
||||
|
||||
dataModel.Spotify.Artist = status.Track.ArtistResource?.Name;
|
||||
dataModel.Spotify.SongName = status.Track.TrackResource?.Name;
|
||||
dataModel.Spotify.SongPercentCompleted = (int)(status.PlayingPosition / status.Track.Length * 100.0);
|
||||
dataModel.Spotify.Album = status.Track.AlbumResource?.Name;
|
||||
dataModel.Spotify.Running = SpotifyLocalAPI.IsSpotifyRunning();
|
||||
}
|
||||
|
||||
private void UpdateSpotifyPlayState(object sender, PlayStateEventArgs e)
|
||||
{
|
||||
((WindowsProfileDataModel) DataModel).Spotify.Playing = e.Playing;
|
||||
}
|
||||
|
||||
private void UpdateSpotifyTrack(object sender, TrackChangeEventArgs e)
|
||||
{
|
||||
var dataModel = (WindowsProfileDataModel) DataModel;
|
||||
dataModel.Spotify.Artist = e.NewTrack.ArtistResource?.Name;
|
||||
dataModel.Spotify.SongName = e.NewTrack.TrackResource?.Name;
|
||||
dataModel.Spotify.Album = e.NewTrack.AlbumResource?.Name;
|
||||
dataModel.Spotify.SongLength = e.NewTrack.Length;
|
||||
}
|
||||
|
||||
private void UpdateSpotifyTrackTime(object sender, TrackTimeChangeEventArgs e)
|
||||
{
|
||||
var dataModel = (WindowsProfileDataModel) DataModel;
|
||||
if (dataModel.Spotify.SongLength > 0)
|
||||
dataModel.Spotify.SongPercentCompleted = (int) (e.TrackTime/dataModel.Spotify.SongLength*100.0);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
using Artemis.Models;
|
||||
|
||||
namespace Artemis.Modules.Effects.WindowsProfile
|
||||
{
|
||||
public class WindowsProfileSettings : GameSettings
|
||||
{
|
||||
public WindowsProfileSettings()
|
||||
{
|
||||
Load();
|
||||
}
|
||||
|
||||
public sealed override void Load()
|
||||
{
|
||||
LastProfile = WindowsProfile.Default.LastProfile;
|
||||
}
|
||||
|
||||
public sealed override void Save()
|
||||
{
|
||||
WindowsProfile.Default.LastProfile = LastProfile;
|
||||
|
||||
WindowsProfile.Default.Save();
|
||||
}
|
||||
|
||||
public sealed override void ToDefault()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,6 @@
|
||||
using Artemis.Events;
|
||||
using Artemis.InjectionFactories;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Models;
|
||||
using Artemis.Modules.Effects.ProfilePreview;
|
||||
using Artemis.ViewModels.Abstract;
|
||||
using Artemis.ViewModels.Profiles;
|
||||
@ -20,9 +19,9 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
DisplayName = "Windows Profile";
|
||||
PFactory = pFactory;
|
||||
ProfilePreviewModel = profilePreviewModel;
|
||||
EffectSettings = ((WindowsProfileModel)EffectModel).Settings;
|
||||
ProfileEditor = PFactory.CreateProfileEditorVm(events, main, (WindowsProfileModel)EffectModel,
|
||||
((WindowsProfileSettings)EffectSettings).LastProfile);
|
||||
EffectSettings = ((WindowsProfileModel) EffectModel).Settings;
|
||||
ProfileEditor = PFactory.CreateProfileEditorVm(events, main, (WindowsProfileModel) EffectModel,
|
||||
((WindowsProfileSettings) EffectSettings).LastProfile);
|
||||
ProfilePreviewModel.Profile = ProfileEditor.SelectedProfile;
|
||||
|
||||
events.Subscribe(this);
|
||||
@ -35,6 +34,11 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
public IProfileEditorVmFactory PFactory { get; set; }
|
||||
public ProfilePreviewModel ProfilePreviewModel { get; set; }
|
||||
|
||||
public void Handle(ActiveEffectChanged message)
|
||||
{
|
||||
NotifyOfPropertyChange(() => EffectEnabled);
|
||||
}
|
||||
|
||||
private void ProfileUpdater(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName != "SelectedProfile" && IsActive)
|
||||
@ -45,7 +49,7 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
if (e.PropertyName != "SelectedProfile" || !ProfileEditor.ProfileViewModel.Activated ||
|
||||
ProfileEditor.ProfileViewModel.SelectedProfile == null)
|
||||
return;
|
||||
((WindowsProfileSettings)EffectSettings).LastProfile = ProfileEditor.ProfileViewModel.SelectedProfile.Name;
|
||||
((WindowsProfileSettings) EffectSettings).LastProfile = ProfileEditor.ProfileViewModel.SelectedProfile.Name;
|
||||
EffectSettings.Save();
|
||||
}
|
||||
|
||||
@ -60,25 +64,5 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
base.OnDeactivate(close);
|
||||
ProfileEditor.ProfileViewModel.Deactivate();
|
||||
}
|
||||
|
||||
public void Handle(ActiveEffectChanged message)
|
||||
{
|
||||
NotifyOfPropertyChange(() => EffectEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
public class WindowsProfileSettings : GameSettings
|
||||
{
|
||||
public override void Load()
|
||||
{
|
||||
}
|
||||
|
||||
public override void Save()
|
||||
{
|
||||
}
|
||||
|
||||
public override void ToDefault()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Artemis.Modules.Games.CounterStrike" GeneratedClassName="CounterStrike">
|
||||
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
||||
GeneratedClassNamespace="Artemis.Modules.Games.CounterStrike" GeneratedClassName="CounterStrike">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
||||
@ -31,6 +33,6 @@
|
||||
</Setting>
|
||||
<Setting Name="LowHpEnabled" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
@ -19,7 +19,7 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Label FontSize="20" HorizontalAlignment="Left">
|
||||
<Label.Content>
|
||||
|
||||
@ -11,7 +11,7 @@ namespace Artemis.Modules.Games.Dota2
|
||||
{
|
||||
public sealed class Dota2ViewModel : GameViewModel
|
||||
{
|
||||
public Dota2ViewModel(MainManager main, IEventAggregator events, IProfileEditorVmFactory pFactory)
|
||||
public Dota2ViewModel(MainManager main, IEventAggregator events, IProfileEditorVmFactory pFactory)
|
||||
: base(main, new Dota2Model(main, new Dota2Settings()), events, pFactory)
|
||||
{
|
||||
DisplayName = "Dota 2";
|
||||
@ -23,7 +23,7 @@ namespace Artemis.Modules.Games.Dota2
|
||||
|
||||
public void FindGameDir()
|
||||
{
|
||||
var gameSettings = (Dota2Settings)GameSettings;
|
||||
var gameSettings = (Dota2Settings) GameSettings;
|
||||
// If already propertly set up, don't do anything
|
||||
if (gameSettings.GameDirectory != null && File.Exists(gameSettings.GameDirectory + "csgo.exe") &&
|
||||
File.Exists(gameSettings.GameDirectory + "/csgo/cfg/gamestate_integration_artemis.cfg"))
|
||||
@ -75,12 +75,12 @@ namespace Artemis.Modules.Games.Dota2
|
||||
"/game/dota/cfg/gamestate_integration/gamestate_integration_artemis.cfg",
|
||||
cfgFile);
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
DialogService.ShowErrorMessageBox("Please select a valid Dota 2 directory\n\n" +
|
||||
@"By default Dota 2 is in \SteamApps\common\dota 2 beta");
|
||||
@"By default Dota 2 is in \SteamApps\common\dota 2 beta");
|
||||
((Dota2Settings) GameSettings).GameDirectory = string.Empty;
|
||||
NotifyOfPropertyChange(() => GameSettings);
|
||||
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Artemis.Modules.Games.Overwatch" GeneratedClassName="Overwatch">
|
||||
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
||||
GeneratedClassNamespace="Artemis.Modules.Games.Overwatch" GeneratedClassName="Overwatch">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
||||
|
||||
@ -9,6 +9,8 @@ namespace Artemis.Modules.Games.Overwatch
|
||||
Load();
|
||||
}
|
||||
|
||||
public string GameDirectory { get; set; }
|
||||
|
||||
public sealed override void Load()
|
||||
{
|
||||
Enabled = Overwatch.Default.Enabled;
|
||||
@ -25,8 +27,6 @@ namespace Artemis.Modules.Games.Overwatch
|
||||
Overwatch.Default.Save();
|
||||
}
|
||||
|
||||
public string GameDirectory { get; set; }
|
||||
|
||||
public sealed override void ToDefault()
|
||||
{
|
||||
Enabled = true;
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<UserControl x:Class="Artemis.Modules.Games.Overwatch.OverwatchView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:cal="http://www.caliburnproject.org"
|
||||
mc:Ignorable="d"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="410.933" d:DesignWidth="732.154">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<Grid Margin="15, 5, 15, 5">
|
||||
@ -63,4 +63,4 @@
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@ -1,5 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Artemis.Modules.Games.RocketLeague" GeneratedClassName="RocketLeague">
|
||||
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
||||
GeneratedClassNamespace="Artemis.Modules.Games.RocketLeague" GeneratedClassName="RocketLeague">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using System.Windows.Media;
|
||||
using Artemis.Models;
|
||||
using Artemis.Models;
|
||||
|
||||
namespace Artemis.Modules.Games.RocketLeague
|
||||
{
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Managers;
|
||||
@ -7,7 +6,6 @@ using Artemis.Models;
|
||||
using Artemis.Models.Profiles;
|
||||
using Artemis.Utilities;
|
||||
using Artemis.Utilities.LogitechDll;
|
||||
using Brush = System.Windows.Media.Brush;
|
||||
|
||||
namespace Artemis.Modules.Games.TheDivision
|
||||
{
|
||||
@ -94,7 +92,7 @@ namespace Artemis.Modules.Games.TheDivision
|
||||
newState = PlayerState.Offline;
|
||||
|
||||
if (playerId == 1)
|
||||
gameDataModel.LowHp = (newState == PlayerState.Hit);
|
||||
gameDataModel.LowHp = newState == PlayerState.Hit;
|
||||
else if (playerId == 2)
|
||||
gameDataModel.PartyMember1 = newState;
|
||||
else if (playerId == 3)
|
||||
@ -131,9 +129,9 @@ namespace Artemis.Modules.Games.TheDivision
|
||||
// DataModel updating is done whenever a pipe message is received
|
||||
}
|
||||
|
||||
public override List<LayerModel> GetRenderLayers(bool renderMice, bool renderHeadsets)
|
||||
{
|
||||
return Profile.GetRenderLayers<TheDivisionDataModel>(DataModel, renderMice, renderHeadsets);
|
||||
public override List<LayerModel> GetRenderLayers(bool renderMice, bool renderHeadsets)
|
||||
{
|
||||
return Profile.GetRenderLayers<TheDivisionDataModel>(DataModel, renderMice, renderHeadsets);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -39,8 +39,10 @@
|
||||
TextAlignment="Justify" Margin="5,0,0,10">
|
||||
Artemis requires the latest Witcher 3 version and mod to be installed in order to work. If you don't use any (conflicting) Witcher 3 mods, the mod can automatically be installed.
|
||||
</TextBlock>
|
||||
<Button Grid.Row="2" Grid.Column="0" Margin="5,0,0,0" x:Name="AutoInstall" Content="Try automatic mod install" Width="160" Style="{DynamicResource SquareButtonStyle}" HorizontalAlignment="Left" />
|
||||
|
||||
<Button Grid.Row="2" Grid.Column="0" Margin="5,0,0,0" x:Name="AutoInstall"
|
||||
Content="Try automatic mod install" Width="160" Style="{DynamicResource SquareButtonStyle}"
|
||||
HorizontalAlignment="Left" />
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" Margin="0,0,-30,0" />
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ namespace Artemis.Modules.Overlays.VolumeDisplay
|
||||
public override void RenderOverlay(ref Bitmap keyboard, ref Brush mouse, ref Brush headset, bool renderMice,
|
||||
bool renderHeadsets)
|
||||
{
|
||||
keyboard= GenerateBitmap(keyboard ?? MainManager.DeviceManager.ActiveKeyboard.KeyboardBitmap(4));
|
||||
keyboard = GenerateBitmap(keyboard ?? MainManager.DeviceManager.ActiveKeyboard.KeyboardBitmap(4));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,20 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
|
||||
autoReload="true"
|
||||
throwExceptions="false"
|
||||
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log" >
|
||||
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
|
||||
<targets>
|
||||
<target name="file"
|
||||
xsi:type="File"
|
||||
maxArchiveFiles="7"
|
||||
fileName="${specialfolder:folder=MyDocuments}/Artemis/logs/${shortdate}.txt"
|
||||
layout="${longdate}|${level:uppercase=true}|${logger}|${message} ${exception:format=tostring}"/>
|
||||
|
||||
<target name="debugger"
|
||||
xsi:type="Debugger"
|
||||
layout="${logger:shortName=True} - ${uppercase:${level}}: ${message}"/>
|
||||
xsi:type="File"
|
||||
maxArchiveFiles="7"
|
||||
fileName="${specialfolder:folder=MyDocuments}/Artemis/logs/${shortdate}.txt"
|
||||
layout="${longdate}|${level:uppercase=true}|${logger}|${message} ${exception:format=tostring}" />
|
||||
|
||||
<target name="debugger"
|
||||
xsi:type="Debugger"
|
||||
layout="${logger:shortName=True} - ${uppercase:${level}}: ${message}" />
|
||||
</targets>
|
||||
|
||||
<rules>
|
||||
|
||||
10
Artemis/Artemis/Properties/Resources.Designer.cs
generated
10
Artemis/Artemis/Properties/Resources.Designer.cs
generated
@ -265,6 +265,16 @@ namespace Artemis.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap none {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("none", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to /***********************************************************************/
|
||||
////** © 2015 CD PROJEKT S.A. All rights reserved.
|
||||
|
||||
@ -178,4 +178,7 @@
|
||||
<data name="defaultProfiles" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Keyboards\default-profiles.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="none" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Keyboards\none.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
Binary file not shown.
BIN
Artemis/Artemis/Resources/Keyboards/none.png
Normal file
BIN
Artemis/Artemis/Resources/Keyboards/none.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
@ -27,7 +27,6 @@ using Caliburn.Micro;
|
||||
using MahApps.Metro.Controls;
|
||||
using MahApps.Metro.Controls.Dialogs;
|
||||
using Microsoft.Win32;
|
||||
using Ninject;
|
||||
|
||||
namespace Artemis.Services
|
||||
{
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Artemis.Settings" GeneratedClassName="General">
|
||||
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
||||
GeneratedClassNamespace="Artemis.Settings" GeneratedClassName="General">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="LastEffect" Type="System.String" Scope="User">
|
||||
|
||||
@ -50,7 +50,7 @@ namespace Artemis.Styles.DropTargetAdorners
|
||||
// Create the pen and triangle in a static constructor and freeze them to improve performance.
|
||||
const int triangleSize = 5;
|
||||
|
||||
var color = (Color)ThemeManager.DetectAppStyle(Application.Current).Item2.Resources["AccentColor"];
|
||||
var color = (Color) ThemeManager.DetectAppStyle(Application.Current).Item2.Resources["AccentColor"];
|
||||
m_Pen = new Pen(new SolidColorBrush(color), 2);
|
||||
m_Pen.Freeze();
|
||||
|
||||
@ -59,7 +59,7 @@ namespace Artemis.Styles.DropTargetAdorners
|
||||
var secondLine = new LineSegment(new Point(0, triangleSize), false);
|
||||
secondLine.Freeze();
|
||||
|
||||
var figure = new PathFigure { StartPoint = new Point(triangleSize, 0) };
|
||||
var figure = new PathFigure {StartPoint = new Point(triangleSize, 0)};
|
||||
figure.Segments.Add(firstLine);
|
||||
figure.Segments.Add(secondLine);
|
||||
figure.Freeze();
|
||||
@ -109,7 +109,7 @@ namespace Artemis.Styles.DropTargetAdorners
|
||||
}
|
||||
}
|
||||
|
||||
var itemContainer = (UIElement)itemParent.ItemContainerGenerator.ContainerFromIndex(index);
|
||||
var itemContainer = (UIElement) itemParent.ItemContainerGenerator.ContainerFromIndex(index);
|
||||
|
||||
if (itemContainer != null)
|
||||
{
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Windows.Media;
|
||||
using Brush = System.Windows.Media.Brush;
|
||||
using Color = System.Drawing.Color;
|
||||
|
||||
namespace Artemis.Utilities
|
||||
{
|
||||
|
||||
@ -44,7 +44,7 @@ namespace Artemis.Utilities.DataReaders
|
||||
{
|
||||
if (intermediate.Length > 16)
|
||||
continue;
|
||||
|
||||
|
||||
// Can't parse to a byte directly since it may contain values >254
|
||||
var parts = intermediate.Split(',').Select(int.Parse).ToArray();
|
||||
if (parts[0] >= 5 && parts[1] >= 21)
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Artemis.Utilities
|
||||
{
|
||||
@ -19,6 +21,30 @@ namespace Artemis.Utilities
|
||||
|
||||
#endregion
|
||||
|
||||
#region Zip files
|
||||
|
||||
public static void ExtractToDirectory(this ZipArchive archive, string destinationDirectoryName, bool overwrite)
|
||||
{
|
||||
if (!overwrite)
|
||||
{
|
||||
archive.ExtractToDirectory(destinationDirectoryName);
|
||||
return;
|
||||
}
|
||||
foreach (var file in archive.Entries)
|
||||
{
|
||||
var completeFileName = Path.Combine(destinationDirectoryName, file.FullName);
|
||||
if (file.Name == "")
|
||||
{
|
||||
// Assuming Empty for Directory
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(completeFileName));
|
||||
continue;
|
||||
}
|
||||
file.ExtractToFile(completeFileName, true);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Color
|
||||
|
||||
// TODO: Convert ColorHelpers to ExtensionMethods
|
||||
|
||||
@ -5,8 +5,6 @@ using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows;
|
||||
using System.Windows.Markup;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Microsoft.Win32;
|
||||
using static System.String;
|
||||
|
||||
@ -1,12 +1,9 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using PixelFormat = System.Drawing.Imaging.PixelFormat;
|
||||
|
||||
namespace Artemis.Utilities
|
||||
{
|
||||
|
||||
@ -15,13 +15,13 @@ namespace Artemis.Utilities.Layers
|
||||
case LayerAnimation.SlideLeft:
|
||||
if (progress + 1 >= properties.Width*scale)
|
||||
progress = 0;
|
||||
progress = progress + properties.AnimationSpeed * 2;
|
||||
progress = progress + properties.AnimationSpeed*2;
|
||||
break;
|
||||
case LayerAnimation.SlideDown:
|
||||
case LayerAnimation.SlideUp:
|
||||
if (progress + 1 >= properties.Height*scale)
|
||||
progress = 0;
|
||||
progress = progress + properties.AnimationSpeed * 2;
|
||||
progress = progress + properties.AnimationSpeed*2;
|
||||
break;
|
||||
case LayerAnimation.Pulse:
|
||||
if (progress > 2)
|
||||
@ -31,7 +31,7 @@ namespace Artemis.Utilities.Layers
|
||||
case LayerAnimation.Grow:
|
||||
if (progress > 10)
|
||||
progress = 0;
|
||||
progress = progress + properties.AnimationSpeed / 2.5;
|
||||
progress = progress + properties.AnimationSpeed/2.5;
|
||||
break;
|
||||
default:
|
||||
progress = progress + properties.AnimationSpeed*2;
|
||||
|
||||
@ -31,7 +31,6 @@ namespace Artemis.Utilities.LogitechDll
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void PlaceDll()
|
||||
|
||||
@ -21,6 +21,7 @@ namespace Artemis.ViewModels.Abstract
|
||||
|
||||
[Inject]
|
||||
public MetroDialogService DialogService { get; set; }
|
||||
|
||||
public EffectSettings EffectSettings
|
||||
{
|
||||
get { return _effectSettings; }
|
||||
|
||||
@ -18,6 +18,7 @@ namespace Artemis.ViewModels.Abstract
|
||||
|
||||
[Inject]
|
||||
public MetroDialogService DialogService { get; set; }
|
||||
|
||||
public OverlayModel OverlayModel { get; set; }
|
||||
|
||||
public OverlaySettings OverlaySettings
|
||||
|
||||
@ -145,8 +145,7 @@ namespace Artemis.ViewModels.Flyouts
|
||||
|
||||
if (EnableDebug)
|
||||
rule.EnableLoggingForLevel(LogLevel.Debug);
|
||||
else
|
||||
rule.DisableLoggingForLevel(LogLevel.Debug);
|
||||
rule.DisableLoggingForLevel(LogLevel.Debug);
|
||||
|
||||
LogManager.ReconfigExistingLoggers();
|
||||
_logger.Info("Set debug logging to: {0}", EnableDebug);
|
||||
|
||||
@ -8,7 +8,8 @@ namespace Artemis.ViewModels
|
||||
{
|
||||
private readonly GameViewModel[] _gameViewModels;
|
||||
|
||||
public GamesViewModel(GameViewModel[] gameViewModels, ProfileManager profileManager, ProfilePreviewModel profilePreviewModel)
|
||||
public GamesViewModel(GameViewModel[] gameViewModels, ProfileManager profileManager,
|
||||
ProfilePreviewModel profilePreviewModel)
|
||||
{
|
||||
DisplayName = "Games";
|
||||
_gameViewModels = gameViewModels;
|
||||
|
||||
@ -213,7 +213,7 @@ namespace Artemis.ViewModels.Profiles
|
||||
SelectedDataModelProp = DataModelProps.FirstOrDefault(m => m.Path == LayerConditionModel.Field);
|
||||
SelectedOperator = Operators.FirstOrDefault(o => o.Value == LayerConditionModel.Operator);
|
||||
LayerConditionModel.Type = SelectedDataModelProp.Type;
|
||||
if (LayerConditionModel.Type =="Enum")
|
||||
if (LayerConditionModel.Type == "Enum")
|
||||
SelectedEnum = LayerConditionModel.Value;
|
||||
else
|
||||
UserValue = LayerConditionModel.Value;
|
||||
|
||||
@ -2,8 +2,6 @@
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Timers;
|
||||
using System.Xml.Serialization;
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Models.Profiles;
|
||||
using Artemis.Models.Profiles.Properties;
|
||||
@ -11,7 +9,6 @@ using Artemis.Services;
|
||||
using Artemis.Utilities;
|
||||
using Artemis.ViewModels.Profiles.Properties;
|
||||
using Caliburn.Micro;
|
||||
using Newtonsoft.Json;
|
||||
using Ninject;
|
||||
|
||||
namespace Artemis.ViewModels.Profiles
|
||||
@ -169,7 +166,6 @@ namespace Artemis.ViewModels.Profiles
|
||||
Layer.Properties.Conditions.Clear();
|
||||
foreach (var conditionViewModel in LayerConditionVms)
|
||||
{
|
||||
|
||||
Layer.Properties.Conditions.Add(conditionViewModel.LayerConditionModel);
|
||||
}
|
||||
|
||||
@ -206,7 +202,8 @@ namespace Artemis.ViewModels.Profiles
|
||||
return;
|
||||
}
|
||||
|
||||
var close = await DialogService.ShowQuestionMessageBox("Unsaved changes", "Do you want to discard your changes?");
|
||||
var close =
|
||||
await DialogService.ShowQuestionMessageBox("Unsaved changes", "Do you want to discard your changes?");
|
||||
callback(close.Value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +69,10 @@ namespace Artemis.ViewModels.Profiles
|
||||
|
||||
public ProfileViewModel ProfileViewModel { get; set; }
|
||||
|
||||
public bool EditorEnabled => SelectedProfile != null && !SelectedProfile.IsDefault;
|
||||
public bool EditorEnabled
|
||||
=>
|
||||
SelectedProfile != null && !SelectedProfile.IsDefault &&
|
||||
_mainManager.DeviceManager.ActiveKeyboard != null;
|
||||
|
||||
public BindableCollection<ProfileModel> Profiles
|
||||
{
|
||||
@ -457,6 +460,13 @@ namespace Artemis.ViewModels.Profiles
|
||||
/// </summary>
|
||||
public async void AddProfile()
|
||||
{
|
||||
if (_mainManager.DeviceManager.ActiveKeyboard == null)
|
||||
{
|
||||
DialogService.ShowMessageBox("Cannot add profile.",
|
||||
"To add a profile, please select a keyboard in the options menu first.");
|
||||
return;
|
||||
}
|
||||
|
||||
var name = await DialogService.ShowInputDialog("Add new profile",
|
||||
"Please provide a profile name unique to this game and keyboard.");
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ using Artemis.Managers;
|
||||
using Artemis.Models.Profiles;
|
||||
using Artemis.Models.Profiles.Properties;
|
||||
using Artemis.Modules.Effects.ProfilePreview;
|
||||
using Artemis.Properties;
|
||||
using Artemis.Utilities;
|
||||
using Caliburn.Micro;
|
||||
using MahApps.Metro;
|
||||
@ -74,10 +75,8 @@ namespace Artemis.ViewModels.Profiles
|
||||
}
|
||||
}
|
||||
|
||||
public ImageSource KeyboardImage
|
||||
{
|
||||
get { return ImageUtilities.BitmapToBitmapImage(_deviceManager.ActiveKeyboard?.PreviewSettings.Image); }
|
||||
}
|
||||
public ImageSource KeyboardImage => ImageUtilities
|
||||
.BitmapToBitmapImage(_deviceManager.ActiveKeyboard?.PreviewSettings.Image ?? Resources.none);
|
||||
|
||||
public bool Activated { get; set; }
|
||||
|
||||
@ -91,7 +90,7 @@ namespace Artemis.ViewModels.Profiles
|
||||
if (_blurProgress > 2)
|
||||
_blurProgress = 0;
|
||||
_blurProgress = _blurProgress + 0.025;
|
||||
BlurRadius = (Math.Sin(_blurProgress * Math.PI) + 1) * 10 + 10;
|
||||
BlurRadius = (Math.Sin(_blurProgress*Math.PI) + 1)*10 + 10;
|
||||
|
||||
if (SelectedProfile == null || _deviceManager.ActiveKeyboard == null)
|
||||
{
|
||||
@ -120,12 +119,12 @@ namespace Artemis.ViewModels.Profiles
|
||||
if (accentColor == null)
|
||||
return;
|
||||
|
||||
var pen = new Pen(new SolidColorBrush((Color)accentColor), 0.4);
|
||||
var pen = new Pen(new SolidColorBrush((Color) accentColor), 0.4);
|
||||
|
||||
// Draw the selection outline and resize indicator
|
||||
if (SelectedLayer != null && SelectedLayer.MustDraw())
|
||||
{
|
||||
var layerRect = ((KeyboardPropertiesModel)SelectedLayer.Properties).GetRect();
|
||||
var layerRect = ((KeyboardPropertiesModel) SelectedLayer.Properties).GetRect();
|
||||
// Deflate the rect so that the border is drawn on the inside
|
||||
layerRect.Inflate(-0.2, -0.2);
|
||||
|
||||
@ -192,13 +191,13 @@ namespace Artemis.ViewModels.Profiles
|
||||
return;
|
||||
|
||||
var keyboard = _deviceManager.ActiveKeyboard;
|
||||
var pos = e.GetPosition((Image)e.OriginalSource);
|
||||
var x = pos.X / ((double)keyboard.PreviewSettings.Width / keyboard.Width);
|
||||
var y = pos.Y / ((double)keyboard.PreviewSettings.Height / keyboard.Height);
|
||||
var pos = e.GetPosition((Image) e.OriginalSource);
|
||||
var x = pos.X/((double) keyboard.PreviewSettings.Width/keyboard.Width);
|
||||
var y = pos.Y/((double) keyboard.PreviewSettings.Height/keyboard.Height);
|
||||
|
||||
var hoverLayer = SelectedProfile.GetLayers()
|
||||
.Where(l => l.MustDraw())
|
||||
.FirstOrDefault(l => ((KeyboardPropertiesModel)l.Properties)
|
||||
.FirstOrDefault(l => ((KeyboardPropertiesModel) l.Properties)
|
||||
.GetRect(1)
|
||||
.Contains(x, y));
|
||||
|
||||
@ -214,13 +213,13 @@ namespace Artemis.ViewModels.Profiles
|
||||
if (SelectedProfile == null)
|
||||
return;
|
||||
|
||||
var pos = e.GetPosition((Image)e.OriginalSource);
|
||||
var pos = e.GetPosition((Image) e.OriginalSource);
|
||||
var keyboard = _deviceManager.ActiveKeyboard;
|
||||
var x = pos.X / ((double)keyboard.PreviewSettings.Width / keyboard.Width);
|
||||
var y = pos.Y / ((double)keyboard.PreviewSettings.Height / keyboard.Height);
|
||||
var x = pos.X/((double) keyboard.PreviewSettings.Width/keyboard.Width);
|
||||
var y = pos.Y/((double) keyboard.PreviewSettings.Height/keyboard.Height);
|
||||
var hoverLayer = SelectedProfile.GetLayers()
|
||||
.Where(l => l.MustDraw())
|
||||
.FirstOrDefault(l => ((KeyboardPropertiesModel)l.Properties)
|
||||
.FirstOrDefault(l => ((KeyboardPropertiesModel) l.Properties)
|
||||
.GetRect(1).Contains(x, y));
|
||||
|
||||
HandleDragging(e, x, y, hoverLayer);
|
||||
@ -235,7 +234,7 @@ namespace Artemis.ViewModels.Profiles
|
||||
// Turn the mouse pointer into a hand if hovering over an active layer
|
||||
if (hoverLayer == SelectedLayer)
|
||||
{
|
||||
var rect = ((KeyboardPropertiesModel)hoverLayer.Properties).GetRect(1);
|
||||
var rect = ((KeyboardPropertiesModel) hoverLayer.Properties).GetRect(1);
|
||||
KeyboardPreviewCursor =
|
||||
Math.Sqrt(Math.Pow(x - rect.BottomRight.X, 2) + Math.Pow(y - rect.BottomRight.Y, 2)) < 0.6
|
||||
? Cursors.SizeNWSE
|
||||
@ -280,8 +279,8 @@ namespace Artemis.ViewModels.Profiles
|
||||
// Setup the dragging state on mouse press
|
||||
if (_draggingLayerOffset == null && hoverLayer != null && e.LeftButton == MouseButtonState.Pressed)
|
||||
{
|
||||
var layerRect = ((KeyboardPropertiesModel)hoverLayer.Properties).GetRect(1);
|
||||
var selectedProps = (KeyboardPropertiesModel)SelectedLayer.Properties;
|
||||
var layerRect = ((KeyboardPropertiesModel) hoverLayer.Properties).GetRect(1);
|
||||
var selectedProps = (KeyboardPropertiesModel) SelectedLayer.Properties;
|
||||
|
||||
_draggingLayerOffset = new Point(x - selectedProps.X, y - selectedProps.Y);
|
||||
_draggingLayer = hoverLayer;
|
||||
@ -293,13 +292,13 @@ namespace Artemis.ViewModels.Profiles
|
||||
if (_draggingLayerOffset == null || _draggingLayer == null || (_draggingLayer != SelectedLayer))
|
||||
return;
|
||||
|
||||
var draggingProps = (KeyboardPropertiesModel)_draggingLayer?.Properties;
|
||||
var draggingProps = (KeyboardPropertiesModel) _draggingLayer?.Properties;
|
||||
|
||||
// If no setup or reset was done, handle the actual dragging action
|
||||
if (_resizing)
|
||||
{
|
||||
draggingProps.Width = (int)Math.Round(x - draggingProps.X);
|
||||
draggingProps.Height = (int)Math.Round(y - draggingProps.Y);
|
||||
draggingProps.Width = (int) Math.Round(x - draggingProps.X);
|
||||
draggingProps.Height = (int) Math.Round(y - draggingProps.Y);
|
||||
if (draggingProps.Width < 1)
|
||||
draggingProps.Width = 1;
|
||||
if (draggingProps.Height < 1)
|
||||
@ -307,8 +306,8 @@ namespace Artemis.ViewModels.Profiles
|
||||
}
|
||||
else
|
||||
{
|
||||
draggingProps.X = (int)Math.Round(x - _draggingLayerOffset.Value.X);
|
||||
draggingProps.Y = (int)Math.Round(y - _draggingLayerOffset.Value.Y);
|
||||
draggingProps.X = (int) Math.Round(x - _draggingLayerOffset.Value.X);
|
||||
draggingProps.Y = (int) Math.Round(y - _draggingLayerOffset.Value.Y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -7,8 +7,8 @@ namespace Artemis.ViewModels.Profiles.Properties
|
||||
{
|
||||
public class HeadsetPropertiesViewModel : LayerPropertiesViewModel
|
||||
{
|
||||
private LayerPropertiesModel _proposedProperties;
|
||||
private Brush _brush;
|
||||
private LayerPropertiesModel _proposedProperties;
|
||||
|
||||
public HeadsetPropertiesViewModel(IDataModel dataModel, LayerPropertiesModel properties)
|
||||
: base(dataModel)
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using System.Windows.Media;
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Models.Profiles.Properties;
|
||||
using Caliburn.Micro;
|
||||
|
||||
@ -7,13 +6,13 @@ namespace Artemis.ViewModels.Profiles.Properties
|
||||
{
|
||||
public abstract class LayerPropertiesViewModel : PropertyChangedBase
|
||||
{
|
||||
public IDataModel DataModel { get; set; }
|
||||
|
||||
protected LayerPropertiesViewModel(IDataModel dataModel)
|
||||
{
|
||||
DataModel = dataModel;
|
||||
}
|
||||
|
||||
public IDataModel DataModel { get; set; }
|
||||
|
||||
public abstract LayerPropertiesModel GetAppliedProperties();
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,4 @@
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Navigation;
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Models.Profiles.Properties;
|
||||
using Artemis.Utilities;
|
||||
@ -8,8 +7,8 @@ namespace Artemis.ViewModels.Profiles.Properties
|
||||
{
|
||||
public class MousePropertiesViewModel : LayerPropertiesViewModel
|
||||
{
|
||||
private LayerPropertiesModel _proposedProperties;
|
||||
private Brush _brush;
|
||||
private LayerPropertiesModel _proposedProperties;
|
||||
|
||||
public MousePropertiesViewModel(IDataModel dataModel, LayerPropertiesModel properties)
|
||||
: base(dataModel)
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows;
|
||||
using Artemis.Events;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Services;
|
||||
@ -37,6 +36,7 @@ namespace Artemis.ViewModels
|
||||
|
||||
[Inject]
|
||||
public MetroDialogService DialogService { get; set; }
|
||||
|
||||
public MainManager MainManager { get; set; }
|
||||
|
||||
public bool CanShowWindow => !_shellViewModel.IsActive;
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
<ComboBox Grid.Row="3" Grid.Column="1" x:Name="Themes" Margin="10" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
Width="140" />
|
||||
|
||||
|
||||
<!-- Keyboard selection -->
|
||||
<Label Grid.Row="4" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
Content="Keyboard:" />
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="0" x:Name="EnumValueIsVisible" HorizontalAlignment="Left" VerticalAlignment="Top">
|
||||
<ComboBox x:Name="Enums" Width="110" MaxDropDownHeight="125" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top"/>
|
||||
VerticalAlignment="Top" />
|
||||
</StackPanel>
|
||||
<Button Grid.Column="1" x:Name="Delete" Width="26" Height="26" Style="{DynamicResource SquareButtonStyle}"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Right">
|
||||
|
||||
@ -27,15 +27,17 @@
|
||||
<!-- Preview Background="#FF232323" -->
|
||||
<Label Grid.Column="0" Grid.Row="0" FontSize="20" HorizontalAlignment="Left" Content="Preview" />
|
||||
<Border Grid.Column="0" Grid.Row="1" Background="#FF232323" BorderBrush="{DynamicResource HighlightBrush}"
|
||||
BorderThickness="3" Width="800" Height="400">
|
||||
BorderThickness="3" Width="800" Height="400">
|
||||
<Border>
|
||||
<Border.Effect>
|
||||
<DropShadowEffect ShadowDepth="0" Color="{DynamicResource HighlightColor}" Opacity="1"
|
||||
BlurRadius="{Binding Path=ProfileViewModel.BlurRadius, Mode=OneWay}" />
|
||||
</Border.Effect>
|
||||
<Grid>
|
||||
<Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=ProfileViewModel.KeyboardImage}" Margin="50" />
|
||||
<Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=ProfileViewModel.KeyboardPreview}" Opacity="0.8"
|
||||
<Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=ProfileViewModel.KeyboardImage}"
|
||||
Margin="50" />
|
||||
<Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=ProfileViewModel.KeyboardPreview}"
|
||||
Opacity="0.8"
|
||||
Width="{Binding Path=PreviewSettings.Width}"
|
||||
Height="{Binding Path=PreviewSettings.Height}"
|
||||
Margin="{Binding Path=PreviewSettings.Margin}"
|
||||
@ -43,22 +45,22 @@
|
||||
cal:Message.Attach="[Event MouseMove] = [Action MouseMoveKeyboardPreview($eventArgs)];
|
||||
[Event MouseDown] = [Action MouseDownKeyboardPreview($eventArgs)];
|
||||
[Event MouseUp] = [Action MouseUpKeyboardPreview($eventArgs)]"
|
||||
IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}"/>
|
||||
IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</Border>
|
||||
<!-- Profile management -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="2">
|
||||
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
|
||||
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
|
||||
<Label Content="Active profile" />
|
||||
<ComboBox Width="145" VerticalAlignment="Top" x:Name="Profiles" DisplayMemberPath="Name"
|
||||
Margin="5,0,0,0" />
|
||||
<ComboBox Width="220" VerticalAlignment="Top" x:Name="Profiles" DisplayMemberPath="Name"
|
||||
Margin="5,0,0,0" />
|
||||
<Button x:Name="AddProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Add profile">
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Add profile">
|
||||
<Button.Content>
|
||||
<Rectangle
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
<Rectangle.OpacityMask>
|
||||
<VisualBrush Visual="{StaticResource appbar_add}" Stretch="Fill" />
|
||||
</Rectangle.OpacityMask>
|
||||
@ -66,12 +68,12 @@
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Name="RenameProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Rename profile"
|
||||
IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}">
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Rename profile"
|
||||
IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}">
|
||||
<Button.Content>
|
||||
<Rectangle
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
<Rectangle.OpacityMask>
|
||||
<VisualBrush Visual="{StaticResource appbar_edit}" Stretch="Fill" />
|
||||
</Rectangle.OpacityMask>
|
||||
@ -79,12 +81,13 @@
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Name="DuplicateProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Duplicate profile"
|
||||
IsEnabled="{Binding Path=ProfileSelected, Mode=OneWay}">
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0"
|
||||
ToolTip="Duplicate profile"
|
||||
IsEnabled="{Binding Path=ProfileSelected, Mode=OneWay}">
|
||||
<Button.Content>
|
||||
<Rectangle
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
<Rectangle.OpacityMask>
|
||||
<VisualBrush Visual="{StaticResource appbar_clipboard_paste}" Stretch="Fill" />
|
||||
</Rectangle.OpacityMask>
|
||||
@ -92,12 +95,12 @@
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Name="DeleteProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Delete profile"
|
||||
IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}">
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Delete profile"
|
||||
IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}">
|
||||
<Button.Content>
|
||||
<Rectangle
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
|
||||
Width="12" Height="12">
|
||||
<Rectangle.OpacityMask>
|
||||
<VisualBrush Visual="{StaticResource appbar_delete}" Stretch="Fill" />
|
||||
</Rectangle.OpacityMask>
|
||||
@ -105,9 +108,10 @@
|
||||
</Button.Content>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<TextBlock VerticalAlignment="Top" Foreground="{DynamicResource HighlightBrush}" HorizontalAlignment="Left" Margin="5,5,0,0" Text="Note: To edit a default profile, duplicate it first." FontWeight="Bold"/>
|
||||
<TextBlock VerticalAlignment="Top" Foreground="{DynamicResource HighlightBrush}" HorizontalAlignment="Left"
|
||||
Margin="5,5,0,0" Text="Note: To edit a default profile, duplicate it first." FontWeight="Bold" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<StackPanel Grid.Column="0" Grid.Row="2" Orientation="Horizontal" Margin="0,6,0,0" HorizontalAlignment="Right">
|
||||
<Button x:Name="ImportProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
|
||||
Height="26" HorizontalAlignment="Right" ToolTip="Import profile">
|
||||
@ -152,7 +156,8 @@
|
||||
ItemsSource="{Binding Path=Layers, Converter={StaticResource LayerOrderConverter}, ConverterParameter=Order}"
|
||||
IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}">
|
||||
<i:Interaction.Behaviors>
|
||||
<itemBehaviours:BindableSelectedItemBehavior SelectedItem="{Binding ProfileViewModel.SelectedLayer, Mode=TwoWay}" />
|
||||
<itemBehaviours:BindableSelectedItemBehavior
|
||||
SelectedItem="{Binding ProfileViewModel.SelectedLayer, Mode=TwoWay}" />
|
||||
</i:Interaction.Behaviors>
|
||||
<TreeView.Resources>
|
||||
<ResourceDictionary
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
<UserControl x:Class="Artemis.Views.Profiles.Properties.FolderPropertiesView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<Grid>
|
||||
<TextBlock Margin="10,2,10,10" FontSize="13.333"
|
||||
Foreground="{DynamicResource HighlightBrush}"
|
||||
Text="Note: A folder allows you to organise layers. Layers within a folder are only drawn if both the layer's and the folder's conditions are met."
|
||||
VerticalAlignment="Top" Height="Auto" TextWrapping="Wrap" />
|
||||
Foreground="{DynamicResource HighlightBrush}"
|
||||
Text="Note: A folder allows you to organise layers. Layers within a folder are only drawn if both the layer's and the folder's conditions are met."
|
||||
VerticalAlignment="Top" Height="Auto" TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@ -3,7 +3,7 @@
|
||||
namespace Artemis.Views.Profiles.Properties
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for FolderPropertiesView.xaml
|
||||
/// Interaction logic for FolderPropertiesView.xaml
|
||||
/// </summary>
|
||||
public partial class FolderPropertiesView : UserControl
|
||||
{
|
||||
@ -12,4 +12,4 @@ namespace Artemis.Views.Profiles.Properties
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
<UserControl x:Class="Artemis.Views.Profiles.Properties.HeadsetPropertiesView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:ncore="http://schemas.ncore.com/wpf/xaml/colorbox"
|
||||
mc:Ignorable="d"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@ -27,8 +27,8 @@
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" Margin="10,2,10,10" FontSize="13.333"
|
||||
Foreground="{DynamicResource HighlightBrush}"
|
||||
Text="Note: If your headset has multiple controllable LEDs you can create a gradient. Artemis will take the colors in the gradient and assign them to the LEDs"
|
||||
VerticalAlignment="Top" Height="Auto" TextWrapping="Wrap" />
|
||||
Foreground="{DynamicResource HighlightBrush}"
|
||||
Text="Note: If your headset has multiple controllable LEDs you can create a gradient. Artemis will take the colors in the gradient and assign them to the LEDs"
|
||||
VerticalAlignment="Top" Height="Auto" TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@ -3,7 +3,7 @@
|
||||
namespace Artemis.Views.Profiles.Properties
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for HeadsetPropertiesView.xaml
|
||||
/// Interaction logic for HeadsetPropertiesView.xaml
|
||||
/// </summary>
|
||||
public partial class HeadsetPropertiesView : UserControl
|
||||
{
|
||||
@ -12,4 +12,4 @@ namespace Artemis.Views.Profiles.Properties
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,14 @@
|
||||
<UserControl x:Class="Artemis.Views.Profiles.Properties.KeyboardPropertiesView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||
xmlns:ncore="http://schemas.ncore.com/wpf/xaml/colorbox"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:properties="clr-namespace:Artemis.Models.Profiles.Properties"
|
||||
xmlns:utilities="clr-namespace:Artemis.Utilities"
|
||||
mc:Ignorable="d"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<UserControl.Resources>
|
||||
<utilities:EnumDescriptionConverter x:Key="HEnumDescriptionConverter" />
|
||||
@ -39,11 +39,11 @@
|
||||
</Grid.RowDefinitions>
|
||||
<!-- Animation -->
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Margin="10" FontSize="13.333" Text="Animation:"
|
||||
VerticalAlignment="Center"
|
||||
Height="18" />
|
||||
VerticalAlignment="Center"
|
||||
Height="18" />
|
||||
<ComboBox Grid.Row="0" Grid.Column="1" ItemsSource="{Binding Source={StaticResource AnimationEnumValues}}"
|
||||
Margin="10,10,10,0" SelectedItem="{Binding Path=ProposedProperties.Animation}"
|
||||
VerticalAlignment="Top" Height="22">
|
||||
Margin="10,10,10,0" SelectedItem="{Binding Path=ProposedProperties.Animation}"
|
||||
VerticalAlignment="Top" Height="22">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Converter={StaticResource HEnumDescriptionConverter}}" />
|
||||
@ -53,20 +53,20 @@
|
||||
|
||||
<!-- Animation Speed -->
|
||||
<TextBlock Grid.Row="0" Grid.Column="2" Margin="10" FontSize="13.333" Text="Animation speed:"
|
||||
VerticalAlignment="Center" Height="18" />
|
||||
VerticalAlignment="Center" Height="18" />
|
||||
<Slider x:Name="RotationSpeed" Grid.Row="0" Grid.Column="3" VerticalAlignment="Center"
|
||||
TickPlacement="None" TickFrequency="0.05"
|
||||
Value="{Binding Path=ProposedProperties.AnimationSpeed, Mode=TwoWay}" Minimum="0.05" Maximum="3"
|
||||
SmallChange="0" IsSnapToTickEnabled="True" Margin="10,12,10,2" Height="24" />
|
||||
TickPlacement="None" TickFrequency="0.05"
|
||||
Value="{Binding Path=ProposedProperties.AnimationSpeed, Mode=TwoWay}" Minimum="0.05" Maximum="3"
|
||||
SmallChange="0" IsSnapToTickEnabled="True" Margin="10,12,10,2" Height="24" />
|
||||
|
||||
<!-- ClippingType -->
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Margin="10, 13, 10, 10" FontSize="13.333" Text="Clipping type:"
|
||||
VerticalAlignment="Center" Height="23"/>
|
||||
VerticalAlignment="Center" Height="23" />
|
||||
<controls:ToggleSwitch IsChecked="{Binding Path=ProposedProperties.Contain, Mode=TwoWay}"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1" OnLabel="Contain" OffLabel="Cut-off" Margin="10,1,5,1"
|
||||
VerticalAlignment="Center"
|
||||
Height="36" />
|
||||
Grid.Row="1"
|
||||
Grid.Column="1" OnLabel="Contain" OffLabel="Cut-off" Margin="10,1,5,1"
|
||||
VerticalAlignment="Center"
|
||||
Height="36" />
|
||||
|
||||
<!-- Colors -->
|
||||
<StackPanel Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2" Orientation="Horizontal" x:Name="ShowBrush">
|
||||
@ -106,11 +106,11 @@
|
||||
|
||||
<!-- Dynamic -->
|
||||
<Label Grid.Row="3" Grid.Column="0" FontSize="20" HorizontalAlignment="Left"
|
||||
Content="Dynamic" Width="97" VerticalAlignment="Bottom" />
|
||||
Content="Dynamic" Width="97" VerticalAlignment="Bottom" />
|
||||
|
||||
<!-- Dynamic property views -->
|
||||
<ContentControl Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="4" x:Name="HeightProperties" />
|
||||
<ContentControl Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="4" x:Name="WidthProperties" />
|
||||
<ContentControl Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="4" x:Name="OpacityProperties" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@ -3,7 +3,7 @@
|
||||
namespace Artemis.Views.Profiles.Properties
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for KeyboardPropertiesView.xaml
|
||||
/// Interaction logic for KeyboardPropertiesView.xaml
|
||||
/// </summary>
|
||||
public partial class KeyboardPropertiesView : UserControl
|
||||
{
|
||||
@ -12,4 +12,4 @@ namespace Artemis.Views.Profiles.Properties
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
<UserControl x:Class="Artemis.Views.Profiles.Properties.MousePropertiesView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:ncore="http://schemas.ncore.com/wpf/xaml/colorbox"
|
||||
mc:Ignorable="d"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@ -27,8 +27,8 @@
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" Margin="10,2,10,10" FontSize="13.333"
|
||||
Foreground="{DynamicResource HighlightBrush}"
|
||||
Text="Note: If your mouse has multiple controllable LEDs you can create a gradient. Artemis will take the colors in the gradient and assign them to the LEDs"
|
||||
VerticalAlignment="Top" Height="Auto" TextWrapping="Wrap" />
|
||||
Foreground="{DynamicResource HighlightBrush}"
|
||||
Text="Note: If your mouse has multiple controllable LEDs you can create a gradient. Artemis will take the colors in the gradient and assign them to the LEDs"
|
||||
VerticalAlignment="Top" Height="Auto" TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@ -3,7 +3,7 @@
|
||||
namespace Artemis.Views.Profiles.Properties
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MousePropertiesView.xaml
|
||||
/// Interaction logic for MousePropertiesView.xaml
|
||||
/// </summary>
|
||||
public partial class MousePropertiesView : UserControl
|
||||
{
|
||||
@ -12,4 +12,4 @@ namespace Artemis.Views.Profiles.Properties
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -17,7 +17,7 @@
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<GeometryDrawing Brush="{DynamicResource IdealForegroundColorBrush}"
|
||||
Geometry="M1518 3378 c-48 -63 -61 -101 -66 -184 -4 -70 -1 -91 27 -170 l31 -89 -27 -20 c-32 -24 -849 -601 -981 -693 l-93 -64 -87 40 c-48 22 -91 37 -95 32 -5 -4 9 -41 29 -83 l37 -75 -28 -24 c-23 -20 -29 -35 -33 -81 l-4 -56 -82 -19 c-109 -25 -109 -41 4 -91 l85 -38 7 -64 c15 -137 90 -1279 85 -1293 -3 -7 -35 -24 -70 -35 -159 -53 -257 -168 -257 -302 0 -35 2 -38 47 -53 54 -18 185 -21 232 -5 29 10 31 14 31 58 0 26 6 56 14 66 13 18 15 18 46 -8 44 -37 78 -35 119 7 l34 35 -17 41 c-9 23 -12 39 -6 35 6 -4 43 -1 83 6 39 6 219 14 398 18 l327 6 113 57 c158 78 256 166 317 282 24 46 27 62 27 152 0 98 -1 103 -41 184 l-42 83 44 69 c24 37 51 68 59 68 9 0 44 -14 78 -32 l62 -31 -93 -44 c-58 -26 -92 -48 -90 -55 9 -27 353 -68 570 -68 108 0 108 0 108 24 0 34 -105 171 -220 286 -122 122 -238 216 -250 204 -6 -6 -1 -42 16 -98 14 -49 23 -91 19 -94 -3 -3 -36 9 -73 27 l-69 33 24 71 c13 39 23 76 23 82 0 6 28 17 63 24 279 58 399 300 314 632 -32 121 -49 155 -134 255 -37 45 -106 126 -152 180 -73 87 -241 326 -241 343 0 3 15 13 32 21 21 10 35 25 40 45 15 60 -16 103 -81 108 -43 3 -39 22 14 74 l45 43 -25 50 c-35 69 -77 114 -130 139 -63 30 -88 27 -117 -11z m215 -835 c188 -279 250 -417 250 -548 0 -133 -74 -214 -243 -265 l-55 -16 -37 -138 c-21 -76 -39 -140 -40 -141 -6 -5 -814 377 -823 390 -6 7 -19 46 -29 86 -10 41 -25 81 -33 91 -8 9 -57 35 -109 59 -52 23 -93 46 -92 51 2 4 233 169 513 366 l510 358 26 -46 c15 -25 88 -136 162 -247z m-1108 -898 c61 21 88 26 107 19 14 -5 204 -92 421 -194 l395 -185 -27 -35 c-15 -19 -53 -72 -84 -117 l-57 -81 30 -90 c39 -117 40 -179 2 -253 -45 -90 -147 -145 -347 -189 -71 -15 -435 -59 -600 -73 l-29 -2 -37 540 c-20 297 -40 581 -43 632 l-7 92 98 -46 97 -46 81 28z" />
|
||||
Geometry="M1518 3378 c-48 -63 -61 -101 -66 -184 -4 -70 -1 -91 27 -170 l31 -89 -27 -20 c-32 -24 -849 -601 -981 -693 l-93 -64 -87 40 c-48 22 -91 37 -95 32 -5 -4 9 -41 29 -83 l37 -75 -28 -24 c-23 -20 -29 -35 -33 -81 l-4 -56 -82 -19 c-109 -25 -109 -41 4 -91 l85 -38 7 -64 c15 -137 90 -1279 85 -1293 -3 -7 -35 -24 -70 -35 -159 -53 -257 -168 -257 -302 0 -35 2 -38 47 -53 54 -18 185 -21 232 -5 29 10 31 14 31 58 0 26 6 56 14 66 13 18 15 18 46 -8 44 -37 78 -35 119 7 l34 35 -17 41 c-9 23 -12 39 -6 35 6 -4 43 -1 83 6 39 6 219 14 398 18 l327 6 113 57 c158 78 256 166 317 282 24 46 27 62 27 152 0 98 -1 103 -41 184 l-42 83 44 69 c24 37 51 68 59 68 9 0 44 -14 78 -32 l62 -31 -93 -44 c-58 -26 -92 -48 -90 -55 9 -27 353 -68 570 -68 108 0 108 0 108 24 0 34 -105 171 -220 286 -122 122 -238 216 -250 204 -6 -6 -1 -42 16 -98 14 -49 23 -91 19 -94 -3 -3 -36 9 -73 27 l-69 33 24 71 c13 39 23 76 23 82 0 6 28 17 63 24 279 58 399 300 314 632 -32 121 -49 155 -134 255 -37 45 -106 126 -152 180 -73 87 -241 326 -241 343 0 3 15 13 32 21 21 10 35 25 40 45 15 60 -16 103 -81 108 -43 3 -39 22 14 74 l45 43 -25 50 c-35 69 -77 114 -130 139 -63 30 -88 27 -117 -11z m215 -835 c188 -279 250 -417 250 -548 0 -133 -74 -214 -243 -265 l-55 -16 -37 -138 c-21 -76 -39 -140 -40 -141 -6 -5 -814 377 -823 390 -6 7 -19 46 -29 86 -10 41 -25 81 -33 91 -8 9 -57 35 -109 59 -52 23 -93 46 -92 51 2 4 233 169 513 366 l510 358 26 -46 c15 -25 88 -136 162 -247z m-1108 -898 c61 21 88 26 107 19 14 -5 204 -92 421 -194 l395 -185 -27 -35 c-15 -19 -53 -72 -84 -117 l-57 -81 30 -90 c39 -117 40 -179 2 -253 -45 -90 -147 -145 -347 -189 -71 -15 -435 -59 -600 -73 l-29 -2 -37 540 c-20 297 -40 581 -43 632 l-7 92 98 -46 97 -46 81 28z" />
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<packages>
|
||||
<package id="Caliburn.Micro" version="3.0.1" targetFramework="net452" />
|
||||
<package id="Caliburn.Micro.Core" version="3.0.1" targetFramework="net452" />
|
||||
|
||||
@ -16,133 +16,131 @@ namespace ChromaSDK
|
||||
//! Razer Blackwidow Chroma device.
|
||||
// {2EA1BB63-CA28-428D-9F06-196B88330BBB}
|
||||
static const GUID BLACKWIDOW_CHROMA =
|
||||
{ 0x2ea1bb63, 0xca28, 0x428d,{ 0x9f, 0x06, 0x19, 0x6b, 0x88, 0x33, 0x0b, 0xbb } };
|
||||
{0x2ea1bb63, 0xca28, 0x428d,{0x9f, 0x06, 0x19, 0x6b, 0x88, 0x33, 0x0b, 0xbb}};
|
||||
|
||||
//! Razer Blackwidow Chroma Tournament Edition device.
|
||||
// {ED1C1B82-BFBE-418F-B49D-D03F05B149DF}
|
||||
static const GUID BLACKWIDOW_CHROMA_TE =
|
||||
{ 0xed1c1b82, 0xbfbe, 0x418f,{ 0xb4, 0x9d, 0xd0, 0x3f, 0x5, 0xb1, 0x49, 0xdf } };
|
||||
{0xed1c1b82, 0xbfbe, 0x418f,{0xb4, 0x9d, 0xd0, 0x3f, 0x5, 0xb1, 0x49, 0xdf}};
|
||||
|
||||
//! Razer Deathstalker device.
|
||||
// {18C5AD9B-4326-4828-92C4-2669A66D2283}
|
||||
static const GUID DEATHSTALKER_CHROMA =
|
||||
{ 0x18c5ad9b, 0x4326, 0x4828,{ 0x92, 0xc4, 0x26, 0x69, 0xa6, 0x6d, 0x22, 0x83 } };
|
||||
{0x18c5ad9b, 0x4326, 0x4828,{0x92, 0xc4, 0x26, 0x69, 0xa6, 0x6d, 0x22, 0x83}};
|
||||
|
||||
//! Overwatch Keyboard.
|
||||
// {872AB2A9-7959-4478-9FED-15F6186E72E4}
|
||||
static const GUID OVERWATCH_KEYBOARD =
|
||||
{ 0x872ab2a9, 0x7959, 0x4478,{ 0x9f, 0xed, 0x15, 0xf6, 0x18, 0x6e, 0x72, 0xe4 } };
|
||||
{0x872ab2a9, 0x7959, 0x4478,{0x9f, 0xed, 0x15, 0xf6, 0x18, 0x6e, 0x72, 0xe4}};
|
||||
|
||||
//! Razer Blackwidow X Chroma device.
|
||||
// {5AF60076-ADE9-43D4-B574-52599293B554}
|
||||
static const GUID BLACKWIDOW_X_CHROMA =
|
||||
{ 0x5af60076, 0xade9, 0x43d4,{ 0xb5, 0x74, 0x52, 0x59, 0x92, 0x93, 0xb5, 0x54 } };
|
||||
{0x5af60076, 0xade9, 0x43d4,{0xb5, 0x74, 0x52, 0x59, 0x92, 0x93, 0xb5, 0x54}};
|
||||
|
||||
//! Razer Blackwidow X TE Chroma device.
|
||||
// {2D84DD51-3290-4AAC-9A89-D8AFDE38B57C}
|
||||
static const GUID BLACKWIDOW_X_TE_CHROMA =
|
||||
{ 0x2d84dd51, 0x3290, 0x4aac,{ 0x9a, 0x89, 0xd8, 0xaf, 0xde, 0x38, 0xb5, 0x7c } };
|
||||
{0x2d84dd51, 0x3290, 0x4aac,{0x9a, 0x89, 0xd8, 0xaf, 0xde, 0x38, 0xb5, 0x7c}};
|
||||
|
||||
//! Razer Blade Stealth.
|
||||
// {C83BDFE8-E7FC-40E0-99DB-872E23F19891}
|
||||
static const GUID BLADE_STEALTH =
|
||||
{ 0xc83bdfe8, 0xe7fc, 0x40e0,{ 0x99, 0xdb, 0x87, 0x2e, 0x23, 0xf1, 0x98, 0x91 } };
|
||||
{0xc83bdfe8, 0xe7fc, 0x40e0,{0x99, 0xdb, 0x87, 0x2e, 0x23, 0xf1, 0x98, 0x91}};
|
||||
|
||||
//! Razer Blade
|
||||
// {F2BEDFAF-A0FE-4651-9D41-B6CE603A3DDD}
|
||||
static const GUID BLADE =
|
||||
{ 0xf2bedfaf, 0xa0fe, 0x4651,{ 0x9d, 0x41, 0xb6, 0xce, 0x60, 0x3a, 0x3d, 0xdd } };
|
||||
{0xf2bedfaf, 0xa0fe, 0x4651,{0x9d, 0x41, 0xb6, 0xce, 0x60, 0x3a, 0x3d, 0xdd}};
|
||||
|
||||
|
||||
// Mice
|
||||
//! Razer Deathadder Chroma device.
|
||||
// {AEC50D91-B1F1-452F-8E16-7B73F376FDF3}
|
||||
static const GUID DEATHADDER_CHROMA =
|
||||
{ 0xaec50d91, 0xb1f1, 0x452f,{ 0x8e, 0x16, 0x7b, 0x73, 0xf3, 0x76, 0xfd, 0xf3 } };
|
||||
{0xaec50d91, 0xb1f1, 0x452f,{0x8e, 0x16, 0x7b, 0x73, 0xf3, 0x76, 0xfd, 0xf3}};
|
||||
|
||||
//! Razer Mamba Chroma Tournament Edition device.
|
||||
// {7EC00450-E0EE-4289-89D5-0D879C19061A}
|
||||
static const GUID MAMBA_CHROMA_TE =
|
||||
{ 0x7ec00450, 0xe0ee, 0x4289,{ 0x89, 0xd5, 0xd, 0x87, 0x9c, 0x19, 0x6, 0x1a } };
|
||||
{0x7ec00450, 0xe0ee, 0x4289,{0x89, 0xd5, 0xd, 0x87, 0x9c, 0x19, 0x6, 0x1a}};
|
||||
|
||||
//! Razer Diamondback device.
|
||||
// {FF8A5929-4512-4257-8D59-C647BF9935D0}
|
||||
static const GUID DIAMONDBACK_CHROMA =
|
||||
{ 0xff8a5929, 0x4512, 0x4257,{ 0x8d, 0x59, 0xc6, 0x47, 0xbf, 0x99, 0x35, 0xd0 } };
|
||||
{0xff8a5929, 0x4512, 0x4257,{0x8d, 0x59, 0xc6, 0x47, 0xbf, 0x99, 0x35, 0xd0}};
|
||||
|
||||
//! Razer Mamba device.
|
||||
// {D527CBDC-EB0A-483A-9E89-66D50463EC6C}
|
||||
static const GUID MAMBA_CHROMA =
|
||||
{ 0xd527cbdc, 0xeb0a, 0x483a,{ 0x9e, 0x89, 0x66, 0xd5, 0x4, 0x63, 0xec, 0x6c } };
|
||||
{0xd527cbdc, 0xeb0a, 0x483a,{0x9e, 0x89, 0x66, 0xd5, 0x4, 0x63, 0xec, 0x6c}};
|
||||
|
||||
//! Razer Naga Epic device.
|
||||
// {D714C50B-7158-4368-B99C-601ACB985E98}
|
||||
static const GUID NAGA_EPIC_CHROMA =
|
||||
{ 0xd714c50b, 0x7158, 0x4368,{ 0xb9, 0x9c, 0x60, 0x1a, 0xcb, 0x98, 0x5e, 0x98 } };
|
||||
{0xd714c50b, 0x7158, 0x4368,{0xb9, 0x9c, 0x60, 0x1a, 0xcb, 0x98, 0x5e, 0x98}};
|
||||
|
||||
//! Razer Naga device.
|
||||
// {F1876328-6CA4-46AE-BE04-BE812B414433}
|
||||
static const GUID NAGA_CHROMA =
|
||||
{ 0xf1876328, 0x6ca4, 0x46ae,{ 0xbe, 0x4, 0xbe, 0x81, 0x2b, 0x41, 0x44, 0x33 } };
|
||||
{0xf1876328, 0x6ca4, 0x46ae,{0xbe, 0x4, 0xbe, 0x81, 0x2b, 0x41, 0x44, 0x33}};
|
||||
|
||||
//! Razer Orochi Chroma device.
|
||||
// {52C15681-4ECE-4DD9-8A52-A1418459EB34}
|
||||
static const GUID OROCHI_CHROMA =
|
||||
{ 0x52c15681, 0x4ece, 0x4dd9,{ 0x8a, 0x52, 0xa1, 0x41, 0x84, 0x59, 0xeb, 0x34 } };
|
||||
{0x52c15681, 0x4ece, 0x4dd9,{0x8a, 0x52, 0xa1, 0x41, 0x84, 0x59, 0xeb, 0x34}};
|
||||
|
||||
//! Razer Naga Hex Chroma device.
|
||||
// {195D70F5-F285-4CFF-99F2-B8C0E9658DB4}
|
||||
static const GUID NAGA_HEX_CHROMA =
|
||||
{ 0x195d70f5, 0xf285, 0x4cff,{ 0x99, 0xf2, 0xb8, 0xc0, 0xe9, 0x65, 0x8d, 0xb4 } };
|
||||
{0x195d70f5, 0xf285, 0x4cff,{0x99, 0xf2, 0xb8, 0xc0, 0xe9, 0x65, 0x8d, 0xb4}};
|
||||
|
||||
|
||||
// Headsets
|
||||
//! Razer Kraken 7.1 Chroma device.
|
||||
// {CD1E09A5-D5E6-4A6C-A93B-E6D9BF1D2092}
|
||||
static const GUID KRAKEN71_CHROMA =
|
||||
{ 0xcd1e09a5, 0xd5e6, 0x4a6c,{ 0xa9, 0x3b, 0xe6, 0xd9, 0xbf, 0x1d, 0x20, 0x92 } };
|
||||
{0xcd1e09a5, 0xd5e6, 0x4a6c,{0xa9, 0x3b, 0xe6, 0xd9, 0xbf, 0x1d, 0x20, 0x92}};
|
||||
|
||||
//! Razer ManO'War device.
|
||||
// {DF3164D7-5408-4A0E-8A7F-A7412F26BEBF}
|
||||
static const GUID MANOWAR_HEADSET =
|
||||
{ 0xdf3164d7, 0x5408, 0x4a0e,{ 0x8a, 0x7f, 0xa7, 0x41, 0x2f, 0x26, 0xbe, 0xbf } };
|
||||
{0xdf3164d7, 0x5408, 0x4a0e,{0x8a, 0x7f, 0xa7, 0x41, 0x2f, 0x26, 0xbe, 0xbf}};
|
||||
|
||||
|
||||
// Mouse mat
|
||||
//! Razer Firefly device.
|
||||
// {80F95A94-73D2-48CA-AE9A-0986789A9AF2}
|
||||
static const GUID FIREFLY_CHROMA =
|
||||
{ 0x80f95a94, 0x73d2, 0x48ca,{ 0xae, 0x9a, 0x9, 0x86, 0x78, 0x9a, 0x9a, 0xf2 } };
|
||||
{0x80f95a94, 0x73d2, 0x48ca,{0xae, 0x9a, 0x9, 0x86, 0x78, 0x9a, 0x9a, 0xf2}};
|
||||
|
||||
|
||||
// Keypads
|
||||
//! Razer Tartarus device.
|
||||
// {00F0545C-E180-4AD1-8E8A-419061CE505E}
|
||||
static const GUID TARTARUS_CHROMA =
|
||||
{ 0xf0545c, 0xe180, 0x4ad1,{ 0x8e, 0x8a, 0x41, 0x90, 0x61, 0xce, 0x50, 0x5e } };
|
||||
{0xf0545c, 0xe180, 0x4ad1,{0x8e, 0x8a, 0x41, 0x90, 0x61, 0xce, 0x50, 0x5e}};
|
||||
|
||||
//! Razer Orbweaver device.
|
||||
// {9D24B0AB-0162-466C-9640-7A924AA4D9FD}
|
||||
static const GUID ORBWEAVER_CHROMA =
|
||||
{ 0x9d24b0ab, 0x162, 0x466c,{ 0x96, 0x40, 0x7a, 0x92, 0x4a, 0xa4, 0xd9, 0xfd } };
|
||||
{0x9d24b0ab, 0x162, 0x466c,{0x96, 0x40, 0x7a, 0x92, 0x4a, 0xa4, 0xd9, 0xfd}};
|
||||
|
||||
|
||||
// Systems
|
||||
// {35F6F18D-1AE5-436C-A575-AB44A127903A}
|
||||
static const GUID LENOVO_Y900 =
|
||||
{ 0x35f6f18d, 0x1ae5, 0x436c,{ 0xa5, 0x75, 0xab, 0x44, 0xa1, 0x27, 0x90, 0x3a } };
|
||||
{0x35f6f18d, 0x1ae5, 0x436c,{0xa5, 0x75, 0xab, 0x44, 0xa1, 0x27, 0x90, 0x3a}};
|
||||
|
||||
// {47DB1FA7-6B9B-4EE6-B6F4-4071A3B2053B}
|
||||
static const GUID LENOVO_Y27 =
|
||||
{ 0x47db1fa7, 0x6b9b, 0x4ee6,{ 0xb6, 0xf4, 0x40, 0x71, 0xa3, 0xb2, 0x5, 0x3b } };
|
||||
{0x47db1fa7, 0x6b9b, 0x4ee6,{0xb6, 0xf4, 0x40, 0x71, 0xa3, 0xb2, 0x5, 0x3b}};
|
||||
|
||||
|
||||
// Accessories
|
||||
// {0201203B-62F3-4C50-83DD-598BABD208E0}
|
||||
static const GUID CORE_CHROMA =
|
||||
{ 0x201203b, 0x62f3, 0x4c50,{ 0x83, 0xdd, 0x59, 0x8b, 0xab, 0xd2, 0x8, 0xe0 } };
|
||||
|
||||
|
||||
{0x201203b, 0x62f3, 0x4c50,{0x83, 0xdd, 0x59, 0x8b, 0xab, 0xd2, 0x8, 0xe0}};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,3 @@
|
||||
|
||||
//! \file RzErrors.h
|
||||
//! \brief Error codes for Chroma SDK. If the error is not defined here, refer to WinError.h from the Windows SDK.
|
||||
|
||||
|
||||
@ -84,7 +84,8 @@ RZRESULT CreateEffect(RZDEVICEID DeviceId, ChromaSDK::EFFECT_TYPE Effect, PRZPAR
|
||||
RZRESULT CreateKeyboardEffect(ChromaSDK::Keyboard::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID* pEffectId)
|
||||
{
|
||||
std::string res = "";
|
||||
if (Effect == Keyboard::CHROMA_CUSTOM) {
|
||||
if (Effect == Keyboard::CHROMA_CUSTOM)
|
||||
{
|
||||
res += "0|";
|
||||
auto keys = *static_cast<struct Keyboard::CUSTOM_EFFECT_TYPE*>(pParam);
|
||||
|
||||
@ -99,7 +100,8 @@ RZRESULT CreateKeyboardEffect(ChromaSDK::Keyboard::EFFECT_TYPE Effect, PRZPARAM
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Effect == Keyboard::CHROMA_CUSTOM_KEY) {
|
||||
else if (Effect == Keyboard::CHROMA_CUSTOM_KEY)
|
||||
{
|
||||
res += "1|";
|
||||
auto keys = *static_cast<struct Keyboard::CUSTOM_KEY_EFFECT_TYPE*>(pParam);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user