From a98af850881cd20d30c2c995ee1a34d32e1c78b4 Mon Sep 17 00:00:00 2001 From: Royce551 Date: Wed, 9 Dec 2020 22:26:43 -0600 Subject: [PATCH] stuff --- .../MainWindow.xaml.cs | 27 ++++++++++--------- .../Pages/Settings/SettingsPage.xaml | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/FRESHMusicPlayer/FRESHMusicPlayer-WPF-UI-Test/MainWindow.xaml.cs b/FRESHMusicPlayer/FRESHMusicPlayer-WPF-UI-Test/MainWindow.xaml.cs index 3d89a0b..2abf8b4 100644 --- a/FRESHMusicPlayer/FRESHMusicPlayer-WPF-UI-Test/MainWindow.xaml.cs +++ b/FRESHMusicPlayer/FRESHMusicPlayer-WPF-UI-Test/MainWindow.xaml.cs @@ -115,6 +115,15 @@ namespace FRESHMusicPlayer ProcessSettings(true); await UpdateHandler.UpdateApp(); } + private void Window_Closed(object sender, EventArgs e) + { + App.Config.Volume = (int)VolumeBar.Value; + App.Config.CurrentMenu = SelectedMenu; + TrackingHandler?.Close(); + ConfigurationHandler.Write(App.Config); + Libraryv2.Dispose(); + Application.Current.Shutdown(); + } private void Smtc_ButtonPressed(SystemMediaTransportControls sender, SystemMediaTransportControlsButtonPressedEventArgs args) { switch (args.Button) @@ -426,11 +435,12 @@ namespace FRESHMusicPlayer private void ProgressTimer_Tick(object sender, EventArgs e) => ProgressTick(); private void ProgressTick() { - ProgressIndicator1.Text = Player.CurrentBackend.CurrentTime.ToString(@"mm\:ss"); + var time = TimeSpan.FromSeconds(Math.Floor(Player.CurrentBackend.CurrentTime.TotalSeconds)); + ProgressIndicator1.Text = time.ToString(@"mm\:ss"); if (App.Config.ShowRemainingProgress) ProgressIndicator2.Text - = $"-{TimeSpan.FromSeconds(Player.CurrentBackend.TotalTime.TotalSeconds - Math.Floor(Player.CurrentBackend.CurrentTime.TotalSeconds)):mm\\:ss}"; - if (App.Config.ShowTimeInWindow) Title = $"{Player.CurrentBackend.CurrentTime:mm\\:ss}/{Player.CurrentBackend.TotalTime:mm\\:ss} | FRESHMusicPlayer"; - if (!isDragging) ProgressBar.Value = Player.CurrentBackend.CurrentTime.TotalSeconds; + = $"-{TimeSpan.FromSeconds(time.TotalSeconds - Math.Floor(Player.CurrentBackend.TotalTime.TotalSeconds)):mm\\:ss}"; + if (App.Config.ShowTimeInWindow) Title = $"{time:mm\\:ss}/{Player.CurrentBackend.TotalTime:mm\\:ss} | FRESHMusicPlayer"; + if (!isDragging) ProgressBar.Value = time.TotalSeconds; Player.AvoidNextQueue = false; } private void TrackTitle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) => ShowAuxilliaryPane(SelectedAuxiliaryPane.TrackInfo, 235, true); @@ -514,15 +524,6 @@ namespace FRESHMusicPlayer Player.PlayMusic(); } - private void Window_Closed(object sender, EventArgs e) - { - App.Config.Volume = (int)VolumeBar.Value; - App.Config.CurrentMenu = SelectedMenu; - TrackingHandler?.Close(); - ConfigurationHandler.Write(App.Config); - Application.Current.Shutdown(); - } - private void Window_PreviewKeyDown(object sender, KeyEventArgs e) { if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) diff --git a/FRESHMusicPlayer/FRESHMusicPlayer-WPF-UI-Test/Pages/Settings/SettingsPage.xaml b/FRESHMusicPlayer/FRESHMusicPlayer-WPF-UI-Test/Pages/Settings/SettingsPage.xaml index 21700f5..dd9ac18 100644 --- a/FRESHMusicPlayer/FRESHMusicPlayer-WPF-UI-Test/Pages/Settings/SettingsPage.xaml +++ b/FRESHMusicPlayer/FRESHMusicPlayer-WPF-UI-Test/Pages/Settings/SettingsPage.xaml @@ -58,7 +58,7 @@ --> - +