2509010939

已點歌曲頁面排列修改
This commit is contained in:
jasonchenwork 2025-09-01 09:39:42 +08:00
parent 9b6772686c
commit 1d9705af79
3 changed files with 25 additions and 20 deletions

View File

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

View File

@ -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,13 +2301,16 @@ 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 (remainder != 0 && index != 0)
{
if (List.Count < multiPagePanel.itemsPerPage)
if (List.Count <= multiPagePanel.itemsPerPage)
{
int itemsToInsert = multiPagePanel.itemsPerPage - index;
@ -2316,8 +2319,9 @@ namespace DualScreenDemo
List.Insert(index, new SongData());
}
}
else if (pivot != 0)
{
int itemsToInsert = multiPagePanel.itemsPerPage - remainder;
int itemsToInsert = multiPagePanel.itemsPerPage - pivot2 ;
for (int i = 0; i < itemsToInsert; i++)
{
@ -2325,9 +2329,10 @@ namespace DualScreenDemo
}
}
}
}
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);

View File

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