修正切歌至公播顯示錯誤BUG

This commit is contained in:
jasonchenwork 2025-05-13 17:16:26 +08:00
parent 35a7b3f89b
commit af1ae44fa0
4 changed files with 24 additions and 7 deletions

View File

@ -297,6 +297,14 @@ namespace DualScreenDemo
private void CloseFavoriteButton_Click(object sender, EventArgs e)
{
mobileNumber = string.Empty;
showError = false;
FavoritePictureBox.Invalidate();
FavoritePictureBox.Refresh();
ToggleFavoritePictureBoxButtonsVisibility();
}

View File

@ -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;

View File

@ -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)
{

View File

@ -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