diff --git a/DBObj/SongData.cs b/DBObj/SongData.cs index 9bdc9a1..fc297d4 100644 --- a/DBObj/SongData.cs +++ b/DBObj/SongData.cs @@ -14,9 +14,9 @@ namespace DBObj public SongData() { - basic = new("", "", "", "", 1, 1, ""); + basic = new("", "", "", "", 0, 1, ""); A = new("", ""); - B = new("", ""); + // B = new(null, null); isPublicSong = false; } public SongData(string songNumber, string song, string filename, int humanVoice, bool isPublic) diff --git a/PrimaryFormParts/PrimaryForm.cs b/PrimaryFormParts/PrimaryForm.cs index f183b21..8473c74 100644 --- a/PrimaryFormParts/PrimaryForm.cs +++ b/PrimaryFormParts/PrimaryForm.cs @@ -1125,7 +1125,7 @@ namespace DualScreenDemo new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["QieGe"])), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["QieGe"])), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["QieGe"])), - (sender, e) => videoPlayerForm.PlayNextSong()); + (sender, e) => { videoPlayerForm.PlayNextSong(); if (isOnOrderedSongsPage) orderedSongsButton.PerformClick(); }); musicUpButton = new Button { Text = "" }; @@ -2301,33 +2301,38 @@ namespace DualScreenDemo autoRefreshTimer.Start(); // 开始自动刷新 // 已點歌曲錨點 var List = SongList.GetHistory(); - var targetNum = multiPagePanel.itemsPerPage - List.Count % multiPagePanel.itemsPerPage; int index = List.FindIndex(song => song.GetState() == PlayState.Playing); - int remainder=(List.Count-index)%multiPagePanel.itemsPerPage; - if (remainder !=0&&remainder!=1) + int remainder=List.Count-index; + int pivot2 = index % multiPagePanel.itemsPerPage; + int pivot = (List.Count -remainder)%multiPagePanel.itemsPerPage; + if (index != -1) { - - if (List.Count < multiPagePanel.itemsPerPage) + if (remainder != 0 && index != 0) { - int itemsToInsert = multiPagePanel.itemsPerPage - index; - for (int i = 0; i < itemsToInsert; i++) + if (List.Count <= multiPagePanel.itemsPerPage) { - List.Insert(index, new SongData()); + int itemsToInsert = multiPagePanel.itemsPerPage - index; + + for (int i = 0; i < itemsToInsert; i++) + { + List.Insert(index, new SongData()); + } } - } - { - int itemsToInsert = multiPagePanel.itemsPerPage - remainder; - - for (int i = 0; i < itemsToInsert; i++) + else if (pivot != 0) { - List.Insert(index, new SongData()); + int itemsToInsert = multiPagePanel.itemsPerPage - pivot2 ; + + for (int i = 0; i < itemsToInsert; i++) + { + List.Insert(index, new SongData()); + } } } } - - totalPages = (int)Math.Ceiling((double)List.Count / itemsPerPage); + + totalPages = (int)Math.Ceiling((double)List.Count / multiPagePanel.itemsPerPage); index = List.FindIndex(song => song.GetState() == PlayState.Playing); int page = 0; if ((index+1) > multiPagePanel.itemsPerPage) page = Math.Abs((index+1) / multiPagePanel.itemsPerPage); diff --git a/Program.cs b/Program.cs index 3e9aff6..99b0d65 100644 --- a/Program.cs +++ b/Program.cs @@ -14,7 +14,7 @@ namespace DualScreenDemo private static PrimaryForm primaryForm; // 儲存實例的參考 public static Room room = new Room(); - public static string verSion = "Server V2.10 202508291614"; + public static string verSion = "Server V2.10 202509010938"; [STAThread] static void Main()