Compare commits

...

12 Commits
v1.2 ... master

19 changed files with 215 additions and 173 deletions

3
.gitignore vendored
View File

@ -286,6 +286,3 @@ __pycache__/
*.btm.cs
*.odx.cs
*.xsd.cs
/NuGet.Config
/NuGet.Config
/KeyboardAudioVisualizer/NuGet.Config

View File

@ -7,7 +7,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>

View File

@ -8,6 +8,8 @@ using KeyboardAudioVisualizer.Configuration;
using KeyboardAudioVisualizer.Helper;
using KeyboardAudioVisualizer.Legacy;
using Newtonsoft.Json;
using RGB.NET.Brushes.Gradients;
using RGB.NET.Core;
using Settings = KeyboardAudioVisualizer.Configuration.Settings;
namespace KeyboardAudioVisualizer
@ -53,7 +55,11 @@ namespace KeyboardAudioVisualizer
if (settings == null)
{
settings = new Settings { Version = Settings.CURRENT_VERSION };
settings = new Settings
{
Version = Settings.CURRENT_VERSION,
Background = new LinearGradient(new GradientStop(0.5, new Color(64, 0, 0, 0)))
};
_taskbarIcon.ShowBalloonTip("Keyboard Audio-Visualizer is starting in the tray!", "Click on the icon to open the configuration.", BalloonIcon.Info);
}
else if (settings.Version != Settings.CURRENT_VERSION)

View File

@ -14,6 +14,7 @@ using RGB.NET.Devices.Corsair;
using RGB.NET.Devices.Logitech;
using RGB.NET.Devices.Novation;
using RGB.NET.Devices.Razer;
using RGB.NET.Devices.SteelSeries;
using RGB.NET.Groups;
using Point = RGB.NET.Core.Point;
using GetDecoratorFunc = System.Func<KeyboardAudioVisualizer.AudioProcessing.VisualizationProvider.VisualizationType, KeyboardAudioVisualizer.AudioProcessing.VisualizationProvider.IVisualizationProvider, RGB.NET.Core.IBrushDecorator>;
@ -71,11 +72,12 @@ namespace KeyboardAudioVisualizer
LoadDevices(surface, NovationDeviceProvider.Instance);
LoadDevices(surface, RazerDeviceProvider.Instance);
LoadDevices(surface, LogitechDeviceProvider.Instance);
LoadDevices(surface, SteelSeriesDeviceProvider.Instance);
surface.AlignDevices();
ILedGroup background = new ListLedGroup(surface.Leds);
background.Brush = new SolidColorBrush(new Color(64, 0, 0, 0)); //TODO DarthAffe 06.08.2017: A-Channel gives some kind of blur - settings!
background.Brush = new LinearGradientBrush(Settings.Background);
LinearGradient primaryGradient = Settings[VisualizationIndex.Primary].Gradient;
LinearGradient secondaryGradient = Settings[VisualizationIndex.Secondary].Gradient;

View File

@ -30,10 +30,16 @@ namespace KeyboardAudioVisualizer.Configuration
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
JObject jsonObject = JObject.Load(reader);
return new Color(jsonObject.Property("A").Value.ToObject<byte>(),
jsonObject.Property("R").Value.ToObject<byte>(),
jsonObject.Property("G").Value.ToObject<byte>(),
jsonObject.Property("B").Value.ToObject<byte>());
if (jsonObject.Property("A").Value.ToObject<double>() > 1.0) //DarthAffe 09.06.2019: Convert old Settings
return new Color(jsonObject.Property("A").Value.ToObject<byte>(),
jsonObject.Property("R").Value.ToObject<byte>(),
jsonObject.Property("G").Value.ToObject<byte>(),
jsonObject.Property("B").Value.ToObject<byte>());
else
return new Color(jsonObject.Property("A").Value.ToObject<double>(),
jsonObject.Property("R").Value.ToObject<double>(),
jsonObject.Property("G").Value.ToObject<double>(),
jsonObject.Property("B").Value.ToObject<double>());
}
#endregion

View File

@ -22,7 +22,9 @@ namespace KeyboardAudioVisualizer.Configuration
public double UpdateRate { get; set; } = 40.0;
public bool EnableAudioPrescale { get; set; } = false;
public LinearGradient Background { get; set; }
public Dictionary<VisualizationIndex, VisualizationSettings> Visualizations { get; set; } = new Dictionary<VisualizationIndex, VisualizationSettings>();
public VisualizationSettings this[VisualizationIndex visualizationIndex]
@ -86,13 +88,13 @@ namespace KeyboardAudioVisualizer.Configuration
{
case VisualizationIndex.Primary:
SelectedVisualization = VisualizationType.FrequencyBars;
Gradient = new LinearGradient(new GradientStop(0, Color.FromHSV(300, 1, 1)),
new GradientStop(0.20, Color.FromHSV(225, 1, 1)),
new GradientStop(0.35, Color.FromHSV(180, 1, 1)),
new GradientStop(0.50, Color.FromHSV(135, 1, 1)),
new GradientStop(0.65, Color.FromHSV(90, 1, 1)),
new GradientStop(0.80, Color.FromHSV(45, 1, 1)),
new GradientStop(0.95, Color.FromHSV(0, 1, 1)));
Gradient = new LinearGradient(new GradientStop(0, HSVColor.Create(300, 1, 1)),
new GradientStop(0.20, HSVColor.Create(225, 1, 1)),
new GradientStop(0.35, HSVColor.Create(180, 1, 1)),
new GradientStop(0.50, HSVColor.Create(135, 1, 1)),
new GradientStop(0.65, HSVColor.Create(90, 1, 1)),
new GradientStop(0.80, HSVColor.Create(45, 1, 1)),
new GradientStop(0.95, HSVColor.Create(0, 1, 1)));
break;
case VisualizationIndex.Secondary:

View File

@ -320,7 +320,7 @@ namespace KeyboardAudioVisualizer.Controls
private void HSVChanged()
{
Color color = Color.FromHSV(_a, _hue, _saturation, _value);
Color color = HSVColor.Create(_a, _hue, _saturation, _value);
UpdateSelectedColor(color);
SetRGB(color);
UpdateUIColors();
@ -331,7 +331,7 @@ namespace KeyboardAudioVisualizer.Controls
{
_ignorePropertyChanged = true;
_a = color.A;
_a = color.GetA();
if (_sliderAlpha != null)
_sliderAlpha.Value = _a;
@ -342,15 +342,15 @@ namespace KeyboardAudioVisualizer.Controls
{
_ignorePropertyChanged = true;
_r = color.R;
_r = color.GetR();
if (_sliderRed != null)
_sliderRed.Value = _r;
_g = color.G;
_g = color.GetG();
if (_sliderGreen != null)
_sliderGreen.Value = _g;
_b = color.B;
_b = color.GetB();
if (_sliderBlue != null)
_sliderBlue.Value = _b;
@ -361,15 +361,15 @@ namespace KeyboardAudioVisualizer.Controls
{
_ignorePropertyChanged = true;
_hue = color.Hue;
_hue = color.GetHue();
if (_sliderHue != null)
_sliderHue.Value = _hue;
_saturation = color.Saturation;
_saturation = color.GetSaturation();
if (_sliderSaturation != null)
_sliderSaturation.Value = _saturation;
_value = color.Value;
_value = color.GetValue();
if (_sliderValue != null)
_sliderValue.Value = _value;
@ -411,13 +411,13 @@ namespace KeyboardAudioVisualizer.Controls
private void UpdateUIColors()
{
Color hueColor = Color.FromHSV(_hue, 1, 1);
Color hueColor = HSVColor.Create(_hue, 1, 1);
if (_previewBrush != null)
_previewBrush.Color = WpfColor.FromArgb(_a, _r, _g, _b);
if (_selectorBrush != null)
_selectorBrush.Color = WpfColor.FromRgb(hueColor.R, hueColor.G, hueColor.B);
_selectorBrush.Color = WpfColor.FromRgb(hueColor.GetR(), hueColor.GetG(), hueColor.GetB());
if (_alphaBrush != null)
{
@ -445,36 +445,36 @@ namespace KeyboardAudioVisualizer.Controls
if (_hueBrush != null)
{
Color referenceColor1 = Color.FromHSV(0, _saturation, _value);
Color referenceColor2 = Color.FromHSV(60, _saturation, _value);
Color referenceColor3 = Color.FromHSV(120, _saturation, _value);
Color referenceColor4 = Color.FromHSV(180, _saturation, _value);
Color referenceColor5 = Color.FromHSV(240, _saturation, _value);
Color referenceColor6 = Color.FromHSV(300, _saturation, _value);
Color referenceColor1 = HSVColor.Create(0, _saturation, _value);
Color referenceColor2 = HSVColor.Create(60, _saturation, _value);
Color referenceColor3 = HSVColor.Create(120, _saturation, _value);
Color referenceColor4 = HSVColor.Create(180, _saturation, _value);
Color referenceColor5 = HSVColor.Create(240, _saturation, _value);
Color referenceColor6 = HSVColor.Create(300, _saturation, _value);
_hueBrush.GradientStops[0].Color = WpfColor.FromArgb(_a, referenceColor1.R, referenceColor1.G, referenceColor1.B);
_hueBrush.GradientStops[1].Color = WpfColor.FromArgb(_a, referenceColor2.R, referenceColor2.G, referenceColor2.B);
_hueBrush.GradientStops[2].Color = WpfColor.FromArgb(_a, referenceColor3.R, referenceColor3.G, referenceColor3.B);
_hueBrush.GradientStops[3].Color = WpfColor.FromArgb(_a, referenceColor4.R, referenceColor4.G, referenceColor4.B);
_hueBrush.GradientStops[4].Color = WpfColor.FromArgb(_a, referenceColor5.R, referenceColor5.G, referenceColor5.B);
_hueBrush.GradientStops[5].Color = WpfColor.FromArgb(_a, referenceColor6.R, referenceColor6.G, referenceColor6.B);
_hueBrush.GradientStops[6].Color = WpfColor.FromArgb(_a, referenceColor1.R, referenceColor1.G, referenceColor1.B);
_hueBrush.GradientStops[0].Color = WpfColor.FromArgb(_a, referenceColor1.GetR(), referenceColor1.GetG(), referenceColor1.GetB());
_hueBrush.GradientStops[1].Color = WpfColor.FromArgb(_a, referenceColor2.GetR(), referenceColor2.GetG(), referenceColor2.GetB());
_hueBrush.GradientStops[2].Color = WpfColor.FromArgb(_a, referenceColor3.GetR(), referenceColor3.GetG(), referenceColor3.GetB());
_hueBrush.GradientStops[3].Color = WpfColor.FromArgb(_a, referenceColor4.GetR(), referenceColor4.GetG(), referenceColor4.GetB());
_hueBrush.GradientStops[4].Color = WpfColor.FromArgb(_a, referenceColor5.GetR(), referenceColor5.GetG(), referenceColor5.GetB());
_hueBrush.GradientStops[5].Color = WpfColor.FromArgb(_a, referenceColor6.GetR(), referenceColor6.GetG(), referenceColor6.GetB());
_hueBrush.GradientStops[6].Color = WpfColor.FromArgb(_a, referenceColor1.GetR(), referenceColor1.GetG(), referenceColor1.GetB());
}
if (_saturationBrush != null)
{
Color referenceColor = Color.FromHSV(_hue, 1, _value);
Color referenceColor = HSVColor.Create(_hue, 1, _value);
_saturationBrush.GradientStops[0].Color = WpfColor.FromArgb(_a, 255, 255, 255);
_saturationBrush.GradientStops[1].Color = WpfColor.FromArgb(_a, referenceColor.R, referenceColor.G, referenceColor.B);
_saturationBrush.GradientStops[1].Color = WpfColor.FromArgb(_a, referenceColor.GetR(), referenceColor.GetG(), referenceColor.GetB());
}
if (_valueBrush != null)
{
Color referenceColor = Color.FromHSV(_hue, _saturation, 1);
Color referenceColor = HSVColor.Create(_hue, _saturation, 1);
_valueBrush.GradientStops[0].Color = WpfColor.FromArgb(_a, 0, 0, 0);
_valueBrush.GradientStops[1].Color = WpfColor.FromArgb(_a, referenceColor.R, referenceColor.G, referenceColor.B);
_valueBrush.GradientStops[1].Color = WpfColor.FromArgb(_a, referenceColor.GetR(), referenceColor.GetG(), referenceColor.GetB());
}
}

View File

@ -167,8 +167,8 @@ namespace KeyboardAudioVisualizer.Controls
private void UpdatePreviewRectangle(Rectangle rect, double referenceWidth, double referenceHeight, double from, double to,
RGB.NET.Core.Color startColor, RGB.NET.Core.Color endColor)
{
rect.Fill = new LinearGradientBrush(Color.FromArgb(startColor.A, startColor.R, startColor.G, startColor.B),
Color.FromArgb(endColor.A, endColor.R, endColor.G, endColor.B),
rect.Fill = new LinearGradientBrush(Color.FromArgb(startColor.GetA(), startColor.GetR(), startColor.GetG(), startColor.GetB()),
Color.FromArgb(endColor.GetA(), endColor.GetR(), endColor.GetG(), endColor.GetB()),
new Point(0, 0.5), new Point(1, 0.5));
//DarthAffe 09.02.2018: Forced rounding to prevent render issues on resize
@ -212,7 +212,7 @@ namespace KeyboardAudioVisualizer.Controls
private void UpdateGradientStop(ContentControl control, double referenceWidth, double referenceHeight, GradientStop stop)
{
control.Background = new SolidColorBrush(Color.FromArgb(stop.Color.A, stop.Color.R, stop.Color.G, stop.Color.B));
control.Background = new SolidColorBrush(Color.FromArgb(stop.Color.GetA(), stop.Color.GetR(), stop.Color.GetG(), stop.Color.GetB()));
Canvas.SetLeft(control, (referenceWidth * stop.Offset.Clamp(0, 1)) - (control.Width / 2.0));

View File

@ -26,6 +26,6 @@ namespace KeyboardAudioVisualizer.Decorators
#endregion
public Color ManipulateColor(Rectangle rectangle, BrushRenderTarget renderTarget, Color color) => color.SetAPercent(color.APercent * _visualizationProvider.VisualizationData[0]);
public Color ManipulateColor(Rectangle rectangle, BrushRenderTarget renderTarget, Color color) => color.SetA(color.A * _visualizationProvider.VisualizationData[0]);
}
}

View File

@ -47,58 +47,63 @@
<Reference Include="Hardcodet.Wpf.TaskbarNotification, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
</Reference>
<Reference Include="HidSharp, Version=2.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\HidSharp.2.0.1\lib\net35\HidSharp.dll</HintPath>
<Reference Include="HidSharp, Version=2.0.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\HidSharp.2.0.5\lib\net35\HidSharp.dll</HintPath>
</Reference>
<Reference Include="MathNet.Numerics, Version=3.20.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MathNet.Numerics.3.20.2\lib\net40\MathNet.Numerics.dll</HintPath>
<Reference Include="Interop.AuraServiceLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Asus.0.1.31\lib\net45\Interop.AuraServiceLib.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="MathNet.Numerics, Version=4.7.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MathNet.Numerics.4.7.0\lib\net461\MathNet.Numerics.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Brushes, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Brushes.0.0.1.65\lib\net45\RGB.NET.Brushes.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Core, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Core.0.0.1.65\lib\net45\RGB.NET.Core.dll</HintPath>
<Reference Include="RGB.NET.Brushes, Version=0.1.31.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Brushes.0.1.31\lib\net45\RGB.NET.Brushes.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Decorators, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Decorators.0.0.1.65\lib\net45\RGB.NET.Decorators.dll</HintPath>
<Reference Include="RGB.NET.Core, Version=0.1.31.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Core.0.1.31\lib\net45\RGB.NET.Core.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Devices.Asus, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Asus.0.0.1.65\lib\net45\RGB.NET.Devices.Asus.dll</HintPath>
<Reference Include="RGB.NET.Decorators, Version=0.1.31.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Decorators.0.1.31\lib\net45\RGB.NET.Decorators.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Devices.CoolerMaster, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.65\lib\net45\RGB.NET.Devices.CoolerMaster.dll</HintPath>
<Reference Include="RGB.NET.Devices.Asus, Version=0.1.31.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Asus.0.1.31\lib\net45\RGB.NET.Devices.Asus.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Devices.Corsair, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Corsair.0.0.1.65\lib\net45\RGB.NET.Devices.Corsair.dll</HintPath>
<Reference Include="RGB.NET.Devices.CoolerMaster, Version=0.1.31.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.CoolerMaster.0.1.31\lib\net45\RGB.NET.Devices.CoolerMaster.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Devices.Logitech, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Logitech.0.0.1.65\lib\net45\RGB.NET.Devices.Logitech.dll</HintPath>
<Reference Include="RGB.NET.Devices.Corsair, Version=0.1.31.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Corsair.0.1.31\lib\net45\RGB.NET.Devices.Corsair.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Devices.Msi, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Msi.0.0.1.41\lib\net45\RGB.NET.Devices.Msi.dll</HintPath>
<Reference Include="RGB.NET.Devices.Logitech, Version=0.1.31.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Logitech.0.1.31\lib\net45\RGB.NET.Devices.Logitech.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Devices.Novation, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Novation.0.0.1.65\lib\net45\RGB.NET.Devices.Novation.dll</HintPath>
<Reference Include="RGB.NET.Devices.Novation, Version=0.1.31.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Novation.0.1.31\lib\net45\RGB.NET.Devices.Novation.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Devices.Razer, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Razer.0.0.1.65\lib\net45\RGB.NET.Devices.Razer.dll</HintPath>
<Reference Include="RGB.NET.Devices.Razer, Version=0.1.31.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Razer.0.1.31\lib\net45\RGB.NET.Devices.Razer.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Groups, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Groups.0.0.1.65\lib\net45\RGB.NET.Groups.dll</HintPath>
<Reference Include="RGB.NET.Devices.SteelSeries, Version=0.1.31.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.SteelSeries.0.1.31\lib\netstandard2.0\RGB.NET.Devices.SteelSeries.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Groups, Version=0.1.31.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Groups.0.1.31\lib\net45\RGB.NET.Groups.dll</HintPath>
</Reference>
<Reference Include="Sanford.Multimedia.Midi, Version=6.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sanford.Multimedia.Midi.Standard.6.6.0\lib\net35\Sanford.Multimedia.Midi.dll</HintPath>
<HintPath>..\packages\Sanford.Multimedia.Midi.6.6.0\lib\net20\Sanford.Multimedia.Midi.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Management" />
<Reference Include="System.Numerics" />
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll</HintPath>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
@ -333,17 +338,17 @@
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Msi.0.0.1.41\build\net45\RGB.NET.Devices.Msi.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Msi.0.0.1.41\build\net45\RGB.NET.Devices.Msi.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Resources.Razer.0.1.0\build\RGB.NET.Resources.Razer.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Resources.Razer.0.1.0\build\RGB.NET.Resources.Razer.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Resources.Corsair.0.2.0\build\RGB.NET.Resources.Corsair.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Resources.Corsair.0.2.0\build\RGB.NET.Resources.Corsair.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Resources.Logitech.0.2.0\build\RGB.NET.Resources.Logitech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Resources.Logitech.0.2.0\build\RGB.NET.Resources.Logitech.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Resources.Novation.0.1.0\build\RGB.NET.Resources.Novation.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Resources.Novation.0.1.0\build\RGB.NET.Resources.Novation.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Resources.CoolerMaster.0.1.0\build\RGB.NET.Resources.CoolerMaster.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Resources.CoolerMaster.0.1.0\build\RGB.NET.Resources.CoolerMaster.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Resources.CoolerMaster.0.2.0\build\RGB.NET.Resources.CoolerMaster.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Resources.CoolerMaster.0.2.0\build\RGB.NET.Resources.CoolerMaster.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Resources.Corsair.0.3.0.234\build\RGB.NET.Resources.Corsair.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Resources.Corsair.0.3.0.234\build\RGB.NET.Resources.Corsair.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Resources.Logitech.0.3.0\build\RGB.NET.Resources.Logitech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Resources.Logitech.0.3.0\build\RGB.NET.Resources.Logitech.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Resources.Razer.0.3.2.4\build\RGB.NET.Resources.Razer.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Resources.Razer.0.3.2.4\build\RGB.NET.Resources.Razer.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Resources.Asus.0.3.0\build\RGB.NET.Resources.Asus.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Resources.Asus.0.3.0\build\RGB.NET.Resources.Asus.targets'))" />
</Target>
<Import Project="..\packages\RGB.NET.Devices.Msi.0.0.1.41\build\net45\RGB.NET.Devices.Msi.targets" Condition="Exists('..\packages\RGB.NET.Devices.Msi.0.0.1.41\build\net45\RGB.NET.Devices.Msi.targets')" />
<Import Project="..\packages\RGB.NET.Resources.Razer.0.1.0\build\RGB.NET.Resources.Razer.targets" Condition="Exists('..\packages\RGB.NET.Resources.Razer.0.1.0\build\RGB.NET.Resources.Razer.targets')" />
<Import Project="..\packages\RGB.NET.Resources.Corsair.0.2.0\build\RGB.NET.Resources.Corsair.targets" Condition="Exists('..\packages\RGB.NET.Resources.Corsair.0.2.0\build\RGB.NET.Resources.Corsair.targets')" />
<Import Project="..\packages\RGB.NET.Resources.Logitech.0.2.0\build\RGB.NET.Resources.Logitech.targets" Condition="Exists('..\packages\RGB.NET.Resources.Logitech.0.2.0\build\RGB.NET.Resources.Logitech.targets')" />
<Import Project="..\packages\RGB.NET.Resources.Novation.0.1.0\build\RGB.NET.Resources.Novation.targets" Condition="Exists('..\packages\RGB.NET.Resources.Novation.0.1.0\build\RGB.NET.Resources.Novation.targets')" />
<Import Project="..\packages\RGB.NET.Resources.CoolerMaster.0.1.0\build\RGB.NET.Resources.CoolerMaster.targets" Condition="Exists('..\packages\RGB.NET.Resources.CoolerMaster.0.1.0\build\RGB.NET.Resources.CoolerMaster.targets')" />
<Import Project="..\packages\RGB.NET.Resources.CoolerMaster.0.2.0\build\RGB.NET.Resources.CoolerMaster.targets" Condition="Exists('..\packages\RGB.NET.Resources.CoolerMaster.0.2.0\build\RGB.NET.Resources.CoolerMaster.targets')" />
<Import Project="..\packages\RGB.NET.Resources.Corsair.0.3.0.234\build\RGB.NET.Resources.Corsair.targets" Condition="Exists('..\packages\RGB.NET.Resources.Corsair.0.3.0.234\build\RGB.NET.Resources.Corsair.targets')" />
<Import Project="..\packages\RGB.NET.Resources.Logitech.0.3.0\build\RGB.NET.Resources.Logitech.targets" Condition="Exists('..\packages\RGB.NET.Resources.Logitech.0.3.0\build\RGB.NET.Resources.Logitech.targets')" />
<Import Project="..\packages\RGB.NET.Resources.Razer.0.3.2.4\build\RGB.NET.Resources.Razer.targets" Condition="Exists('..\packages\RGB.NET.Resources.Razer.0.3.2.4\build\RGB.NET.Resources.Razer.targets')" />
<Import Project="..\packages\RGB.NET.Resources.Asus.0.3.0\build\RGB.NET.Resources.Asus.targets" Condition="Exists('..\packages\RGB.NET.Resources.Asus.0.3.0\build\RGB.NET.Resources.Asus.targets')" />
</Project>

View File

@ -16,13 +16,13 @@ namespace KeyboardAudioVisualizer.Legacy
private static void UpdateTo1(Configuration.Settings settings)
{
settings.Visualizations[VisualizationIndex.Primary].Gradient = new LinearGradient(new GradientStop(0, Color.FromHSV(300, 1, 1)),
new GradientStop(0.20, Color.FromHSV(225, 1, 1)),
new GradientStop(0.35, Color.FromHSV(180, 1, 1)),
new GradientStop(0.50, Color.FromHSV(135, 1, 1)),
new GradientStop(0.65, Color.FromHSV(90, 1, 1)),
new GradientStop(0.80, Color.FromHSV(45, 1, 1)),
new GradientStop(0.95, Color.FromHSV(0, 1, 1)));
settings.Visualizations[VisualizationIndex.Primary].Gradient = new LinearGradient(new GradientStop(0, HSVColor.Create(300, 1, 1)),
new GradientStop(0.20, HSVColor.Create(225, 1, 1)),
new GradientStop(0.35, HSVColor.Create(180, 1, 1)),
new GradientStop(0.50, HSVColor.Create(135, 1, 1)),
new GradientStop(0.65, HSVColor.Create(90, 1, 1)),
new GradientStop(0.80, HSVColor.Create(45, 1, 1)),
new GradientStop(0.95, HSVColor.Create(0, 1, 1)));
settings.Visualizations[VisualizationIndex.Secondary].Gradient = new LinearGradient(new GradientStop(0.5, new Color(255, 255, 255)));

View File

@ -49,5 +49,5 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.3.1.1")]
[assembly: AssemblyFileVersion("1.3.1.1")]

View File

@ -163,60 +163,70 @@
<TabItem Header="Settings">
<AdornerDecorator>
<GroupBox VerticalAlignment="Top">
<StackPanel Orientation="Vertical">
<Grid>
<Grid.Resources>
<Style BasedOn="{StaticResource StyleLabelForm}" TargetType="Label" />
<Style BasedOn="{StaticResource StyleTextBlockForm}" TargetType="TextBlock" />
<Style BasedOn="{StaticResource StyleListBoxForm}" TargetType="ListBox" />
</Grid.Resources>
<DockPanel LastChildFill="False">
<DockPanel.Resources>
<Style BasedOn="{StaticResource StyleLabelForm}" TargetType="Label" />
<Style BasedOn="{StaticResource StyleTextBlockForm}" TargetType="TextBlock" />
<Style BasedOn="{StaticResource StyleListBoxForm}" TargetType="ListBox" />
</DockPanel.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="8" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="8" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<GroupBox DockPanel.Dock="Top">
<controls:Form>
<Label controls:Form.IsLabel="True" Content="Version" />
<TextBlock Text="{Binding Version}" />
<controls:Form Grid.Column="0">
<Label controls:Form.IsLabel="True" Content="Version:" />
<TextBlock Text="{Binding Version}" />
<Label controls:Form.IsLabel="True" Content="Update-Rate" />
<Slider Minimum="1" Maximum="60" controls:Form.Fill="True" IsSnapToTickEnabled="True" TickFrequency="1" TickPlacement="BottomRight"
Value="{Binding UpdateRate}"
attached:SliderValue.Unit="FPS"
ToolTip="Defines how fast the data is updated.&#x0a;Low values can reduce CPU-usage but will cause stuttering.&#x0a;Values above 40 will only affect the internal calculations and wont make the keyboard update faster.&#x0a;It's not recommended to select a value > 40." />
<Label controls:Form.IsLabel="True" Content="Update-Rate" />
<Slider Minimum="1" Maximum="60" controls:Form.Fill="True" IsSnapToTickEnabled="True" TickFrequency="1" TickPlacement="BottomRight"
Value="{Binding UpdateRate}"
attached:SliderValue.Unit="FPS"
ToolTip="Defines how fast the data is updated.&#x0a;Low values can reduce CPU-usage but will cause stuttering.&#x0a;Values above 40 will only affect the internal calculations and wont make the keyboard update faster.&#x0a;It's not recommended to select a value > 40." />
<Label controls:Form.IsLabel="True" Content="Fix Volume" />
<CheckBox VerticalAlignment="Center"
IsChecked="{Binding EnableAudioPrescale}"
ToolTip="Scales the audio signal inverse to the OS-master-volume.&#x0a;This might (depending on the system) lead to decrased performance&#x0a; -> only activate it if you need it." />
<Label controls:Form.IsLabel="True" Content="Fix Volume" />
<CheckBox VerticalAlignment="Center"
IsChecked="{Binding EnableAudioPrescale}"
ToolTip="Scales the audio signal inverse to the OS-master-volume.&#x0a;This might (depending on the system) lead to decrased performance&#x0a; -> only activate it if you need it." />
</controls:Form>
</GroupBox>
<Label controls:Form.LineBreaks="1" controls:Form.IsLabel="True" Content="Devices:" />
</controls:Form>
</Grid>
<GroupBox Margin="0,8,0,0" DockPanel.Dock="Top">
<StackPanel Orientation="Vertical">
<Border HorizontalAlignment="Left" Width="111">
<Label HorizontalAlignment="Right"
Content="Background" />
</Border>
<!-- TODO DarthAffe 05.08.2017: Fix the formular to support that use-case -->
<ItemsControl VerticalAlignment="Top" HorizontalAlignment="Left" Margin="120,-22,0,0" ItemsSource="{Binding Source={x:Static core:RGBSurface.Instance}, Path=Devices}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Style="{StaticResource StyleTextBlockForm}">
<TextBlock.Text>
<MultiBinding StringFormat="> {0} {1} ({2})">
<Binding Path="DeviceInfo.Manufacturer" />
<Binding Path="DeviceInfo.Model" />
<Binding Path="DeviceInfo.DeviceType" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</GroupBox>
<controls:GradientEditor Margin="120,-18,0,0"
Gradient="{Binding Source={x:Static keyboardAudioVisualizer:ApplicationManager.Instance}, Path=Settings.Background}"
ToolTip="Defines the gradient used as the background. Use transparency to create some kind of blur. Usage:&#x0a; Left click inside the preview to add a new stop.&#x0a; Left-click stop to change the color or move it.&#x0a; Right-click stop to remove it.&#x0a;" />
</StackPanel>
</GroupBox>
<GroupBox Margin="0,8,0,0" DockPanel.Dock="Top">
<StackPanel Orientation="Vertical">
<Border HorizontalAlignment="Left" Width="111">
<Label HorizontalAlignment="Right"
Content="Devices" />
</Border>
<ItemsControl VerticalAlignment="Top" HorizontalAlignment="Left" Margin="120,-18,0,0" ItemsSource="{Binding Source={x:Static core:RGBSurface.Instance}, Path=Devices}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Style="{StaticResource StyleTextBlockForm}">
<TextBlock.Text>
<MultiBinding StringFormat="> {0} {1} ({2})">
<Binding Path="DeviceInfo.Manufacturer" />
<Binding Path="DeviceInfo.Model" />
<Binding Path="DeviceInfo.DeviceType" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</GroupBox>
</DockPanel>
</AdornerDecorator>
</TabItem>
</TabControl>

View File

@ -116,7 +116,7 @@ namespace KeyboardAudioVisualizer.UI.Visualization
GradientStopCollection gradientStops = new GradientStopCollection();
foreach (RGB.NET.Brushes.Gradients.GradientStop stop in _gradient.GradientStops)
gradientStops.Add(new System.Windows.Media.GradientStop(System.Windows.Media.Color.FromArgb(stop.Color.A, stop.Color.R, stop.Color.G, stop.Color.B), stop.Offset));
gradientStops.Add(new System.Windows.Media.GradientStop(System.Windows.Media.Color.FromArgb(stop.Color.GetA(), stop.Color.GetR(), stop.Color.GetG(), stop.Color.GetB()), stop.Offset));
Brush = new LinearGradientBrush(gradientStops, new System.Windows.Point(0, 0.5), new System.Windows.Point(1, 0.5));
}

View File

@ -151,7 +151,7 @@ namespace KeyboardAudioVisualizer.UI.Visualization
for (int i = 0; i < _bars.Length; i++)
{
RGB.NET.Core.Color color = _gradient.GetColor((double)i / _bars.Length);
_bars[i].Fill = new SolidColorBrush(Color.FromRgb(color.R, color.G, color.B));
_bars[i].Fill = new SolidColorBrush(Color.FromRgb(color.GetR(), color.GetG(), color.GetB()));
}
}

View File

@ -113,7 +113,7 @@ namespace KeyboardAudioVisualizer.UI.Visualization
GradientStopCollection gradientStops = new GradientStopCollection();
foreach (GradientStop stop in _gradient.GradientStops)
gradientStops.Add(new System.Windows.Media.GradientStop(Color.FromArgb(stop.Color.A, stop.Color.R, stop.Color.G, stop.Color.B), stop.Offset));
gradientStops.Add(new System.Windows.Media.GradientStop(Color.FromArgb(stop.Color.GetA(), stop.Color.GetR(), stop.Color.GetG(), stop.Color.GetB()), stop.Offset));
BrushLeft = new LinearGradientBrush(gradientStops, new Point(1, 0.5), new Point(0, 0.5));
BrushRight = new LinearGradientBrush(gradientStops, new Point(0, 0.5), new Point(1, 0.5));

View File

@ -2,30 +2,28 @@
<packages>
<package id="CSCore" version="1.2.1.2" targetFramework="net461" />
<package id="Hardcodet.NotifyIcon.Wpf" version="1.0.8" targetFramework="net461" />
<package id="HidSharp" version="2.0.1" targetFramework="net461" />
<package id="MathNet.Numerics" version="3.20.2" targetFramework="net461" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net461" />
<package id="RGB.NET" version="0.0.1.41" targetFramework="net461" />
<package id="RGB.NET.Brushes" version="0.0.1.65" targetFramework="net461" />
<package id="RGB.NET.Core" version="0.0.1.65" targetFramework="net461" />
<package id="RGB.NET.Decorators" version="0.0.1.65" targetFramework="net461" />
<package id="RGB.NET.Devices" version="0.0.1.41" targetFramework="net461" />
<package id="RGB.NET.Devices.Asus" version="0.0.1.65" targetFramework="net461" />
<package id="RGB.NET.Devices.CoolerMaster" version="0.0.1.65" targetFramework="net461" />
<package id="RGB.NET.Devices.Corsair" version="0.0.1.65" targetFramework="net461" />
<package id="RGB.NET.Devices.Logitech" version="0.0.1.65" targetFramework="net461" />
<package id="RGB.NET.Devices.Msi" version="0.0.1.41" targetFramework="net461" />
<package id="RGB.NET.Devices.Novation" version="0.0.1.65" targetFramework="net461" />
<package id="RGB.NET.Devices.Razer" version="0.0.1.65" targetFramework="net461" />
<package id="RGB.NET.Groups" version="0.0.1.65" targetFramework="net461" />
<package id="RGB.NET.Presets" version="0.0.1.41" targetFramework="net461" />
<package id="RGB.NET.Resources.CoolerMaster" version="0.1.0" targetFramework="net461" />
<package id="RGB.NET.Resources.Corsair" version="0.2.0" targetFramework="net461" />
<package id="RGB.NET.Resources.Logitech" version="0.2.0" targetFramework="net461" />
<package id="HidSharp" version="2.0.5" targetFramework="net461" />
<package id="MathNet.Numerics" version="4.7.0" targetFramework="net461" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net461" />
<package id="RGB.NET.Brushes" version="0.1.31" targetFramework="net461" />
<package id="RGB.NET.Core" version="0.1.31" targetFramework="net461" />
<package id="RGB.NET.Decorators" version="0.1.31" targetFramework="net461" />
<package id="RGB.NET.Devices.Asus" version="0.1.31" targetFramework="net461" />
<package id="RGB.NET.Devices.CoolerMaster" version="0.1.31" targetFramework="net461" />
<package id="RGB.NET.Devices.Corsair" version="0.1.31" targetFramework="net461" />
<package id="RGB.NET.Devices.Logitech" version="0.1.31" targetFramework="net461" />
<package id="RGB.NET.Devices.Novation" version="0.1.31" targetFramework="net461" />
<package id="RGB.NET.Devices.Razer" version="0.1.31" targetFramework="net461" />
<package id="RGB.NET.Devices.SteelSeries" version="0.1.31" targetFramework="net461" />
<package id="RGB.NET.Groups" version="0.1.31" targetFramework="net461" />
<package id="RGB.NET.Resources.Asus" version="0.3.0" targetFramework="net461" />
<package id="RGB.NET.Resources.CoolerMaster" version="0.2.0" targetFramework="net461" />
<package id="RGB.NET.Resources.Corsair" version="0.3.0.234" targetFramework="net461" />
<package id="RGB.NET.Resources.Logitech" version="0.3.0" targetFramework="net461" />
<package id="RGB.NET.Resources.Novation" version="0.1.0" targetFramework="net461" />
<package id="RGB.NET.Resources.Razer" version="0.1.0" targetFramework="net461" />
<package id="Sanford.Multimedia.Midi" version="6.5.0" targetFramework="net461" />
<package id="RGB.NET.Resources.Razer" version="0.3.2.4" targetFramework="net461" />
<package id="Sanford.Multimedia.Midi" version="6.6.0" targetFramework="net461" />
<package id="Sanford.Multimedia.Midi.Standard" version="6.6.0" targetFramework="net461" />
<package id="System.Management" version="4.5.0" targetFramework="net461" />
<package id="System.ValueTuple" version="4.4.0" targetFramework="net461" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
</packages>

12
NuGet.Config Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="RGB.NET" value="http://nuget.arge.be/v3/index.json" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>

View File

@ -1,3 +1,7 @@
This software is no longer actively developed.
Consider checking out [Artemis](https://github.com/Artemis-RGB/Artemis) for a even more feature rich replacement.
# KeyboardAudioVisualizer
It's colorful - I like it!