diff --git a/Artemis/Artemis/Artemis.csproj b/Artemis/Artemis/Artemis.csproj index aca8d8e50..9320a58b6 100644 --- a/Artemis/Artemis/Artemis.csproj +++ b/Artemis/Artemis/Artemis.csproj @@ -335,7 +335,12 @@ - + + WindowsProfileView.xaml + + + + TypeWave.settings @@ -408,7 +413,6 @@ - @@ -468,7 +472,6 @@ - @@ -498,9 +501,6 @@ FlyoutSettingsView.xaml - - DebugEffectView.xaml - AudioVisualizerView.xaml @@ -658,6 +658,10 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + Designer MSBuild:Compile @@ -686,10 +690,6 @@ Designer MSBuild:Compile - - MSBuild:Compile - Designer - Designer MSBuild:Compile diff --git a/Artemis/Artemis/DAL/ProfileProvider.cs b/Artemis/Artemis/DAL/ProfileProvider.cs index 15e418c0a..0207e7a03 100644 --- a/Artemis/Artemis/DAL/ProfileProvider.cs +++ b/Artemis/Artemis/DAL/ProfileProvider.cs @@ -31,7 +31,7 @@ namespace Artemis.DAL /// The game to match /// The keyboard to match /// All profiles matching the provided game - public static List GetAll(GameModel game, KeyboardProvider keyboard) + public static List GetAll(EffectModel game, KeyboardProvider keyboard) { if (game == null) throw new ArgumentNullException(nameof(game)); diff --git a/Artemis/Artemis/DeviceProviders/Corsair/CorsairHeadsets.cs b/Artemis/Artemis/DeviceProviders/Corsair/CorsairHeadsets.cs index 82059c24f..40edac5fc 100644 --- a/Artemis/Artemis/DeviceProviders/Corsair/CorsairHeadsets.cs +++ b/Artemis/Artemis/DeviceProviders/Corsair/CorsairHeadsets.cs @@ -58,7 +58,8 @@ namespace Artemis.DeviceProviders.Corsair ledIndex++; } - CueSDK.HeadsetSDK.Update(); + // Flush is required for headset to work reliably on CUE2 for some reason + CueSDK.HeadsetSDK.Update(true); } private static bool CanInitializeSdk() diff --git a/Artemis/Artemis/InjectionFactories/IProfileEditorVmFactory.cs b/Artemis/Artemis/InjectionFactories/IProfileEditorVmFactory.cs index c6bc58d58..85fac1570 100644 --- a/Artemis/Artemis/InjectionFactories/IProfileEditorVmFactory.cs +++ b/Artemis/Artemis/InjectionFactories/IProfileEditorVmFactory.cs @@ -8,6 +8,6 @@ namespace Artemis.InjectionFactories public interface IProfileEditorVmFactory { ProfileEditorViewModel CreateProfileEditorVm(IEventAggregator events, MainManager mainManager, - GameModel gameModel, string lastProfile); + EffectModel gameModel, string lastProfile); } } \ No newline at end of file diff --git a/Artemis/Artemis/InjectionModules/ArtemisModules.cs b/Artemis/Artemis/InjectionModules/ArtemisModules.cs index 13f0c3772..368eca467 100644 --- a/Artemis/Artemis/InjectionModules/ArtemisModules.cs +++ b/Artemis/Artemis/InjectionModules/ArtemisModules.cs @@ -3,8 +3,8 @@ using Artemis.DeviceProviders.Corsair; using Artemis.DeviceProviders.Logitech; using Artemis.DeviceProviders.Razer; using Artemis.Modules.Effects.AudioVisualizer; -using Artemis.Modules.Effects.Debug; using Artemis.Modules.Effects.TypeWave; +using Artemis.Modules.Effects.WindowsProfile; using Artemis.Modules.Games.CounterStrike; using Artemis.Modules.Games.Dota2; using Artemis.Modules.Games.Overwatch; @@ -25,8 +25,8 @@ namespace Artemis.InjectionModules // Effects Bind().To().InSingletonScope(); - Bind().To().InSingletonScope(); Bind().To().InSingletonScope(); + Bind().To().InSingletonScope(); //Bind().To().InSingletonScope(); // Games diff --git a/Artemis/Artemis/Managers/MainManager.cs b/Artemis/Artemis/Managers/MainManager.cs index fee8dea5e..946116d01 100644 --- a/Artemis/Artemis/Managers/MainManager.cs +++ b/Artemis/Artemis/Managers/MainManager.cs @@ -82,6 +82,7 @@ namespace Artemis.Managers _processTimer.Stop(); _processTimer.Dispose(); LoopManager.Stop(); + EffectManager.ActiveEffect.Dispose(); GameStateWebServer.Stop(); PipeServer.Stop(); } diff --git a/Artemis/Artemis/Modules/Effects/AudioVisualizer/AudioVisualizerModel.cs b/Artemis/Artemis/Modules/Effects/AudioVisualizer/AudioVisualizerModel.cs index 0c05a8a76..806f5864a 100644 --- a/Artemis/Artemis/Modules/Effects/AudioVisualizer/AudioVisualizerModel.cs +++ b/Artemis/Artemis/Modules/Effects/AudioVisualizer/AudioVisualizerModel.cs @@ -51,6 +51,8 @@ namespace Artemis.Modules.Effects.AudioVisualizer _sampleAggregator.PerformFFT = false; _sampleAggregator.FftCalculated -= FftCalculated; + if (_waveIn == null) + return; _waveIn.StopRecording(); _waveIn.DataAvailable -= OnDataAvailable; _waveIn = null; diff --git a/Artemis/Artemis/Modules/Effects/AudioVisualizer/AudioVisualizerViewModel.cs b/Artemis/Artemis/Modules/Effects/AudioVisualizer/AudioVisualizerViewModel.cs index 483cb1b98..11a70a0f0 100644 --- a/Artemis/Artemis/Modules/Effects/AudioVisualizer/AudioVisualizerViewModel.cs +++ b/Artemis/Artemis/Modules/Effects/AudioVisualizer/AudioVisualizerViewModel.cs @@ -11,9 +11,10 @@ namespace Artemis.Modules.Effects.AudioVisualizer : base(main, new AudioVisualizerModel(main, new AudioVisualizerSettings())) { DisplayName = "Audio Visualization"; - events.Subscribe(this); + MainManager.EffectManager.EffectModels.Add(EffectModel); + EffectSettings = ((AudioVisualizerModel)EffectModel).Settings; } public void Handle(ActiveEffectChanged message) diff --git a/Artemis/Artemis/Modules/Effects/Debug/DebugEffectModel.cs b/Artemis/Artemis/Modules/Effects/Debug/DebugEffectModel.cs deleted file mode 100644 index 232f9daf4..000000000 --- a/Artemis/Artemis/Modules/Effects/Debug/DebugEffectModel.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Drawing2D; -using Artemis.Managers; -using Artemis.Models; -using Artemis.Models.Profiles; -using Artemis.Utilities.Keyboard; -using Brush = System.Windows.Media.Brush; - -namespace Artemis.Modules.Effects.Debug -{ - // TODO: Remove - internal class DebugEffectModel : EffectModel - { - public DebugEffectModel(MainManager mainManager, DebugEffectSettings settings) : base(mainManager, null) - { - Name = "Debug Effect"; - Settings = settings; - Scale = 4; - Initialized = false; - } - - public int Scale { get; set; } - - public DebugEffectSettings Settings { get; set; } - - public KeyboardRectangle KeyboardRectangle { get; set; } - - public override void Dispose() - { - Initialized = false; - } - - public override void Enable() - { - Initialized = false; - - KeyboardRectangle = new KeyboardRectangle(MainManager.DeviceManager.ActiveKeyboard, 0, 0, new List - { - Color.FromArgb(0, 226, 190), - Color.FromArgb(0, 208, 255) - }, LinearGradientMode.Horizontal); - - Initialized = true; - } - - public override void Update() - { - KeyboardRectangle.Height = Settings.Height; - KeyboardRectangle.Width = Settings.Width; - KeyboardRectangle.GradientMode = Settings.Type; - KeyboardRectangle.Rotate = Settings.Rotate; - KeyboardRectangle.Scale = Settings.Scale; - Scale = Settings.Scale; - } - - public override List GetRenderLayers(bool renderMice, bool renderHeadsets) - { - return null; - } - - public override void Render(out Bitmap keyboard, out Brush mouse, out Brush headset, bool renderMice, bool renderHeadsets) - { - mouse = null; - headset = null; - - keyboard = MainManager.DeviceManager.ActiveKeyboard.KeyboardBitmap(Scale); - using (var g = Graphics.FromImage(keyboard)) - { - g.Clear(Color.Transparent); - KeyboardRectangle.Draw(g); - } - } - } -} \ No newline at end of file diff --git a/Artemis/Artemis/Modules/Effects/Debug/DebugEffectSettings.cs b/Artemis/Artemis/Modules/Effects/Debug/DebugEffectSettings.cs deleted file mode 100644 index 48e8a2767..000000000 --- a/Artemis/Artemis/Modules/Effects/Debug/DebugEffectSettings.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Drawing.Drawing2D; -using Artemis.Models; - -namespace Artemis.Modules.Effects.Debug -{ - internal class DebugEffectSettings : EffectSettings - { - public DebugEffectSettings() - { - Load(); - } - - public int Width { get; set; } - public int Height { get; set; } - public bool Rotate { get; set; } - public int Scale { get; set; } - public LinearGradientMode Type { get; set; } - - public sealed override void Load() - { - ToDefault(); - } - - public sealed override void Save() - { - } - - public sealed override void ToDefault() - { - Width = 84; - Height = 24; - Scale = 4; - Type = LinearGradientMode.Horizontal; - Rotate = true; - } - } -} \ No newline at end of file diff --git a/Artemis/Artemis/Modules/Effects/Debug/DebugEffectView.xaml b/Artemis/Artemis/Modules/Effects/Debug/DebugEffectView.xaml deleted file mode 100644 index 02b601d2f..000000000 --- a/Artemis/Artemis/Modules/Effects/Debug/DebugEffectView.xaml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Color gradient direction - - - - - - Debug-rectangle width - - - - - - Debug-rectangle height - - - - - - Debug-rectangle scale (higher means more fluent) - - - - - - Rotate colors on debug-rectangle - - - - - - - - - - - - - - - - -