Core - Add HidSharp to force plugins to share the HidSharp types

Core - For now, set default log level to debug
ColorGradient- Improved GetColor performance
ColorGradient - GetColor now handles colors not between two stops properly
Home - Fix links
Plugins - Only allow layer property registration through Brushes
Color brush - Default to solid color
This commit is contained in:
SpoinkyNL committed 2020-04-21 19:59:05 +02:00
1 parent 8c3212451b
commit 9f8fc9f70e
21 files changed
+279 -172

No files matched your search

+1 -1
View File
@@ -38,7 +38,7 @@ namespace Artemis.Core.Services
_rgbService = rgbService;
_surfaceService = surfaceService;
_profileService = profileService;
_loggingLevel = settingsService.GetSetting("Core.LoggingLevel", LogEventLevel.Information);
_loggingLevel = settingsService.GetSetting("Core.LoggingLevel", LogEventLevel.Debug);
_rgbService.Surface.Updating += SurfaceOnUpdating;
_rgbService.Surface.Updated += SurfaceOnUpdated;
@@ -28,6 +28,8 @@ namespace Artemis.Core.Services.Interfaces
/// </summary>
IReadOnlyCollection<IRGBDevice> LoadedDevices { get; }
TimerUpdateTrigger UpdateTrigger { get; }
/// <summary>
/// Adds the given device provider to the <see cref="Surface" />
/// </summary>
+6 -8
View File
@@ -20,7 +20,6 @@ namespace Artemis.Core.Services
private readonly PluginSetting<double> _renderScaleSetting;
private readonly PluginSetting<int> _sampleSizeSetting;
private readonly PluginSetting<int> _targetFrameRateSetting;
private readonly TimerUpdateTrigger _updateTrigger;
private ListLedGroup _surfaceLedGroup;
internal RgbService(ILogger logger, ISettingsService settingsService)
@@ -37,17 +36,16 @@ namespace Artemis.Core.Services
_renderScaleSetting.SettingChanged += RenderScaleSettingOnSettingChanged;
_targetFrameRateSetting.SettingChanged += TargetFrameRateSettingOnSettingChanged;
_loadedDevices = new List<IRGBDevice>();
_updateTrigger = new TimerUpdateTrigger {UpdateFrequency = 1.0 / _targetFrameRateSetting.Value};
Surface.RegisterUpdateTrigger(_updateTrigger);
UpdateTrigger = new TimerUpdateTrigger {UpdateFrequency = 1.0 / _targetFrameRateSetting.Value};
Surface.RegisterUpdateTrigger(UpdateTrigger);
}
/// <inheritdoc />
public RGBSurface Surface { get; set; }
public TimerUpdateTrigger UpdateTrigger { get; }
public BitmapBrush BitmapBrush { get; private set; }
public IReadOnlyCollection<IRGBDevice> LoadedDevices => _loadedDevices.AsReadOnly();
public double RenderScale => _renderScaleSetting.Value;
public void AddDeviceProvider(IRGBDeviceProvider deviceProvider)
@@ -82,9 +80,9 @@ namespace Artemis.Core.Services
public void Dispose()
{
Surface.UnregisterUpdateTrigger(_updateTrigger);
Surface.UnregisterUpdateTrigger(UpdateTrigger);
_updateTrigger.Dispose();
UpdateTrigger.Dispose();
Surface.Dispose();
}
@@ -95,7 +93,7 @@ namespace Artemis.Core.Services
private void TargetFrameRateSettingOnSettingChanged(object sender, EventArgs e)
{
_updateTrigger.UpdateFrequency = 1.0 / _targetFrameRateSetting.Value;
UpdateTrigger.UpdateFrequency = 1.0 / _targetFrameRateSetting.Value;
}
private void SurfaceOnException(ExceptionEventArgs args)
@@ -95,6 +95,7 @@ namespace Artemis.Core.Services.Storage
// Update the RGB service's graphics decorator to work with the new surface entity
_rgbService.UpdateSurfaceLedGroup();
OnActiveSurfaceConfigurationChanged(new SurfaceConfigurationEventArgs(ActiveSurface));
}
public void UpdateSurfaceConfiguration(ArtemisSurface surface, bool includeDevices)