diff --git a/CHANGELOG.md b/CHANGELOG.md index 5eaf4e5..89abf11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## v1.3 + +*Released: 18/04/2022* + +* New feature: add support for readpicture, aka embedded cover art +* New feature: add support for MPD password +* Spanish translation +* Trim album release date +* Cover icon when a radio is playing +* Update MpcNET package from 1.3 to 1.4 +* Fix: Snapcast not working with hostname +* Fix: some radios crash +* Fix: disable/enable radios and Snapcast with connection + ## v1.2 *Released: 07/04/2022* diff --git a/Resources/nocover.png b/Resources/nocover.png index 52a887d..11b40db 100644 Binary files a/Resources/nocover.png and b/Resources/nocover.png differ diff --git a/Resources/nothing.png b/Resources/nothing.png new file mode 100644 index 0000000..60e7e9d Binary files /dev/null and b/Resources/nothing.png differ diff --git a/Resources/radio.png b/Resources/radio.png new file mode 100644 index 0000000..49889e7 Binary files /dev/null and b/Resources/radio.png differ diff --git a/Views/MainWindow.xaml b/Views/MainWindow.xaml index dc9ee88..66930b5 100644 --- a/Views/MainWindow.xaml +++ b/Views/MainWindow.xaml @@ -104,7 +104,8 @@ - + + diff --git a/Views/MainWindow.xaml.cs b/Views/MainWindow.xaml.cs index d443139..7f57a70 100644 --- a/Views/MainWindow.xaml.cs +++ b/Views/MainWindow.xaml.cs @@ -54,11 +54,16 @@ namespace unison _mpd.QueryStats(); _settingsWin.UpdateStats(); - _mpd.QueryPlaylist().ConfigureAwait(false); + // _mpd.QueryPlaylist().ConfigureAwait(false); + // to remove - Snapcast.IsEnabled = true; ConnectionOkIcon.Visibility = Visibility.Visible; ConnectionFailIcon.Visibility = Visibility.Collapsed; + + Snapcast.IsEnabled = true; + if (_radiosWin.IsConnected()) + Radio.IsEnabled = true; + _shuffleWin.Initialize(); } else @@ -67,6 +72,9 @@ namespace unison DefaultState(true); ConnectionOkIcon.Visibility = Visibility.Collapsed; ConnectionFailIcon.Visibility = Visibility.Visible; + + Snapcast.IsEnabled = false; + Radio.IsEnabled = false; } _settingsWin.UpdateConnectionStatus(); Connection.Text = $"{Properties.Settings.Default.mpd_host}:{Properties.Settings.Default.mpd_port}"; @@ -183,8 +191,9 @@ namespace unison PlayPause.Text = (string)Application.Current.FindResource("pauseButton"); TimeSlider.Value = 50; TimeSlider.IsEnabled = false; - NoCover.Visibility = Visibility.Visible; + NoCover.Visibility = Visibility.Collapsed; Cover.Visibility = Visibility.Collapsed; + RadioCover.Visibility = Visibility.Collapsed; if (LostConnection) { @@ -196,16 +205,18 @@ namespace unison public void OnCoverChanged(object sender, EventArgs e) { - if (_mpd.GetCover() == null) - { + NoCover.Visibility = Visibility.Collapsed; + Cover.Visibility = Visibility.Collapsed; + RadioCover.Visibility = Visibility.Collapsed; + + if (_mpd.GetCurrentSong().Time == -1) + RadioCover.Visibility = Visibility.Visible; + else if (_mpd.GetCover() == null) NoCover.Visibility = Visibility.Visible; - Cover.Visibility = Visibility.Collapsed; - } else if (Cover.Source != _mpd.GetCover()) { Cover.Source = _mpd.GetCover(); Cover.Visibility = Visibility.Visible; - NoCover.Visibility = Visibility.Collapsed; } } @@ -218,11 +229,6 @@ namespace unison SnapcastText.Text = unison.Resources.Resources.StartSnapcast; } - public void OnRadioBrowserConnected() - { - Radio.IsEnabled = true; - } - public void UpdateButton(ref Border border, bool b) { border.Style = b ? (Style)Resources["SelectedButton"] : (Style)Resources["UnselectedButton"]; diff --git a/Views/Radios.xaml.cs b/Views/Radios.xaml.cs index 583103a..faf6f38 100644 --- a/Views/Radios.xaml.cs +++ b/Views/Radios.xaml.cs @@ -54,6 +54,9 @@ namespace unison { private RadioBrowserClient _radioBrowser; private MPDHandler _mpd; + private bool _connected = true; + + public bool IsConnected() => _connected; public Radios() { @@ -69,11 +72,8 @@ namespace unison Debug.WriteLine("Exception while connecting to RadioBrowser: " + e.Message); return; } - Application.Current.Dispatcher.Invoke(() => - { - MainWindow MainWin = (MainWindow)Application.Current.MainWindow; - MainWin.OnRadioBrowserConnected(); - }); + + _connected = true; } public async void Initialize() diff --git a/Views/Settings.xaml b/Views/Settings.xaml index f73af9c..4dde779 100644 --- a/Views/Settings.xaml +++ b/Views/Settings.xaml @@ -43,7 +43,7 @@ - + @@ -52,7 +52,6 @@ -