From 0bc80ef23b5d47e8ed3851ade8ff61704f04198e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Marchal?= Date: Thu, 19 Aug 2021 22:00:25 +0200 Subject: [PATCH] Working mpd handling, even if I'm not a big fan of it --- App.xaml.cs | 20 ++- Handlers/MPDHandler.cs | 263 +++++++++++++++++++++++++++++------- MPDCtrl/BinaryDownloader.cs | 17 ++- MPDCtrl/MPC.cs | 94 +++---------- Views/MainWindow.xaml | 5 +- Views/MainWindow.xaml.cs | 43 ++++-- Views/Settings.xaml.cs | 6 +- unison.csproj | 1 - 8 files changed, 294 insertions(+), 155 deletions(-) diff --git a/App.xaml.cs b/App.xaml.cs index 3830b2e..e629220 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -1,6 +1,16 @@ -using System.Windows; +using System; +using System.Diagnostics; +using System.Windows; using Hardcodet.Wpf.TaskbarNotification; +// todo: +// +// * finish correct refresh of mpd +// * show mpd version +// * change volume offset +// * fix window resize +// * show covers + namespace unison { public partial class App : Application @@ -14,19 +24,21 @@ namespace unison { base.OnStartup(e); - Hotkeys = new HotkeyHandler(); - Current.Properties["hotkeys"] = Hotkeys; - Snapcast = new SnapcastHandler(); Current.Properties["snapcast"] = Snapcast; MPD = new MPDHandler(); Current.Properties["mpd"] = MPD; + Hotkeys = new HotkeyHandler(); + Current.Properties["hotkeys"] = Hotkeys; + Current.MainWindow = new MainWindow(); Systray = (TaskbarIcon)FindResource("SystrayTaskbar"); Current.Properties["systray"] = Systray; + + MPD.Start(); } protected override void OnExit(ExitEventArgs e) diff --git a/Handlers/MPDHandler.cs b/Handlers/MPDHandler.cs index 8b2cc87..85aa1c1 100644 --- a/Handlers/MPDHandler.cs +++ b/Handlers/MPDHandler.cs @@ -1,6 +1,8 @@ -using System.Collections.Generic; +using System; +using System.Diagnostics; using System.Threading.Tasks; - +using System.Windows; +using System.Windows.Threading; using MPDCtrl.Models; namespace unison @@ -19,74 +21,236 @@ namespace unison private Status _currentStatus = null; private SongInfoEx _currentSong = null; + private AlbumImage _currentAlbumCover = null; - public MPDHandler() - { - } + public double _elapsed; + private double _time; - public async void Connect() + private readonly System.Timers.Timer _elapsedTimer; + private async void ElapsedTimer(object sender, System.Timers.ElapsedEventArgs e) { - _connected = await _mpd.MpdCommandConnectionStart(Properties.Settings.Default.mpd_host, Properties.Settings.Default.mpd_port, Properties.Settings.Default.mpd_password); - if (_connected) + if ((_elapsed < _time) && (_mpd.MpdStatus.MpdState == Status.MpdPlayState.Play)) { - await _mpd.MpdQueryStatus(); + _elapsed += 0.5; await Task.Delay(5); - _currentVolume = _mpd.MpdStatus.MpdVolume; - _currentRandom = _mpd.MpdStatus.MpdRandom; - _currentRepeat = _mpd.MpdStatus.MpdRepeat; - _currentSingle = _mpd.MpdStatus.MpdSingle; - _currentConsume = _mpd.MpdStatus.MpdConsume; - _currentElapsed = _mpd.MpdStatus.MpdSongElapsed; + } + else + { + _elapsedTimer.Stop(); } } - public void CheckStatus(ref T a, T b) + bool IsBusy = false; + + public MPDHandler() { - if (Comparer.Default.Compare(a, b) != 0) - a = b; + _mpd.IsBusy += new MPC.IsBusyEvent(OnMpcIsBusy); + + _mpd.MpdIdleConnected += new MPC.IsMpdIdleConnectedEvent(OnMpdIdleConnected); + + _mpd.ConnectionStatusChanged += new MPC.ConnectionStatusChangedEvent(OnConnectionStatusChanged); + _mpd.ConnectionError += new MPC.ConnectionErrorEvent(OnConnectionError); + + _mpd.MpdPlayerStatusChanged += new MPC.MpdPlayerStatusChangedEvent(OnMpdPlayerStatusChanged); + _mpd.MpdCurrentQueueChanged += new MPC.MpdCurrentQueueChangedEvent(OnMpdCurrentQueueChanged); + + _mpd.MpdAlbumArtChanged += new MPC.MpdAlbumArtChangedEvent(OnAlbumArtChanged); + + _elapsedTimer = new System.Timers.Timer(500); + _elapsedTimer.Elapsed += new System.Timers.ElapsedEventHandler(ElapsedTimer); + + + DispatcherTimer timer = new DispatcherTimer(); + timer.Interval = TimeSpan.FromSeconds(2); + timer.Tick += QueryStatus; + timer.Start(); } - public async void Loop() + private void OnMpcIsBusy(MPC sender, bool on) + { + IsBusy = on; + } + + public void Start() + { + Task.Run(() => _mpd.MpdIdleConnect(Properties.Settings.Default.mpd_host, Properties.Settings.Default.mpd_port)); + } + + private void OnMpdIdleConnected(MPC sender) + { + Trace.WriteLine($"Connection to mpd {_mpd.MpdVerText}..."); + LoadInitialData(); + } + + private void OnConnectionStatusChanged(MPC sender, MPC.ConnectionStatus status) + { + Trace.WriteLine("Connection changed..."); + } + + private void OnConnectionError(MPC sender, string msg) + { + Trace.WriteLine("Connection ERROR!"); + LoadInitialData(); + } + + private void OnMpdPlayerStatusChanged(MPC sender) + { + Trace.WriteLine("Status changed..."); + + UpdateStatus(); + } + + private void OnMpdCurrentQueueChanged(MPC sender) + { + Trace.WriteLine("Queue changed..."); + + UpdateStatus(); + } + + private void OnAlbumArtChanged(MPC sender) + { + // AlbumArt + if (Application.Current == null) { return; } + Application.Current.Dispatcher.Invoke(() => + { + if ((!_mpd.AlbumCover.IsDownloading) && _mpd.AlbumCover.IsSuccess) + { + if ((_mpd.MpdCurrentSong != null) && (_mpd.AlbumCover.AlbumImageSource != null)) + { + if (!String.IsNullOrEmpty(_mpd.MpdCurrentSong.File)) + { + if (_mpd.MpdCurrentSong.File == _mpd.AlbumCover.SongFilePath) + { + Trace.WriteLine("found cover"); + _currentAlbumCover = _mpd.AlbumCover; + } + } + } + } + }); + } + + public async void LoadInitialData() + { + //todo : test if the password works + + IsBusy = true; + await Task.Delay(5); + + CommandResult result = await _mpd.MpdIdleSendPassword(Properties.Settings.Default.mpd_password); + + if (result.IsSuccess) + { + _connected = await _mpd.MpdCommandConnectionStart(Properties.Settings.Default.mpd_host, Properties.Settings.Default.mpd_port, Properties.Settings.Default.mpd_password); + if (_connected) + { + await _mpd.MpdSendUpdate(); + + result = await _mpd.MpdIdleQueryStatus(); + await Task.Delay(5); + + if (result.IsSuccess) + { + _currentVolume = _mpd.MpdStatus.MpdVolume; + _currentRandom = _mpd.MpdStatus.MpdRandom; + _currentRepeat = _mpd.MpdStatus.MpdRepeat; + _currentSingle = _mpd.MpdStatus.MpdSingle; + _currentConsume = _mpd.MpdStatus.MpdConsume; + _currentElapsed = _mpd.MpdStatus.MpdSongElapsed; + } + + await Task.Delay(5); + CommandResult song = await _mpd.MpdIdleQueryCurrentSong(); + await Task.Delay(5); + if (song != null) + _currentSong = _mpd.MpdCurrentSong; + + await Task.Delay(5); + _mpd.MpdIdleStart(); + await Task.Delay(5); + UpdateStatus(); + } + } + } + + public async void QueryStatus(object sender, EventArgs e) + { + if (IsBusy) + return; + + Trace.WriteLine("Querying status..."); + + CommandResult result = await _mpd.MpdQueryStatus(); + await Task.Delay(5); + + if (result.IsSuccess) + { + result = await _mpd.MpdQueryCurrentSong(); + await Task.Delay(5); + + if (result.IsSuccess) + { + UpdateStatus(); + } + } + } + + public async void UpdateStatus() { if (!_connected) return; - CommandResult status = await _mpd.MpdQueryStatus(); - //Trace.WriteLine(status.ResultText); - await Task.Delay(5); - if (status != null) - { - _currentStatus = _mpd.MpdStatus; + await Task.Delay(50); - CheckStatus(ref _currentVolume, _mpd.MpdStatus.MpdVolume); - CheckStatus(ref _currentRandom, _mpd.MpdStatus.MpdRandom); - CheckStatus(ref _currentRepeat, _mpd.MpdStatus.MpdRepeat); - CheckStatus(ref _currentSingle, _mpd.MpdStatus.MpdSingle); - CheckStatus(ref _currentConsume, _mpd.MpdStatus.MpdConsume); - CheckStatus(ref _currentElapsed, _mpd.MpdStatus.MpdSongElapsed); + _currentStatus = _mpd.MpdStatus; + + _currentRandom = _mpd.MpdStatus.MpdRandom; + _currentRepeat = _mpd.MpdStatus.MpdRepeat; + _currentConsume = _mpd.MpdStatus.MpdConsume; + _currentSingle = _mpd.MpdStatus.MpdSingle; + + _currentVolume = _mpd.MpdStatus.MpdVolume; + _currentElapsed = _mpd.MpdStatus.MpdSongElapsed; + + _currentSong = _mpd.MpdCurrentSong; + + _time = _mpd.MpdStatus.MpdSongTime; + + _elapsed = _mpd.MpdStatus.MpdSongElapsed; + + if (_mpd.MpdStatus.MpdState == Status.MpdPlayState.Play) + { + if (!_elapsedTimer.Enabled) + _elapsedTimer.Start(); + } + else + { + _elapsedTimer.Stop(); } - CommandResult song = await _mpd.MpdQueryCurrentSong(); - await Task.Delay(5); - if (song != null) - _currentSong = _mpd.MpdCurrentSong; + await _mpd.MpdQueryAlbumArt(_currentSong.File, false); } public SongInfoEx GetCurrentSong() => _currentSong; public Status GetStatus() => _currentStatus; + public AlbumImage GetCover() => _currentAlbumCover; public async void Prev() { - await _mpd.MpdPlaybackPrev(_currentVolume); + if (!IsBusy) + await _mpd.MpdPlaybackPrev(_currentVolume); } public async void Next() { - await _mpd.MpdPlaybackNext(_currentVolume); + if (!IsBusy) + await _mpd.MpdPlaybackNext(_currentVolume); } public async void PlayPause() { + if (IsBusy) + return; if (_mpd.MpdStatus.MpdState == Status.MpdPlayState.Play) await _mpd.MpdPlaybackPause(); else if (_mpd.MpdStatus.MpdState == Status.MpdPlayState.Pause) @@ -95,34 +259,37 @@ namespace unison public async void Random() { - await _mpd.MpdSetRandom(!_currentRandom); - + if (!IsBusy) + await _mpd.MpdSetRandom(!_currentRandom); } public async void Repeat() { - await _mpd.MpdSetRepeat(!_currentRepeat); - + if (!IsBusy) + await _mpd.MpdSetRepeat(!_currentRepeat); } public async void Single() { - await _mpd.MpdSetSingle(!_currentSingle); - + if (!IsBusy) + await _mpd.MpdSetSingle(!_currentSingle); } public async void Consume() { - await _mpd.MpdSetConsume(!_currentConsume); - + if (!IsBusy) + await _mpd.MpdSetConsume(!_currentConsume); } public async void SetVolume(int value) { - await _mpd.MpdSetVolume(value); - + if (!IsBusy) + await _mpd.MpdSetVolume(value); } - public bool IsPlaying() => _currentStatus?.MpdState == MPDCtrl.Models.Status.MpdPlayState.Play; + public bool IsPlaying() + { + return _currentStatus?.MpdState == MPDCtrl.Models.Status.MpdPlayState.Play; + } } } diff --git a/MPDCtrl/BinaryDownloader.cs b/MPDCtrl/BinaryDownloader.cs index c9a3e31..47a8156 100644 --- a/MPDCtrl/BinaryDownloader.cs +++ b/MPDCtrl/BinaryDownloader.cs @@ -103,19 +103,22 @@ namespace MPDCtrl.Models string response = await _binaryReader.ReadLineAsync(); - if (response.StartsWith("OK MPD ")) + if (response != null) { - MpdVersion = response.Replace("OK MPD ", string.Empty).Trim(); + if (response.StartsWith("OK MPD ")) + { + MpdVersion = response.Replace("OK MPD ", string.Empty).Trim(); - //Debug.WriteLine("TCP Binary Connection: Connected. MPD " + VerText); + //Debug.WriteLine("TCP Binary Connection: Connected. MPD " + VerText); - //DebugCommandOutput?.Invoke(this, "<<<<" + response.Trim() + "\n" + "\n"); + //DebugCommandOutput?.Invoke(this, "<<<<" + response.Trim() + "\n" + "\n"); - //IsMpdCommandConnected = true; + //IsMpdCommandConnected = true; - result.IsSuccess = true; + result.IsSuccess = true; - // Done for now. + // Done for now. + } } else { diff --git a/MPDCtrl/MPC.cs b/MPDCtrl/MPC.cs index 184515a..7e95275 100644 --- a/MPDCtrl/MPC.cs +++ b/MPDCtrl/MPC.cs @@ -10,6 +10,7 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows; using System.Windows.Media.Imaging; +using unison; namespace MPDCtrl.Models { @@ -188,8 +189,8 @@ namespace MPDCtrl.Models public delegate void MpdCurrentQueueChangedEvent(MPC sender); public event MpdCurrentQueueChangedEvent MpdCurrentQueueChanged; - public delegate void MpdPlaylistsChangedEvent(MPC sender); - public event MpdPlaylistsChangedEvent MpdPlaylistsChanged; + //public delegate void MpdPlaylistsChangedEvent(MPC sender); + //public event MpdPlaylistsChangedEvent MpdPlaylistsChanged; public delegate void MpdAlbumArtChangedEvent(MPC sender); public event MpdAlbumArtChangedEvent MpdAlbumArtChanged; @@ -920,7 +921,7 @@ namespace MPDCtrl.Models { bool isPlayer = false; bool isCurrentQueue = false; - bool isStoredPlaylist = false; + //bool isStoredPlaylist = false; foreach (string line in SubSystems) { @@ -947,7 +948,7 @@ namespace MPDCtrl.Models if (line.ToLower() == "changed: stored_playlist") { // stored_playlist: a stored playlist has been modified, renamed, created or deleted - isStoredPlaylist = true; + //isStoredPlaylist = true; } } @@ -960,7 +961,18 @@ namespace MPDCtrl.Models } } + // custom test if (isCurrentQueue) + { + CommandResult idleResult = await MpdIdleQueryCurrentSong(); + if (idleResult.IsSuccess) + { + MpdCurrentQueueChanged?.Invoke(this); + } + } + + // takes lot of time + /*if (isCurrentQueue) { CommandResult idleResult = await MpdIdleQueryCurrentQueue(); if (idleResult.IsSuccess) @@ -976,7 +988,7 @@ namespace MPDCtrl.Models { MpdPlaylistsChanged?.Invoke(this); } - } + }*/ //MpcProgress?.Invoke(this, ""); @@ -2609,15 +2621,6 @@ namespace MPDCtrl.Models { Debug.WriteLine("Exception@ParseStatus:" + ex.Message); - if (Application.Current != null) - { - Application.Current.Dispatcher.Invoke(() => - { - /*App app = App.Current as App; - app.AppendErrorLog("Exception@MPC@ParseStatus", ex.Message);*/ - }); - } - IsBusy?.Invoke(this, false); return Task.FromResult(false); } @@ -2696,15 +2699,6 @@ namespace MPDCtrl.Models { Debug.WriteLine("Error@ParseCurrentSong: " + ex.Message); - if (Application.Current != null) - { - Application.Current.Dispatcher.Invoke(() => - { - /*App app = App.Current as App; - app.AppendErrorLog("Exception@MPC@ParseCurrentSong", ex.Message);*/ - }); - } - return Task.FromResult(false); } finally @@ -2917,15 +2911,6 @@ namespace MPDCtrl.Models { Debug.WriteLine("Exception@ParsePlaylistInfo: " + ex.Message); - if (Application.Current != null) - { - Application.Current.Dispatcher.Invoke(() => - { - /*App app = App.Current as App; - app.AppendErrorLog("Exception@MPC@ParsePlaylistInfo", ex.Message);*/ - }); - } - return Task.FromResult(false); } finally @@ -3069,15 +3054,6 @@ namespace MPDCtrl.Models { Debug.WriteLine("Error@FillSongInfoEx: " + e.ToString()); - if (Application.Current != null) - { - Application.Current.Dispatcher.Invoke(() => - { - /*App app = App.Current as App; - app.AppendErrorLog("Exception@MPC@FillSongInfoEx", e.Message);*/ - }); - } - return null; } } @@ -3182,15 +3158,6 @@ namespace MPDCtrl.Models { Debug.WriteLine("Error@ParsePlaylists: " + e.ToString()); - if (Application.Current != null) - { - Application.Current.Dispatcher.Invoke(() => - { - /*App app = App.Current as App; - app.AppendErrorLog("Exception@MPC@ParsePlaylists", e.Message);*/ - }); - } - IsBusy?.Invoke(this, false); return Task.FromResult(false); } @@ -3277,15 +3244,6 @@ namespace MPDCtrl.Models { Debug.WriteLine("Error@ParseListAll: " + e.ToString()); - if (Application.Current != null) - { - Application.Current.Dispatcher.Invoke(() => - { - /*App app = App.Current as App; - app.AppendErrorLog("Exception@MPC@ParseListAll", e.Message);*/ - }); - } - IsBusy?.Invoke(this, false); return Task.FromResult(false); ; } @@ -3424,15 +3382,6 @@ namespace MPDCtrl.Models { Debug.WriteLine("Error@ParseSearchResult: " + ex.Message); - if (Application.Current != null) - { - Application.Current.Dispatcher.Invoke(() => - { - /*App app = App.Current as App; - app.AppendErrorLog("Exception@MPC@ParseSearchResult", ex.Message);*/ - }); - } - IsBusy?.Invoke(this, false); return Task.FromResult(false); } @@ -3565,15 +3514,6 @@ namespace MPDCtrl.Models { Debug.WriteLine("Error@ParsePlaylistSongsResult: " + ex.Message); - if (Application.Current != null) - { - Application.Current.Dispatcher.Invoke(() => - { - /*App app = App.Current as App; - app.AppendErrorLog("Exception@MPC@ParsePlaylistSongsResult", ex.Message);*/ - }); - } - return songList; } diff --git a/Views/MainWindow.xaml b/Views/MainWindow.xaml index f1ec4cd..fe4ce37 100644 --- a/Views/MainWindow.xaml +++ b/Views/MainWindow.xaml @@ -25,7 +25,7 @@ - + @@ -93,7 +93,8 @@ - + + diff --git a/Views/MainWindow.xaml.cs b/Views/MainWindow.xaml.cs index 6d86de1..8b304d2 100644 --- a/Views/MainWindow.xaml.cs +++ b/Views/MainWindow.xaml.cs @@ -1,20 +1,17 @@ using System; -using System.Collections.Generic; -using System.Threading.Tasks; using System.ComponentModel; using System.Windows; using System.Windows.Controls; using System.Windows.Threading; using System.Windows.Interop; -using System.Diagnostics; namespace unison { - public partial class MainWindow : Window + public partial class MainWindow : Window, INotifyPropertyChanged { private readonly Settings SettingsWindow = new Settings(); - private readonly MPDHandler mpd; + private MPDHandler mpd; Thickness SelectedThickness; Thickness BaseThickness; @@ -27,10 +24,9 @@ namespace unison WindowState = WindowState.Minimized; mpd = (MPDHandler)Application.Current.Properties["mpd"]; - mpd.Connect(); DispatcherTimer timer = new DispatcherTimer(); - timer.Interval = TimeSpan.FromSeconds(0.2); + timer.Interval = TimeSpan.FromSeconds(0.5); timer.Tick += Timer_Tick; timer.Start(); @@ -41,9 +37,6 @@ namespace unison private void Timer_Tick(object sender, EventArgs e) { - MPDHandler mpd = (MPDHandler)Application.Current.Properties["mpd"]; - mpd.Loop(); - UpdateInterface(); } @@ -63,7 +56,7 @@ namespace unison public void UpdateInterface() { - if (mpd.GetCurrentSong() != null) + if (mpd.GetCurrentSong() != null && mpd.GetStatus() != null) { SongTitle.Text = mpd.GetCurrentSong().Title; SongTitle.ToolTip = mpd.GetCurrentSong().File; @@ -74,11 +67,11 @@ namespace unison Bitrate.Text = mpd.GetCurrentSong().File.Substring(mpd.GetCurrentSong().File.LastIndexOf(".") + 1) + " – "; Bitrate.Text += mpd.GetStatus().MpdBitrate + "kbps"; - CurrentTime.Text = FormatSeconds(mpd._currentElapsed); + CurrentTime.Text = FormatSeconds(mpd._elapsed); EndTime.Text = FormatSeconds(mpd.GetStatus().MpdSongTime); if (!System.Double.IsNaN(mpd.GetCurrentSong().TimeSort)) - TimeSlider.Value = mpd._currentElapsed / mpd.GetCurrentSong().TimeSort * 100; + TimeSlider.Value = mpd._elapsed / mpd.GetCurrentSong().TimeSort * 100; } if (VolumeSlider.Value != mpd._currentVolume) @@ -104,11 +97,28 @@ namespace unison UpdateButton(ref BorderRepeat, mpd._currentRepeat); UpdateButton(ref BorderSingle, mpd._currentSingle); UpdateButton(ref BorderConsume, mpd._currentConsume); + + if (mpd.GetCover() != null) + { + if ((!mpd.GetCover().IsDownloading) && mpd.GetCover().IsSuccess) + { + if (mpd.GetCurrentSong().File == mpd.GetCover().SongFilePath) + { + Cover.Source = mpd.GetCover().AlbumImageSource; + Cover.Visibility = Visibility.Visible; + NoCover.Visibility = Visibility.Collapsed; + return; + } + } + } + NoCover.Visibility = Visibility.Visible; + Cover.Visibility = Visibility.Collapsed; } public void Pause_Clicked(object sender, RoutedEventArgs e) => mpd.PlayPause(); public void Previous_Clicked(object sender, RoutedEventArgs e) => mpd.Prev(); public void Next_Clicked(object sender, RoutedEventArgs e) => mpd.Next(); + public void Random_Clicked(object sender, RoutedEventArgs e) => mpd.Random(); public void Repeat_Clicked(object sender, RoutedEventArgs e) => mpd.Repeat(); public void Single_Clicked(object sender, RoutedEventArgs e) => mpd.Single(); @@ -152,5 +162,12 @@ namespace unison WindowInteropHelper helper = new(this); helper.EnsureHandle(); } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } } } \ No newline at end of file diff --git a/Views/Settings.xaml.cs b/Views/Settings.xaml.cs index f8b1883..9885c92 100644 --- a/Views/Settings.xaml.cs +++ b/Views/Settings.xaml.cs @@ -46,7 +46,7 @@ namespace unison MpdHost.Text = Properties.Settings.Default.mpd_host; MpdPort.Text = Properties.Settings.Default.mpd_port.ToString(); - MpdPassword.Text = Properties.Settings.Default.mpd_password; + MpdPassword.Text = null; //Properties.Settings.Default.mpd_password; SnapcastStartup.IsChecked = Properties.Settings.Default.snapcast_startup; SnapcastPath.Text = Properties.Settings.Default.snapcast_path; SnapcastPort.Text = Properties.Settings.Default.snapcast_port.ToString(); @@ -70,7 +70,7 @@ namespace unison { SaveSettings(); MPDHandler mpd = (MPDHandler)Application.Current.Properties["mpd"]; - mpd.Connect(); + //mpd.Connect(); } private void SnapcastReset_Clicked(object sender, RoutedEventArgs e) @@ -83,7 +83,7 @@ namespace unison { Properties.Settings.Default.mpd_host = MpdHost.Text; Properties.Settings.Default.mpd_port = int.Parse(MpdPort.Text, CultureInfo.InvariantCulture); - Properties.Settings.Default.mpd_password = MpdPassword.Text; + Properties.Settings.Default.mpd_password = null;//MpdPassword.Text; Properties.Settings.Default.snapcast_startup = (bool)SnapcastStartup.IsChecked; Properties.Settings.Default.snapcast_path = SnapcastPath.Text; Properties.Settings.Default.snapcast_port = int.Parse(SnapcastPort.Text, CultureInfo.InvariantCulture); diff --git a/unison.csproj b/unison.csproj index f2eff24..c435746 100644 --- a/unison.csproj +++ b/unison.csproj @@ -12,7 +12,6 @@ -