mirror of
https://github.com/DarthAffe/KeyboardAudioVisualizer.git
synced 2025-12-12 23:28:30 +00:00
Added setting to change the background-brush
This commit is contained in:
parent
7eac420a8e
commit
dde304b007
@ -8,6 +8,8 @@ using KeyboardAudioVisualizer.Configuration;
|
|||||||
using KeyboardAudioVisualizer.Helper;
|
using KeyboardAudioVisualizer.Helper;
|
||||||
using KeyboardAudioVisualizer.Legacy;
|
using KeyboardAudioVisualizer.Legacy;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using RGB.NET.Brushes.Gradients;
|
||||||
|
using RGB.NET.Core;
|
||||||
using Settings = KeyboardAudioVisualizer.Configuration.Settings;
|
using Settings = KeyboardAudioVisualizer.Configuration.Settings;
|
||||||
|
|
||||||
namespace KeyboardAudioVisualizer
|
namespace KeyboardAudioVisualizer
|
||||||
@ -53,7 +55,11 @@ namespace KeyboardAudioVisualizer
|
|||||||
|
|
||||||
if (settings == null)
|
if (settings == null)
|
||||||
{
|
{
|
||||||
settings = new Settings { Version = Settings.CURRENT_VERSION };
|
settings = new Settings
|
||||||
|
{
|
||||||
|
Version = Settings.CURRENT_VERSION,
|
||||||
|
Background = new LinearGradient(new GradientStop(0.1, 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);
|
_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)
|
else if (settings.Version != Settings.CURRENT_VERSION)
|
||||||
|
|||||||
@ -75,7 +75,7 @@ namespace KeyboardAudioVisualizer
|
|||||||
surface.AlignDevices();
|
surface.AlignDevices();
|
||||||
|
|
||||||
ILedGroup background = new ListLedGroup(surface.Leds);
|
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 primaryGradient = Settings[VisualizationIndex.Primary].Gradient;
|
||||||
LinearGradient secondaryGradient = Settings[VisualizationIndex.Secondary].Gradient;
|
LinearGradient secondaryGradient = Settings[VisualizationIndex.Secondary].Gradient;
|
||||||
|
|||||||
@ -23,6 +23,8 @@ namespace KeyboardAudioVisualizer.Configuration
|
|||||||
|
|
||||||
public bool EnableAudioPrescale { get; set; } = false;
|
public bool EnableAudioPrescale { get; set; } = false;
|
||||||
|
|
||||||
|
public LinearGradient Background { get; set; }
|
||||||
|
|
||||||
public Dictionary<VisualizationIndex, VisualizationSettings> Visualizations { get; set; } = new Dictionary<VisualizationIndex, VisualizationSettings>();
|
public Dictionary<VisualizationIndex, VisualizationSettings> Visualizations { get; set; } = new Dictionary<VisualizationIndex, VisualizationSettings>();
|
||||||
|
|
||||||
public VisualizationSettings this[VisualizationIndex visualizationIndex]
|
public VisualizationSettings this[VisualizationIndex visualizationIndex]
|
||||||
|
|||||||
@ -163,25 +163,16 @@
|
|||||||
|
|
||||||
<TabItem Header="Settings">
|
<TabItem Header="Settings">
|
||||||
<AdornerDecorator>
|
<AdornerDecorator>
|
||||||
<GroupBox VerticalAlignment="Top">
|
<DockPanel LastChildFill="False">
|
||||||
<StackPanel Orientation="Vertical">
|
<DockPanel.Resources>
|
||||||
<Grid>
|
|
||||||
<Grid.Resources>
|
|
||||||
<Style BasedOn="{StaticResource StyleLabelForm}" TargetType="Label" />
|
<Style BasedOn="{StaticResource StyleLabelForm}" TargetType="Label" />
|
||||||
<Style BasedOn="{StaticResource StyleTextBlockForm}" TargetType="TextBlock" />
|
<Style BasedOn="{StaticResource StyleTextBlockForm}" TargetType="TextBlock" />
|
||||||
<Style BasedOn="{StaticResource StyleListBoxForm}" TargetType="ListBox" />
|
<Style BasedOn="{StaticResource StyleListBoxForm}" TargetType="ListBox" />
|
||||||
</Grid.Resources>
|
</DockPanel.Resources>
|
||||||
|
|
||||||
<Grid.ColumnDefinitions>
|
<GroupBox DockPanel.Dock="Top">
|
||||||
<ColumnDefinition Width="*" />
|
<controls:Form>
|
||||||
<ColumnDefinition Width="8" />
|
<Label controls:Form.IsLabel="True" Content="Version" />
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="8" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<controls:Form Grid.Column="0">
|
|
||||||
<Label controls:Form.IsLabel="True" Content="Version:" />
|
|
||||||
<TextBlock Text="{Binding Version}" />
|
<TextBlock Text="{Binding Version}" />
|
||||||
|
|
||||||
<Label controls:Form.IsLabel="True" Content="Update-Rate" />
|
<Label controls:Form.IsLabel="True" Content="Update-Rate" />
|
||||||
@ -195,12 +186,30 @@
|
|||||||
IsChecked="{Binding EnableAudioPrescale}"
|
IsChecked="{Binding EnableAudioPrescale}"
|
||||||
ToolTip="Scales the audio signal inverse to the OS-master-volume.
This might (depending on the system) lead to decrased performance
 -> only activate it if you need it." />
|
ToolTip="Scales the audio signal inverse to the OS-master-volume.
This might (depending on the system) lead to decrased performance
 -> only activate it if you need it." />
|
||||||
|
|
||||||
<Label controls:Form.LineBreaks="1" controls:Form.IsLabel="True" Content="Devices:" />
|
|
||||||
</controls:Form>
|
</controls:Form>
|
||||||
</Grid>
|
</GroupBox>
|
||||||
|
|
||||||
<!-- TODO DarthAffe 05.08.2017: Fix the formular to support that use-case -->
|
<GroupBox Margin="0,8,0,0" DockPanel.Dock="Top">
|
||||||
<ItemsControl VerticalAlignment="Top" HorizontalAlignment="Left" Margin="120,-22,0,0" ItemsSource="{Binding Source={x:Static core:RGBSurface.Instance}, Path=Devices}">
|
<StackPanel Orientation="Vertical">
|
||||||
|
<Border HorizontalAlignment="Left" Width="111">
|
||||||
|
<Label HorizontalAlignment="Right"
|
||||||
|
Content="Background" />
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
<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:
 Left click inside the preview to add a new stop.
 Left-click stop to change the color or move it.
 Right-click stop to remove it.
" />
|
||||||
|
</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>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Style="{StaticResource StyleTextBlockForm}">
|
<TextBlock Style="{StaticResource StyleTextBlockForm}">
|
||||||
@ -217,6 +226,7 @@
|
|||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
</DockPanel>
|
||||||
</AdornerDecorator>
|
</AdornerDecorator>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user