From 0aa80ed8b5318b2c00e3ae91f56d2ab0e0f735f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Marchal?= Date: Tue, 31 Aug 2021 01:42:00 +0200 Subject: [PATCH] Option to show Snapcast window --- Handlers/SnapcastHandler.cs | 2 +- Properties/Settings.Designer.cs | 12 ++++++++++++ Properties/Settings.settings | 3 +++ Views/Settings.xaml | 3 +++ Views/Settings.xaml.cs | 2 ++ 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Handlers/SnapcastHandler.cs b/Handlers/SnapcastHandler.cs index 45ac1d6..d10ef5f 100644 --- a/Handlers/SnapcastHandler.cs +++ b/Handlers/SnapcastHandler.cs @@ -44,7 +44,7 @@ namespace unison { _snapcast.StartInfo.FileName = Properties.Settings.Default.snapcast_path + @"\snapclient.exe"; _snapcast.StartInfo.Arguments = $"--host {Properties.Settings.Default.mpd_host}"; - _snapcast.StartInfo.CreateNoWindow = true; + _snapcast.StartInfo.CreateNoWindow = !Properties.Settings.Default.snapcast_window; try { _snapcast.Start(); diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs index a00c48a..fe9e256 100644 --- a/Properties/Settings.Designer.cs +++ b/Properties/Settings.Designer.cs @@ -106,5 +106,17 @@ namespace unison.Properties { this["volume_offset"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool snapcast_window { + get { + return ((bool)(this["snapcast_window"])); + } + set { + this["snapcast_window"] = value; + } + } } } diff --git a/Properties/Settings.settings b/Properties/Settings.settings index 409e1b7..de18205 100644 --- a/Properties/Settings.settings +++ b/Properties/Settings.settings @@ -14,6 +14,9 @@ False + + False + snapclient_0.25.0-1_win64 diff --git a/Views/Settings.xaml b/Views/Settings.xaml index dbde6c3..39c9426 100644 --- a/Views/Settings.xaml +++ b/Views/Settings.xaml @@ -57,6 +57,9 @@ + + + diff --git a/Views/Settings.xaml.cs b/Views/Settings.xaml.cs index 5a27cb5..f81e52c 100644 --- a/Views/Settings.xaml.cs +++ b/Views/Settings.xaml.cs @@ -48,6 +48,7 @@ namespace unison MpdPort.Text = Properties.Settings.Default.mpd_port.ToString(); MpdPassword.Text = Properties.Settings.Default.mpd_password; SnapcastStartup.IsChecked = Properties.Settings.Default.snapcast_startup; + SnapcastWindow.IsChecked = Properties.Settings.Default.snapcast_window; SnapcastPath.Text = Properties.Settings.Default.snapcast_path; SnapcastPort.Text = Properties.Settings.Default.snapcast_port.ToString(); VolumeOffset.Text = Properties.Settings.Default.volume_offset.ToString(); @@ -96,6 +97,7 @@ namespace unison Properties.Settings.Default.mpd_port = int.Parse(MpdPort.Text, CultureInfo.InvariantCulture); Properties.Settings.Default.mpd_password = MpdPassword.Text; Properties.Settings.Default.snapcast_startup = (bool)SnapcastStartup.IsChecked; + Properties.Settings.Default.snapcast_window = (bool)SnapcastWindow.IsChecked; Properties.Settings.Default.snapcast_path = SnapcastPath.Text; Properties.Settings.Default.snapcast_port = int.Parse(SnapcastPort.Text, CultureInfo.InvariantCulture); Properties.Settings.Default.volume_offset = int.Parse(VolumeOffset.Text, CultureInfo.InvariantCulture);