From af1ae44fa0737dbe3d2bf35a70d969a0b3f4657c Mon Sep 17 00:00:00 2001 From: jasonchenwork Date: Tue, 13 May 2025 17:16:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=88=87=E6=AD=8C=E8=87=B3?= =?UTF-8?q?=E5=85=AC=E6=92=AD=E9=A1=AF=E7=A4=BA=E9=8C=AF=E8=AA=A4BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PrimaryFormParts/PrimaryForm.Favorite.cs | 8 ++++++++ PrimaryFormParts/PrimaryForm.cs | 11 ++++++----- VideoPlayerForm.cs | 10 +++++++++- bin/secondary_graph.grf | 2 +- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/PrimaryFormParts/PrimaryForm.Favorite.cs b/PrimaryFormParts/PrimaryForm.Favorite.cs index 0c7da50..b7aae33 100644 --- a/PrimaryFormParts/PrimaryForm.Favorite.cs +++ b/PrimaryFormParts/PrimaryForm.Favorite.cs @@ -297,6 +297,14 @@ namespace DualScreenDemo private void CloseFavoriteButton_Click(object sender, EventArgs e) { + mobileNumber = string.Empty; + + + showError = false; + + + FavoritePictureBox.Invalidate(); + FavoritePictureBox.Refresh(); ToggleFavoritePictureBoxButtonsVisibility(); } diff --git a/PrimaryFormParts/PrimaryForm.cs b/PrimaryFormParts/PrimaryForm.cs index 903196b..663b2e3 100644 --- a/PrimaryFormParts/PrimaryForm.cs +++ b/PrimaryFormParts/PrimaryForm.cs @@ -2064,9 +2064,10 @@ public class MultiPagePanel : Panel else { // 計算已完成播放的歌曲數量 - int completedCount = 0; + //int completedCount = 0; + int completedCount = currentSongIndexInHistory; // 遍歷已點歌曲歷史 - for (int i = 0; i <= currentSongIndexInHistory && i < playedSongsHistory.Count; i++) { + /*for (int i = 0; i <= currentSongIndexInHistory && i < playedSongsHistory.Count; i++) { if (i == currentSongIndexInHistory) { completedCount = i + 1; // 当前播放的歌曲 break; @@ -2078,20 +2079,20 @@ public class MultiPagePanel : Panel } // 如果是切歌状态,不增加计数 } - } + }*/ // 計算歌曲在歷史中的位置 int songPosition = pageOffset + index; // 判斷歌曲狀態 - if (songPosition < completedCount - 1) + if (songPosition < completedCount) { // 已播放完成 hasBeenPlayed = true; songLabel.ForeColor = Color.Gray; statusText = IsSimplified ? "(播毕)" : "(播畢)"; } - else if (songPosition == completedCount - 1) + else if (songPosition == completedCount) { // 正在播放 isCurrentlyPlaying = true; diff --git a/VideoPlayerForm.cs b/VideoPlayerForm.cs index 407e1b2..664b454 100644 --- a/VideoPlayerForm.cs +++ b/VideoPlayerForm.cs @@ -860,7 +860,12 @@ namespace DualScreenDemo PrimaryForm.playStates[PrimaryForm.currentSongIndexInHistory] = PlayState.Played; } } - PrimaryForm.currentSongIndexInHistory += 1; + bool isPlayingPublicList = PrimaryForm.userRequestedSongs.Count == 0 || + (PrimaryForm.currentSongIndexInHistory >= PrimaryForm.userRequestedSongs.Count - 1 && PrimaryForm.Instance.videoPlayerForm.IsPlayingPublicSong); + if(!isPlayingPublicList){ + PrimaryForm.currentSongIndexInHistory+=1; + } + Console.WriteLine("currentSongIndexInHistory : " + PrimaryForm.currentSongIndexInHistory); } catch (Exception ex) { @@ -1609,6 +1614,9 @@ namespace DualScreenDemo PrimaryForm.userRequestedSongs.Add(songData); PrimaryForm.playedSongsHistory.Add(songData); + if(PrimaryForm.Instance.multiPagePanel.get_currentSongList() == PrimaryForm.playedSongsHistory) + PrimaryForm.Instance.multiPagePanel.LoadSongs(PrimaryForm.Instance.currentSongList); + // 更新状态 if (wasEmpty) { diff --git a/bin/secondary_graph.grf b/bin/secondary_graph.grf index b6cc34f..f14f464 100644 --- a/bin/secondary_graph.grf +++ b/bin/secondary_graph.grf @@ -14,5 +14,5 @@ Filter: LAV Splitter Pin: Input Pin: Video Pin: Audio -Filter: C:\video\welcome.mpg +Filter: \\SVR01\DISK02\996724.mpg Pin: Output