1
0
mirror of https://github.com/DarthAffe/RGBSyncPlus synced 2025-12-13 01:18:30 +00:00

Compare commits

...

8 Commits

Author SHA1 Message Date
6ea97964cc
Update README.md 2021-08-05 23:41:00 +02:00
b694510853 Bumped version number to 1.0.0.3 2019-05-26 12:30:47 +02:00
b783572a73 Updated RGB.NET 2019-05-26 12:30:20 +02:00
5ffcaab409 Bumped version number to 1.0.0.2 2019-01-13 15:54:21 +01:00
d356501ea9 Bumped version number to 1.0.0.1 2019-01-13 15:51:55 +01:00
065a695e1d Updated nuget-packages 2019-01-13 15:51:35 +01:00
7b0778c178 Updated nuget-packages 2019-01-06 10:34:24 +01:00
a4e72347a0 Added config-entry to disable try-minimization.
This fixes #11
2018-12-02 13:52:03 +01:00
10 changed files with 83 additions and 39 deletions

View File

@ -1,2 +1,8 @@
Since [RGB.NET](https://github.com/DarthAffe/RGB.NET) no longer supports reading colors from devices, syncing is no longer possible and this example no longer needed.
If you're looking for a software to control RGB-devices of different brands together consider checking out [Artemis](https://github.com/Artemis-RGB/Artemis).
# RGBSyncPlus # RGBSyncPlus
Tool to syncronize RGB devices Tool to syncronize RGB devices
If you've issues with the configuration window not opening when clicking the Tray-Icon you can disable Tray-Minimization by changing ```"MinimizeToTray":true``` to ```"MinimizeToTray":false``` in _Settings.json_ in the installation directory. (If this entry isn't already included delete the file and start/close the program once.)

View File

@ -55,6 +55,12 @@ namespace RGBSyncPlus
ApplicationManager.Instance.Settings = settings; ApplicationManager.Instance.Settings = settings;
ApplicationManager.Instance.Initialize(); ApplicationManager.Instance.Initialize();
if (!settings.MinimizeToTray) //HACK DarthAffe 02.12.2018: Workaround to create the window
{
ApplicationManager.Instance.OpenConfigurationCommand.Execute(null);
ApplicationManager.Instance.HideConfigurationCommand.Execute(null);
}
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -39,6 +39,9 @@ namespace RGBSyncPlus
private ActionCommand _openConfiguration; private ActionCommand _openConfiguration;
public ActionCommand OpenConfigurationCommand => _openConfiguration ?? (_openConfiguration = new ActionCommand(OpenConfiguration)); public ActionCommand OpenConfigurationCommand => _openConfiguration ?? (_openConfiguration = new ActionCommand(OpenConfiguration));
private ActionCommand _hideConfiguration;
public ActionCommand HideConfigurationCommand => _hideConfiguration ?? (_hideConfiguration = new ActionCommand(HideConfiguration));
private ActionCommand _exitCommand; private ActionCommand _exitCommand;
public ActionCommand ExitCommand => _exitCommand ?? (_exitCommand = new ActionCommand(Exit)); public ActionCommand ExitCommand => _exitCommand ?? (_exitCommand = new ActionCommand(Exit));
@ -133,10 +136,26 @@ namespace RGBSyncPlus
} }
} }
private void HideConfiguration()
{
if (Settings.MinimizeToTray)
{
if (_configurationWindow.IsVisible)
_configurationWindow.Hide();
}
else
_configurationWindow.WindowState = WindowState.Minimized;
}
private void OpenConfiguration() private void OpenConfiguration()
{ {
if (_configurationWindow == null) _configurationWindow = new ConfigurationWindow(); if (_configurationWindow == null) _configurationWindow = new ConfigurationWindow();
_configurationWindow.Show();
if (!_configurationWindow.IsVisible)
_configurationWindow.Show();
if (_configurationWindow.WindowState == WindowState.Minimized)
_configurationWindow.WindowState = WindowState.Normal;
} }
private void Exit() private void Exit()

View File

@ -17,6 +17,8 @@ namespace RGBSyncPlus.Configuration
public double UpdateRate { get; set; } = 30.0; public double UpdateRate { get; set; } = 30.0;
public bool MinimizeToTray { get; set; } = true;
public List<SyncGroup> SyncGroups { get; set; } = new List<SyncGroup>(); public List<SyncGroup> SyncGroups { get; set; } = new List<SyncGroup>();
#endregion #endregion

View File

@ -76,7 +76,7 @@ namespace RGBSyncPlus.Controls
closeButton.Click += (sender, args) => ApplicationManager.Instance.ExitCommand.Execute(null); closeButton.Click += (sender, args) => ApplicationManager.Instance.ExitCommand.Execute(null);
if (GetTemplateChild("PART_MinimizeButton") is Button minimizeButton) if (GetTemplateChild("PART_MinimizeButton") is Button minimizeButton)
minimizeButton.Click += (sender, args) => Hide(); minimizeButton.Click += (sender, args) => ApplicationManager.Instance.HideConfigurationCommand.Execute(null); //HACK DarthAffe 02.12.2018: This is a really dirty hack - hopefully this will never get more than one window ...
if (GetTemplateChild("PART_IconButton") is Button iconButton) if (GetTemplateChild("PART_IconButton") is Button iconButton)
iconButton.Click += (sender, args) => IconCommand?.Execute(null); iconButton.Click += (sender, args) => IconCommand?.Execute(null);

View File

@ -320,7 +320,7 @@ namespace RGBSyncPlus.Controls
private void HSVChanged() private void HSVChanged()
{ {
Color color = Color.FromHSV(_a, _hue, _saturation, _value); Color color = HSVColor.Create(_a, _hue, _saturation, _value);
UpdateSelectedColor(color); UpdateSelectedColor(color);
SetRGB(color); SetRGB(color);
UpdateUIColors(); UpdateUIColors();
@ -331,7 +331,7 @@ namespace RGBSyncPlus.Controls
{ {
_ignorePropertyChanged = true; _ignorePropertyChanged = true;
_a = color.A; _a = color.GetA();
if (_sliderAlpha != null) if (_sliderAlpha != null)
_sliderAlpha.Value = _a; _sliderAlpha.Value = _a;
@ -342,15 +342,15 @@ namespace RGBSyncPlus.Controls
{ {
_ignorePropertyChanged = true; _ignorePropertyChanged = true;
_r = color.R; _r = color.GetR();
if (_sliderRed != null) if (_sliderRed != null)
_sliderRed.Value = _r; _sliderRed.Value = _r;
_g = color.G; _g = color.GetG();
if (_sliderGreen != null) if (_sliderGreen != null)
_sliderGreen.Value = _g; _sliderGreen.Value = _g;
_b = color.B; _b = color.GetB();
if (_sliderBlue != null) if (_sliderBlue != null)
_sliderBlue.Value = _b; _sliderBlue.Value = _b;
@ -361,15 +361,14 @@ namespace RGBSyncPlus.Controls
{ {
_ignorePropertyChanged = true; _ignorePropertyChanged = true;
_hue = color.Hue; (_hue, _saturation, _value) = color.GetHSV();
if (_sliderHue != null) if (_sliderHue != null)
_sliderHue.Value = _hue; _sliderHue.Value = _hue;
_saturation = color.Saturation;
if (_sliderSaturation != null) if (_sliderSaturation != null)
_sliderSaturation.Value = _saturation; _sliderSaturation.Value = _saturation;
_value = color.Value;
if (_sliderValue != null) if (_sliderValue != null)
_sliderValue.Value = _value; _sliderValue.Value = _value;
@ -411,13 +410,13 @@ namespace RGBSyncPlus.Controls
private void UpdateUIColors() private void UpdateUIColors()
{ {
Color hueColor = Color.FromHSV(_hue, 1, 1); Color hueColor = HSVColor.Create(_hue, 1, 1);
if (_previewBrush != null) if (_previewBrush != null)
_previewBrush.Color = WpfColor.FromArgb(_a, _r, _g, _b); _previewBrush.Color = WpfColor.FromArgb(_a, _r, _g, _b);
if (_selectorBrush != null) 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) if (_alphaBrush != null)
{ {
@ -445,36 +444,36 @@ namespace RGBSyncPlus.Controls
if (_hueBrush != null) if (_hueBrush != null)
{ {
Color referenceColor1 = Color.FromHSV(0, _saturation, _value); Color referenceColor1 = HSVColor.Create(0, _saturation, _value);
Color referenceColor2 = Color.FromHSV(60, _saturation, _value); Color referenceColor2 = HSVColor.Create(60, _saturation, _value);
Color referenceColor3 = Color.FromHSV(120, _saturation, _value); Color referenceColor3 = HSVColor.Create(120, _saturation, _value);
Color referenceColor4 = Color.FromHSV(180, _saturation, _value); Color referenceColor4 = HSVColor.Create(180, _saturation, _value);
Color referenceColor5 = Color.FromHSV(240, _saturation, _value); Color referenceColor5 = HSVColor.Create(240, _saturation, _value);
Color referenceColor6 = Color.FromHSV(300, _saturation, _value); Color referenceColor6 = HSVColor.Create(300, _saturation, _value);
_hueBrush.GradientStops[0].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.R, referenceColor2.G, referenceColor2.B); _hueBrush.GradientStops[1].Color = WpfColor.FromArgb(_a, referenceColor2.GetR(), referenceColor2.GetG(), referenceColor2.GetB());
_hueBrush.GradientStops[2].Color = WpfColor.FromArgb(_a, referenceColor3.R, referenceColor3.G, referenceColor3.B); _hueBrush.GradientStops[2].Color = WpfColor.FromArgb(_a, referenceColor3.GetR(), referenceColor3.GetG(), referenceColor3.GetB());
_hueBrush.GradientStops[3].Color = WpfColor.FromArgb(_a, referenceColor4.R, referenceColor4.G, referenceColor4.B); _hueBrush.GradientStops[3].Color = WpfColor.FromArgb(_a, referenceColor4.GetR(), referenceColor4.GetG(), referenceColor4.GetB());
_hueBrush.GradientStops[4].Color = WpfColor.FromArgb(_a, referenceColor5.R, referenceColor5.G, referenceColor5.B); _hueBrush.GradientStops[4].Color = WpfColor.FromArgb(_a, referenceColor5.GetR(), referenceColor5.GetG(), referenceColor5.GetB());
_hueBrush.GradientStops[5].Color = WpfColor.FromArgb(_a, referenceColor6.R, referenceColor6.G, referenceColor6.B); _hueBrush.GradientStops[5].Color = WpfColor.FromArgb(_a, referenceColor6.GetR(), referenceColor6.GetG(), referenceColor6.GetB());
_hueBrush.GradientStops[6].Color = WpfColor.FromArgb(_a, referenceColor1.R, referenceColor1.G, referenceColor1.B); _hueBrush.GradientStops[6].Color = WpfColor.FromArgb(_a, referenceColor1.GetR(), referenceColor1.GetG(), referenceColor1.GetB());
} }
if (_saturationBrush != null) 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[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) 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[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 RGBSyncPlus.Controls
private void UpdatePreviewRectangle(Rectangle rect, double referenceWidth, double referenceHeight, double from, double to, private void UpdatePreviewRectangle(Rectangle rect, double referenceWidth, double referenceHeight, double from, double to,
RGB.NET.Core.Color startColor, RGB.NET.Core.Color endColor) RGB.NET.Core.Color startColor, RGB.NET.Core.Color endColor)
{ {
rect.Fill = new LinearGradientBrush(Color.FromArgb(startColor.A, startColor.R, startColor.G, startColor.B), rect.Fill = new LinearGradientBrush(Color.FromArgb(startColor.GetA(), startColor.GetR(), startColor.GetG(), startColor.GetB()),
Color.FromArgb(endColor.A, endColor.R, endColor.G, endColor.B), Color.FromArgb(endColor.GetA(), endColor.GetR(), endColor.GetG(), endColor.GetB()),
new Point(0, 0.5), new Point(1, 0.5)); new Point(0, 0.5), new Point(1, 0.5));
//DarthAffe 09.02.2018: Forced rounding to prevent render issues on resize //DarthAffe 09.02.2018: Forced rounding to prevent render issues on resize
@ -212,7 +212,7 @@ namespace RGBSyncPlus.Controls
private void UpdateGradientStop(ContentControl control, double referenceWidth, double referenceHeight, GradientStop stop) 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)); Canvas.SetLeft(control, (referenceWidth * stop.Offset.Clamp(0, 1)) - (control.Width / 2.0));

12
RGBSync+/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

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

View File

@ -199,19 +199,19 @@
<Version>1.0.8</Version> <Version>1.0.8</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Newtonsoft.Json"> <PackageReference Include="Newtonsoft.Json">
<Version>11.0.2</Version> <Version>12.0.1</Version>
</PackageReference> </PackageReference>
<PackageReference Include="RGB.NET.Brushes"> <PackageReference Include="RGB.NET.Brushes">
<Version>0.0.1.70</Version> <Version>0.1.23</Version>
</PackageReference> </PackageReference>
<PackageReference Include="RGB.NET.Core"> <PackageReference Include="RGB.NET.Core">
<Version>0.0.1.70</Version> <Version>0.1.23</Version>
</PackageReference> </PackageReference>
<PackageReference Include="RGB.NET.Decorators"> <PackageReference Include="RGB.NET.Decorators">
<Version>0.0.1.70</Version> <Version>0.1.23</Version>
</PackageReference> </PackageReference>
<PackageReference Include="RGB.NET.Groups"> <PackageReference Include="RGB.NET.Groups">
<Version>0.0.1.70</Version> <Version>0.1.23</Version>
</PackageReference> </PackageReference>
<PackageReference Include="System.ValueTuple"> <PackageReference Include="System.ValueTuple">
<Version>4.5.0</Version> <Version>4.5.0</Version>