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
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Effects/Debug/DebugEffectView.xaml.cs b/Artemis/Artemis/Modules/Effects/Debug/DebugEffectView.xaml.cs
deleted file mode 100644
index 465ac97e3..000000000
--- a/Artemis/Artemis/Modules/Effects/Debug/DebugEffectView.xaml.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System.Windows.Controls;
-
-namespace Artemis.Modules.Effects.Debug
-{
- ///
- /// Interaction logic for DebugEffectView.xaml
- ///
- public partial class DebugEffectView : UserControl
- {
- public DebugEffectView()
- {
- InitializeComponent();
- }
- }
-}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Effects/Debug/DebugEffectViewModel.cs b/Artemis/Artemis/Modules/Effects/Debug/DebugEffectViewModel.cs
deleted file mode 100644
index 1054f0440..000000000
--- a/Artemis/Artemis/Modules/Effects/Debug/DebugEffectViewModel.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-using System;
-using System.Drawing.Drawing2D;
-using System.Windows.Media;
-using Artemis.Events;
-using Artemis.Managers;
-using Artemis.Utilities;
-using Artemis.ViewModels.Abstract;
-using Caliburn.Micro;
-
-namespace Artemis.Modules.Effects.Debug
-{
- internal sealed class DebugEffectViewModel : EffectViewModel, IHandle, IHandle
- {
- private ImageSource _imageSource;
- private string _selectedRectangleType;
-
- public DebugEffectViewModel(MainManager main, IEventAggregator events)
- : base(main, new DebugEffectModel(main, new DebugEffectSettings()))
- {
- DisplayName = "Debug Effect";
-
- events.Subscribe(this);
- MainManager.EffectManager.EffectModels.Add(EffectModel);
- }
-
- public BindableCollection RectangleTypes
- => new BindableCollection(Enum.GetNames(typeof(LinearGradientMode)));
-
- public string SelectedRectangleType
- {
- get { return _selectedRectangleType; }
- set
- {
- if (value == _selectedRectangleType) return;
- _selectedRectangleType = value;
- NotifyOfPropertyChange(() => SelectedRectangleType);
-
- ((DebugEffectSettings) EffectSettings).Type =
- (LinearGradientMode) Enum.Parse(typeof(LinearGradientMode), value);
- }
- }
-
- public ImageSource ImageSource
- {
- get { return _imageSource; }
- set
- {
- _imageSource = value;
- NotifyOfPropertyChange(() => ImageSource);
- }
- }
-
- public void Handle(ActiveEffectChanged message)
- {
- NotifyOfPropertyChange(() => EffectEnabled);
- }
-
- public void Handle(ChangeBitmap message)
- {
- ImageSource = ImageUtilities.BitmapToBitmapImage(message.Bitmap);
- }
- }
-}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Effects/TypeWave/TypeWaveViewModel.cs b/Artemis/Artemis/Modules/Effects/TypeWave/TypeWaveViewModel.cs
index 5e762899e..f422e22b6 100644
--- a/Artemis/Artemis/Modules/Effects/TypeWave/TypeWaveViewModel.cs
+++ b/Artemis/Artemis/Modules/Effects/TypeWave/TypeWaveViewModel.cs
@@ -11,9 +11,10 @@ namespace Artemis.Modules.Effects.TypeWave
: base(main, new TypeWaveModel(main, new TypeWaveSettings()))
{
DisplayName = "Type Waves";
-
events.Subscribe(this);
+
MainManager.EffectManager.EffectModels.Add(EffectModel);
+ EffectSettings = ((TypeWaveModel)EffectModel).Settings;
}
public void Handle(ActiveEffectChanged message)
diff --git a/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileDataModel.cs b/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileDataModel.cs
new file mode 100644
index 000000000..bf63a47d1
--- /dev/null
+++ b/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileDataModel.cs
@@ -0,0 +1,8 @@
+using Artemis.Models.Interfaces;
+
+namespace Artemis.Modules.Effects.WindowsProfile
+{
+ public class WindowsProfileDataModel : IDataModel
+ {
+ }
+}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileModel.cs b/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileModel.cs
new file mode 100644
index 000000000..bf15e37bc
--- /dev/null
+++ b/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileModel.cs
@@ -0,0 +1,38 @@
+using System.Collections.Generic;
+using Artemis.Managers;
+using Artemis.Models;
+using Artemis.Models.Profiles;
+
+namespace Artemis.Modules.Effects.WindowsProfile
+{
+ public class WindowsProfileModel : EffectModel
+ {
+ public WindowsProfileModel(MainManager mainManager, WindowsProfileSettings settings)
+ : base(mainManager, new WindowsProfileDataModel())
+ {
+ Name = "WindowsProfile";
+ Settings = settings;
+ }
+
+ public WindowsProfileSettings Settings { get; set; }
+
+ public override void Dispose()
+ {
+ Initialized = false;
+ }
+
+ public override void Enable()
+ {
+ Initialized = true;
+ }
+
+ public override void Update()
+ {
+ }
+
+ public override List GetRenderLayers(bool renderMice, bool renderHeadsets)
+ {
+ return Profile.GetRenderLayers(DataModel, renderMice, renderHeadsets, true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileView.xaml b/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileView.xaml
new file mode 100644
index 000000000..f5782be8a
--- /dev/null
+++ b/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileView.xaml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileView.xaml.cs b/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileView.xaml.cs
new file mode 100644
index 000000000..81b16f68d
--- /dev/null
+++ b/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileView.xaml.cs
@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace Artemis.Modules.Effects.WindowsProfile
+{
+ ///
+ /// Interaction logic for RocketLeagueView.xaml
+ ///
+ public partial class WindowsProfileView : UserControl
+ {
+ public WindowsProfileView()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileViewModel.cs b/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileViewModel.cs
new file mode 100644
index 000000000..45db154fe
--- /dev/null
+++ b/Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfileViewModel.cs
@@ -0,0 +1,76 @@
+using System.ComponentModel;
+using Artemis.InjectionFactories;
+using Artemis.Managers;
+using Artemis.Models;
+using Artemis.Modules.Effects.ProfilePreview;
+using Artemis.ViewModels.Abstract;
+using Artemis.ViewModels.Profiles;
+using Caliburn.Micro;
+
+namespace Artemis.Modules.Effects.WindowsProfile
+{
+ // TODO: This effect is a hybrid between a regular effect and a game, may want to clean this up
+ public sealed class WindowsProfileViewModel : EffectViewModel
+ {
+ public WindowsProfileViewModel(MainManager main, IEventAggregator events, IProfileEditorVmFactory pFactory,
+ ProfilePreviewModel profilePreviewModel)
+ : base(main, new WindowsProfileModel(main, new WindowsProfileSettings()))
+ {
+ DisplayName = "Windows Profile";
+ PFactory = pFactory;
+ ProfilePreviewModel = profilePreviewModel;
+ EffectSettings = ((WindowsProfileModel) EffectModel).Settings;
+
+ ProfileEditor = PFactory.CreateProfileEditorVm(events, main, (WindowsProfileModel) EffectModel,
+ ((WindowsProfileSettings) EffectSettings).LastProfile);
+ ProfilePreviewModel.Profile = ProfileEditor.SelectedProfile;
+ ProfileEditor.PropertyChanged += ProfileUpdater;
+ }
+
+ public ProfileEditorViewModel ProfileEditor { get; set; }
+
+ public IProfileEditorVmFactory PFactory { get; set; }
+ public ProfilePreviewModel ProfilePreviewModel { get; set; }
+
+ private void ProfileUpdater(object sender, PropertyChangedEventArgs e)
+ {
+ if (e.PropertyName != "SelectedProfile" && IsActive)
+ return;
+ EffectModel.Profile = ProfileEditor.SelectedProfile;
+ ProfilePreviewModel.Profile = ProfileEditor.SelectedProfile;
+
+ if (e.PropertyName != "SelectedProfile" || !ProfileEditor.ProfileViewModel.Activated ||
+ ProfileEditor.ProfileViewModel.SelectedProfile == null)
+ return;
+ ((WindowsProfileSettings) EffectSettings).LastProfile = ProfileEditor.ProfileViewModel.SelectedProfile.Name;
+ EffectSettings.Save();
+ }
+
+ protected override void OnActivate()
+ {
+ base.OnActivate();
+ ProfileEditor.ProfileViewModel.Activate();
+ }
+
+ protected override void OnDeactivate(bool close)
+ {
+ base.OnDeactivate(close);
+ ProfileEditor.ProfileViewModel.Deactivate();
+ }
+ }
+
+ public class WindowsProfileSettings : GameSettings
+ {
+ public override void Load()
+ {
+ }
+
+ public override void Save()
+ {
+ }
+
+ public override void ToDefault()
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeModel.cs b/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeModel.cs
index 437465e39..35f69761b 100644
--- a/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeModel.cs
+++ b/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeModel.cs
@@ -1,20 +1,18 @@
using System;
using System.Collections.Generic;
-using System.Drawing;
-using System.Linq;
using Artemis.Managers;
using Artemis.Models;
using Artemis.Models.Profiles;
using Artemis.Utilities.GameState;
using Newtonsoft.Json;
using Ninject.Extensions.Logging;
-using Brush = System.Windows.Media.Brush;
namespace Artemis.Modules.Games.CounterStrike
{
public class CounterStrikeModel : GameModel
{
- public CounterStrikeModel(MainManager mainManager, CounterStrikeSettings settings) : base(mainManager, settings, new CounterStrikeDataModel())
+ public CounterStrikeModel(MainManager mainManager, CounterStrikeSettings settings)
+ : base(mainManager, settings, new CounterStrikeDataModel())
{
Name = "CounterStrike";
ProcessName = "csgo";
@@ -64,12 +62,11 @@ namespace Artemis.Modules.Games.CounterStrike
Logger?.Error(ex, "Failed to deserialize CS:GO JSON");
throw;
}
-
}
- public override List GetRenderLayers(bool renderMice, bool renderHeadsets)
- {
- return Profile.GetRenderLayers(DataModel, renderMice, renderHeadsets);
+ public override List GetRenderLayers(bool renderMice, bool renderHeadsets)
+ {
+ return Profile.GetRenderLayers(DataModel, renderMice, renderHeadsets);
}
}
}
\ No newline at end of file
diff --git a/Artemis/Artemis/Utilities/Layers/Drawer.cs b/Artemis/Artemis/Utilities/Layers/Drawer.cs
index ecf3f74bf..1fe261602 100644
--- a/Artemis/Artemis/Utilities/Layers/Drawer.cs
+++ b/Artemis/Artemis/Utilities/Layers/Drawer.cs
@@ -31,7 +31,7 @@ namespace Artemis.Utilities.Layers
if (props.Animation == LayerAnimation.SlideRight)
{
s1 = new Rect(new Point(rect.X + props.AnimationProgress, rect.Y), new Size(rect.Width, rect.Height));
- s2 = new Rect(new Point(s1.X - rect.Width, rect.Y), new Size(rect.Width + 0.05, rect.Height));
+ s2 = new Rect(new Point(s1.X - rect.Width, rect.Y), new Size(rect.Width + 1, rect.Height));
}
if (props.Animation == LayerAnimation.SlideLeft)
{
@@ -99,7 +99,7 @@ namespace Artemis.Utilities.Layers
}
public static GifImage DrawGif(DrawingContext c, KeyboardPropertiesModel props, AppliedProperties applied,
- GifImage gifImage, bool update = true)
+ GifImage gifImage)
{
if (string.IsNullOrEmpty(props.GifFile))
return null;
@@ -117,8 +117,12 @@ namespace Artemis.Utilities.Layers
var gifRect = new Rect(applied.X*scale, applied.Y*scale, applied.Width*scale,
applied.Height*scale);
- var draw = update ? gifImage.GetNextFrame() : gifImage.GetFrame(0);
- c.DrawImage(ImageUtilities.BitmapToBitmapImage(new Bitmap(draw)), gifRect);
+ lock (gifImage)
+ {
+ var draw = gifImage.GetNextFrame();
+ c.DrawImage(ImageUtilities.BitmapToBitmapImage(new Bitmap(draw)), gifRect);
+ }
+
return gifImage;
}
diff --git a/Artemis/Artemis/ViewModels/Profiles/ProfileEditorViewModel.cs b/Artemis/Artemis/ViewModels/Profiles/ProfileEditorViewModel.cs
index 99699af32..41ab7572c 100644
--- a/Artemis/Artemis/ViewModels/Profiles/ProfileEditorViewModel.cs
+++ b/Artemis/Artemis/ViewModels/Profiles/ProfileEditorViewModel.cs
@@ -33,7 +33,7 @@ namespace Artemis.ViewModels.Profiles
{
public sealed class ProfileEditorViewModel : Screen, IHandle, IDropTarget
{
- private readonly GameModel _gameModel;
+ private readonly EffectModel _gameModel;
private readonly ILayerEditorVmFactory _layerEditorVmFactory;
private readonly MainManager _mainManager;
private ImageSource _keyboardPreview;
@@ -41,7 +41,7 @@ namespace Artemis.ViewModels.Profiles
private BindableCollection _profiles;
private ProfileModel _selectedProfile;
- public ProfileEditorViewModel(IEventAggregator events, MainManager mainManager, GameModel gameModel,
+ public ProfileEditorViewModel(IEventAggregator events, MainManager mainManager, EffectModel gameModel,
ProfileViewModel profileViewModel, MetroDialogService dialogService, string lastProfile,
ILayerEditorVmFactory layerEditorVmFactory)
{