Compare commits

...

17 Commits
v1.1 ... master

25 changed files with 309 additions and 246 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>;
@ -37,6 +38,8 @@ namespace KeyboardAudioVisualizer
private readonly Dictionary<VisualizationIndex, IEnumerable<(ILedGroup group, GetDecoratorFunc getDecoratorFunc)>> _groups = new Dictionary<VisualizationIndex, IEnumerable<(ILedGroup group, GetDecoratorFunc getDecoratorFunc)>>();
public TimerUpdateTrigger UpdateTrigger { get; } = new TimerUpdateTrigger();
#endregion
#region Commands
@ -61,19 +64,20 @@ namespace KeyboardAudioVisualizer
{
RGBSurface surface = RGBSurface.Instance;
surface.UpdateFrequency = 1.0 / MathHelper.Clamp(Settings.UpdateRate, 1, 60);
surface.UpdateMode = UpdateMode.Continuous;
UpdateTrigger.UpdateFrequency = 1.0 / MathHelper.Clamp(Settings.UpdateRate, 1, 60);
surface.RegisterUpdateTrigger(UpdateTrigger);
LoadDevices(surface, CorsairDeviceProvider.Instance);
LoadDevices(surface, CoolerMasterDeviceProvider.Instance);
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;
@ -86,6 +90,7 @@ namespace KeyboardAudioVisualizer
switch (device.DeviceInfo.DeviceType)
{
case RGBDeviceType.Keyboard:
case RGBDeviceType.Keypad:
case RGBDeviceType.LedMatrix:
ListLedGroup primary = new ListLedGroup(device);
@ -113,6 +118,7 @@ namespace KeyboardAudioVisualizer
case RGBDeviceType.Mousepad:
case RGBDeviceType.LedStripe:
case RGBDeviceType.HeadsetStand:
ILedGroup left = new RectangleLedGroup(new Rectangle(device.Location.X, device.Location.Y, device.Size.Width / 2.0, device.Size.Height));
left.Brush = new LinearGradientBrush(new Point(0.5, 1), new Point(0.5, 0), tertiaryGradient);
tertiaryGroups.Add((left, (visualizationType, visualizer) => CreateDecorator(visualizationType, visualizer, LevelBarDirection.Top, 0)));
@ -124,6 +130,11 @@ namespace KeyboardAudioVisualizer
case RGBDeviceType.Mouse:
case RGBDeviceType.Headset:
case RGBDeviceType.Speaker:
case RGBDeviceType.Fan:
case RGBDeviceType.GraphicsCard:
case RGBDeviceType.DRAM:
case RGBDeviceType.Mainboard:
ILedGroup deviceGroup = new ListLedGroup(device);
deviceGroup.Brush = new LinearGradientBrush(secondaryGradient);
secondaryGroups.Add((deviceGroup, (visualizationType, visualizer) => CreateDecorator(visualizationType, visualizer)));
@ -145,7 +156,8 @@ namespace KeyboardAudioVisualizer
{
surface.LoadDevices(deviceProvider, RGBDeviceType.Keyboard | RGBDeviceType.LedMatrix
| RGBDeviceType.Mousepad | RGBDeviceType.LedStripe
| RGBDeviceType.Mouse | RGBDeviceType.Headset);
| RGBDeviceType.Mouse | RGBDeviceType.Headset
| RGBDeviceType.HeadsetStand);
}
//TODO DarthAffe 12.09.2017: This is just a big mess - is this worth to rework before arge?

View File

@ -1,4 +1,6 @@
namespace KeyboardAudioVisualizer.AudioCapture
using System;
namespace KeyboardAudioVisualizer.AudioCapture
{
public class AudioBuffer
{
@ -29,64 +31,68 @@
#region Methods
public void Put(float left, float right)
{
_currentIndex++;
if (_currentIndex >= _capacity) _currentIndex = 0;
_bufferLeft[_currentIndex] = left;
_bufferRight[_currentIndex] = right;
}
public void Put(float[] src, int offset, int count)
{
lock (_bufferLeft)
lock (_bufferRight)
if ((count & 1) != 0) return; // we expect stereo-data to be an even amount of values
if (count > _capacity)
{
offset += count - _capacity;
count = _capacity;
}
for (int i = 0; i < count; i += 2)
{
_currentIndex++;
if (_currentIndex >= _capacity) _currentIndex = 0;
if (Prescale.HasValue)
{
if ((count & 1) != 0) return; // we expect stereo-data to be an even amount of values
if (count > _capacity)
{
offset += count - _capacity;
count = _capacity;
}
for (int i = 0; i < count; i += 2)
{
_currentIndex++;
if (_currentIndex >= _capacity) _currentIndex = 0;
if (Prescale.HasValue)
{
_bufferLeft[_currentIndex] = src[offset + i] / Prescale.Value;
_bufferRight[_currentIndex] = src[offset + i + 1] / Prescale.Value;
}
else
{
_bufferLeft[_currentIndex] = src[offset + i];
_bufferRight[_currentIndex] = src[offset + i + 1];
}
}
_bufferLeft[_currentIndex] = src[offset + i] / Prescale.Value;
_bufferRight[_currentIndex] = src[offset + i + 1] / Prescale.Value;
}
else
{
_bufferLeft[_currentIndex] = src[offset + i];
_bufferRight[_currentIndex] = src[offset + i + 1];
}
}
}
public void CopyLeftInto(ref float[] data, int offset) => CopyLeftInto(ref data, offset, _capacity);
public void CopyLeftInto(ref float[] data, int offset) => CopyLeftInto(ref data, offset, Math.Min(data.Length, _capacity));
public void CopyLeftInto(ref float[] data, int offset, int count)
{
lock (_bufferLeft)
for (int i = _capacity - count; i < count; i++)
data[offset + i] = _bufferLeft[(_currentIndex + i) % _capacity];
int bufferOffset = _capacity - count;
for (int i = 0; i < count; i++)
data[offset + i] = _bufferLeft[(_currentIndex + (bufferOffset + i)) % _capacity];
}
public void CopyRightInto(ref float[] data, int offset) => CopyRightInto(ref data, offset, _capacity);
public void CopyRightInto(ref float[] data, int offset) => CopyRightInto(ref data, offset, Math.Min(data.Length, _capacity));
public void CopyRightInto(ref float[] data, int offset, int count)
{
lock (_bufferRight)
for (int i = _capacity - count; i < count; i++)
data[offset + i] = _bufferRight[(_currentIndex + i) % _capacity];
int bufferOffset = _capacity - count;
for (int i = 0; i < count; i++)
data[offset + i] = _bufferRight[(_currentIndex + (bufferOffset + i)) % _capacity];
}
public void CopyMixInto(ref float[] data, int offset) => CopyMixInto(ref data, offset, _capacity);
public void CopyMixInto(ref float[] data, int offset) => CopyMixInto(ref data, offset, Math.Min(data.Length, _capacity));
public void CopyMixInto(ref float[] data, int offset, int count)
{
lock (_bufferLeft)
lock (_bufferRight)
for (int i = _capacity - count; i < count; i++)
{
int index = (_currentIndex + i) % _capacity;
data[offset + i] = (_bufferLeft[index] + _bufferRight[index]) / 2f;
}
int bufferOffset = _capacity - count;
for (int i = 0; i < count; i++)
{
int index = (_currentIndex + (bufferOffset + i)) % _capacity;
data[offset + i] = (_bufferLeft[index] + _bufferRight[index]) / 2f;
}
}
#endregion

View File

@ -12,11 +12,10 @@ namespace KeyboardAudioVisualizer.AudioCapture
private WasapiCapture _capture;
private SoundInSource _soundInSource;
private IWaveSource _source;
private SingleBlockNotificationStream _stream;
private AudioEndpointVolume _audioEndpointVolume;
private readonly float[] _readBuffer = new float[2048];
public int SampleRate => _soundInSource?.WaveFormat?.SampleRate ?? -1;
public float MasterVolume => _audioEndpointVolume.MasterVolumeLevelScalar;
@ -38,26 +37,28 @@ namespace KeyboardAudioVisualizer.AudioCapture
//DarthAffe 07.02.2018: This is a really stupid workaround to (hopefully) finally fix the surround driver issues
for (int i = 1; i < 13; i++)
{
try
{
_capture = new WasapiLoopbackCapture(100, new WaveFormat(deviceFormat.SampleRate, deviceFormat.BitsPerSample, i));
}
catch
{ }
}
try { _capture = new WasapiLoopbackCapture(100, new WaveFormat(deviceFormat.SampleRate, deviceFormat.BitsPerSample, i)); } catch { /* We're just trying ... */ }
if (_capture == null)
throw new NullReferenceException("Failed to initialize WasapiLoopbackCapture");
_capture.Initialize();
_soundInSource = new SoundInSource(_capture) { FillWithZeros = false };
_source = _soundInSource.WaveFormat.SampleRate == 44100
? _soundInSource.ToStereo()
: _soundInSource.ChangeSampleRate(44100).ToStereo();
_stream = _soundInSource.WaveFormat.SampleRate == 44100
? new SingleBlockNotificationStream(_soundInSource.ToStereo().ToSampleSource())
: new SingleBlockNotificationStream(_soundInSource.ChangeSampleRate(44100).ToStereo().ToSampleSource());
_stream = new SingleBlockNotificationStream(_source.ToSampleSource());
_stream.SingleBlockRead += StreamOnSingleBlockRead;
_soundInSource.DataAvailable += OnSoundDataAvailable;
_source = _stream.ToWaveSource();
byte[] buffer = new byte[_source.WaveFormat.BytesPerSecond / 2];
_soundInSource.DataAvailable += (s, aEvent) =>
{
while ((_source.Read(buffer, 0, buffer.Length)) > 0) ;
};
_capture.Start();
}
@ -68,12 +69,8 @@ namespace KeyboardAudioVisualizer.AudioCapture
_capture?.Dispose();
}
private void OnSoundDataAvailable(object sender, DataAvailableEventArgs dataAvailableEventArgs)
{
int readCount;
while ((readCount = _stream.Read(_readBuffer, 0, _readBuffer.Length)) > 0)
DataAvailable?.Invoke(_readBuffer, 0, readCount);
}
private void StreamOnSingleBlockRead(object sender, SingleBlockReadEventArgs singleBlockReadEventArgs)
=> DataAvailable?.Invoke(singleBlockReadEventArgs.Left, singleBlockReadEventArgs.Right);
#endregion
}

View File

@ -2,7 +2,7 @@
namespace KeyboardAudioVisualizer.AudioCapture
{
public delegate void AudioData(float[] data, int offset, int count);
public delegate void AudioData(float left, float right);
public interface IAudioInput : IDisposable
{

View File

@ -54,7 +54,7 @@ namespace KeyboardAudioVisualizer.AudioProcessing
_audioInput.Initialize();
_audioBuffer = new AudioBuffer(4096); // Working with ~93ms -
_audioInput.DataAvailable += (data, offset, count) => _audioBuffer.Put(data, offset, count);
_audioInput.DataAvailable += (left, right) => _audioBuffer.Put(left, right);
_processors.Add(new FourierSpectrumProvider(_audioBuffer));

View File

@ -80,9 +80,9 @@ namespace KeyboardAudioVisualizer.AudioProcessing.VisualizationProvider
public override void Initialize()
{
_sampleDataLeft = new float[_audioBuffer.Size];
_sampleDataRight = new float[_audioBuffer.Size];
_sampleDataMix = new float[_audioBuffer.Size];
_sampleDataLeft = new float[2048];
_sampleDataRight = new float[2048];
_sampleDataMix = new float[2048];
RecalculateConfigValues(null);
}

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,57 +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=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\HidSharp.1.5\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.35\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.35\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.35\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.35\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.35\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.35\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.35\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.35\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.35\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.35\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.35\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="Sanford.Multimedia.Midi, Version=6.5.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sanford.Multimedia.Midi.6.5.0\lib\net20\Sanford.Multimedia.Midi.dll</HintPath>
<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.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" />
@ -328,21 +334,21 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\RGB.NET.Devices.Asus.0.0.1.35\build\net45\RGB.NET.Devices.Asus.targets" Condition="Exists('..\packages\RGB.NET.Devices.Asus.0.0.1.35\build\net45\RGB.NET.Devices.Asus.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<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.Asus.0.0.1.35\build\net45\RGB.NET.Devices.Asus.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Asus.0.0.1.35\build\net45\RGB.NET.Devices.Asus.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.35\build\net45\RGB.NET.Devices.CoolerMaster.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.35\build\net45\RGB.NET.Devices.CoolerMaster.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Corsair.0.0.1.35\build\net45\RGB.NET.Devices.Corsair.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Corsair.0.0.1.35\build\net45\RGB.NET.Devices.Corsair.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Logitech.0.0.1.35\build\net45\RGB.NET.Devices.Logitech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Logitech.0.0.1.35\build\net45\RGB.NET.Devices.Logitech.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Msi.0.0.1.35\build\net45\RGB.NET.Devices.Msi.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Msi.0.0.1.35\build\net45\RGB.NET.Devices.Msi.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Razer.0.0.1.35\build\net45\RGB.NET.Devices.Razer.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Razer.0.0.1.35\build\net45\RGB.NET.Devices.Razer.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.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.CoolerMaster.0.0.1.35\build\net45\RGB.NET.Devices.CoolerMaster.targets" Condition="Exists('..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.35\build\net45\RGB.NET.Devices.CoolerMaster.targets')" />
<Import Project="..\packages\RGB.NET.Devices.Corsair.0.0.1.35\build\net45\RGB.NET.Devices.Corsair.targets" Condition="Exists('..\packages\RGB.NET.Devices.Corsair.0.0.1.35\build\net45\RGB.NET.Devices.Corsair.targets')" />
<Import Project="..\packages\RGB.NET.Devices.Logitech.0.0.1.35\build\net45\RGB.NET.Devices.Logitech.targets" Condition="Exists('..\packages\RGB.NET.Devices.Logitech.0.0.1.35\build\net45\RGB.NET.Devices.Logitech.targets')" />
<Import Project="..\packages\RGB.NET.Devices.Msi.0.0.1.35\build\net45\RGB.NET.Devices.Msi.targets" Condition="Exists('..\packages\RGB.NET.Devices.Msi.0.0.1.35\build\net45\RGB.NET.Devices.Msi.targets')" />
<Import Project="..\packages\RGB.NET.Devices.Razer.0.0.1.35\build\net45\RGB.NET.Devices.Razer.targets" Condition="Exists('..\packages\RGB.NET.Devices.Razer.0.0.1.35\build\net45\RGB.NET.Devices.Razer.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.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.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyVersion("1.3.1.1")]
[assembly: AssemblyFileVersion("1.3.1.1")]

View File

@ -15,12 +15,12 @@ namespace KeyboardAudioVisualizer.UI
public double UpdateRate
{
get => 1.0 / RGBSurface.Instance.UpdateFrequency;
get => 1.0 / ApplicationManager.Instance.UpdateTrigger.UpdateFrequency;
set
{
double val = MathHelper.Clamp(value, 1, 60);
ApplicationManager.Instance.Settings.UpdateRate = val;
RGBSurface.Instance.UpdateFrequency = 1.0 / val;
ApplicationManager.Instance.UpdateTrigger.UpdateFrequency = 1.0 / val;
OnPropertyChanged();
}
}

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,23 +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="1.5" 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.35" targetFramework="net461" />
<package id="RGB.NET.Brushes" version="0.0.1.35" targetFramework="net461" />
<package id="RGB.NET.Core" version="0.0.1.35" targetFramework="net461" />
<package id="RGB.NET.Decorators" version="0.0.1.35" targetFramework="net461" />
<package id="RGB.NET.Devices" version="0.0.1.35" targetFramework="net461" />
<package id="RGB.NET.Devices.Asus" version="0.0.1.35" targetFramework="net461" />
<package id="RGB.NET.Devices.CoolerMaster" version="0.0.1.35" targetFramework="net461" />
<package id="RGB.NET.Devices.Corsair" version="0.0.1.35" targetFramework="net461" />
<package id="RGB.NET.Devices.Logitech" version="0.0.1.35" targetFramework="net461" />
<package id="RGB.NET.Devices.Msi" version="0.0.1.35" targetFramework="net461" />
<package id="RGB.NET.Devices.Novation" version="0.0.1.35" targetFramework="net461" />
<package id="RGB.NET.Devices.Razer" version="0.0.1.35" targetFramework="net461" />
<package id="RGB.NET.Groups" version="0.0.1.35" targetFramework="net461" />
<package id="RGB.NET.Presets" version="0.0.1.35" targetFramework="net461" />
<package id="Sanford.Multimedia.Midi" version="6.5.0" targetFramework="net461" />
<package id="System.ValueTuple" version="4.4.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.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.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!
@ -36,7 +40,7 @@ It's colorful - I like it!
- **Gamma:** The correction value used for gamma-grouping (disabled if any other grouping is selected). High values lead to a stronger compression of high frequencies. _(default: 2)_
- **Reference:** The reference value used to calculate the power of each bar. Adjust this to your audio volume. Low volume -> low reference, high volume -> higher reference. _(default: 90)_
- **Smoothing:** Smooths the graph to prevent flickering. Low values will cause a hectic fast plot, high values a slow one without peaks. _(default: 3)_
- **Emphasize:** Emphasizes peaks. The higher the value, the bigger the difference between a "loud-bar" and a "quite-bar". _(default: 0.5)_
- **Emphasize:** Emphasizes peaks. The higher the value, the bigger the difference between a "loud-bar" and a "quiet-bar". _(default: 0.5)_
**Equalizer**
Allows to finetune the graph by slective increasing/decresing the value.