2025-04-07 16:54:10 +08:00
|
|
|
using DBObj;
|
|
|
|
namespace DualScreenDemo
|
|
|
|
{
|
|
|
|
public partial class PrimaryForm
|
|
|
|
{
|
|
|
|
private Button hotPlayButton;
|
2025-08-12 17:11:13 +08:00
|
|
|
private Bitmap hotPlayNormalBackground;
|
|
|
|
private Bitmap hotPlayActiveBackground;
|
2025-04-07 16:54:10 +08:00
|
|
|
|
|
|
|
private Button guoYuButtonHotSong;
|
|
|
|
private Bitmap guoYuHotSongNormalBackground;
|
|
|
|
private Bitmap guoYuHotSongActiveBackground;
|
|
|
|
private Button taiYuButtonHotSong;
|
|
|
|
private Bitmap taiYuHotSongNormalBackground;
|
|
|
|
private Bitmap taiYuHotSongActiveBackground;
|
|
|
|
private Button taiYuNewSongButtonHotSong;
|
|
|
|
private Bitmap taiYuNewSongHotSongNormalBackground;
|
|
|
|
private Bitmap taiYuNewSongHotSongActiveBackground;
|
|
|
|
private Button guoYuNewSongButtonHotSong;
|
|
|
|
private Bitmap guoYuNewSongHotSongNormalBackground;
|
|
|
|
private Bitmap guoYuNewSongHotSongActiveBackground;
|
|
|
|
private Button yingWenButtonHotSong;
|
|
|
|
private Bitmap yingWenHotSongNormalBackground;
|
|
|
|
private Bitmap yingWenHotSongActiveBackground;
|
|
|
|
private Button riYuButtonHotSong;
|
|
|
|
private Bitmap riYuHotSongNormalBackground;
|
|
|
|
private Bitmap riYuHotSongActiveBackground;
|
|
|
|
private Button hanYuButtonHotSong;
|
|
|
|
private Bitmap hanYuHotSongNormalBackground;
|
|
|
|
private Bitmap hanYuHotSongActiveBackground;
|
|
|
|
|
|
|
|
|
2025-08-12 17:11:13 +08:00
|
|
|
|
|
|
|
private void UpdateHotSongButtons(Button activeButton, Image activeBackground)
|
2025-04-07 16:54:10 +08:00
|
|
|
{
|
2025-08-12 17:11:13 +08:00
|
|
|
guoYuButtonHotSong.BackgroundImage = guoYuHotSongNormalBackground;
|
|
|
|
taiYuButtonHotSong.BackgroundImage = taiYuHotSongNormalBackground;
|
|
|
|
taiYuNewSongButtonHotSong.BackgroundImage = taiYuNewSongHotSongNormalBackground;
|
|
|
|
guoYuNewSongButtonHotSong.BackgroundImage = guoYuNewSongHotSongNormalBackground;
|
|
|
|
yingWenButtonHotSong.BackgroundImage = yingWenHotSongNormalBackground;
|
|
|
|
riYuButtonHotSong.BackgroundImage = riYuHotSongNormalBackground;
|
|
|
|
hanYuButtonHotSong.BackgroundImage = hanYuHotSongNormalBackground;
|
2025-04-07 16:54:10 +08:00
|
|
|
|
2025-08-12 17:11:13 +08:00
|
|
|
activeButton.BackgroundImage = activeBackground;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void InitializeButtonsForHotSong()
|
|
|
|
{
|
|
|
|
var data = LoadBtnConfigData();
|
|
|
|
|
|
|
|
InitializeButton(ref guoYuNewSongButtonHotSong, ref guoYuNewSongHotSongNormalBackground, ref guoYuNewSongHotSongActiveBackground, "guoYuNewSongButtonHotSong", 1197, 225, 225, 50, data["HotSongSubBtn"]["GuoYuNewNormal"], data["HotSongSubBtn"]["GuoYuNewActive"], GuoYuNewSongButtonHotSong_Click);
|
|
|
|
|
|
|
|
InitializeButton(ref taiYuNewSongButtonHotSong, ref taiYuNewSongHotSongNormalBackground, ref taiYuNewSongHotSongActiveBackground, "taiYuNewSongButtonHotSong", 1197, 280, 225, 50, data["HotSongSubBtn"]["TaiYuNewNormal"], data["HotSongSubBtn"]["TaiYuNewActive"], TaiYuNewSongButtonHotSong_Click);
|
|
|
|
|
|
|
|
InitializeButton(ref taiYuButtonHotSong, ref taiYuHotSongNormalBackground, ref taiYuHotSongActiveBackground, "taiYuButtonHotSong", 1197, 335, 225, 50, data["HotSongSubBtn"]["TaiYuHotNormal"], data["HotSongSubBtn"]["TaiYuHotActive"], TaiYuButtonHotSong_Click);
|
|
|
|
|
|
|
|
InitializeButton(ref guoYuButtonHotSong, ref guoYuHotSongNormalBackground, ref guoYuHotSongActiveBackground, "guoYuButtonHotSong", 1197, 390, 225, 50, data["HotSongSubBtn"]["GuoYuHotNormal"], data["HotSongSubBtn"]["GuoYuHotActive"], GuoYuButtonHotSong_Click);
|
|
|
|
|
|
|
|
InitializeButton(ref yingWenButtonHotSong, ref yingWenHotSongNormalBackground, ref yingWenHotSongActiveBackground, "yingWenButtonHotSong", 1197, 445, 225, 50, data["HotSongSubBtn"]["EngHotNormal"], data["HotSongSubBtn"]["EngHotActive"], YingWenButtonHotSong_Click);
|
|
|
|
|
|
|
|
InitializeButton(ref riYuButtonHotSong, ref riYuHotSongNormalBackground, ref riYuHotSongActiveBackground, "riYuButtonHotSong", 1197, 500, 225, 50, data["HotSongSubBtn"]["JapHotNormal"], data["HotSongSubBtn"]["JapHotActive"], RiYuButtonHotSong_Click);
|
|
|
|
|
|
|
|
InitializeButton(ref hanYuButtonHotSong, ref hanYuHotSongNormalBackground, ref hanYuHotSongActiveBackground, "hanYuButtonHotSong", 1197, 555, 225, 50, data["HotSongSubBtn"]["KrHotNormal"], data["HotSongSubBtn"]["KrHotActive"], HanYuButtonHotSong_Click);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private void SetHotSongButtonsVisibility(bool isVisible)
|
|
|
|
{
|
2025-04-07 16:54:10 +08:00
|
|
|
|
|
|
|
Button[] hotSongButtons = { guoYuButtonHotSong, taiYuButtonHotSong, taiYuNewSongButtonHotSong, guoYuNewSongButtonHotSong, yingWenButtonHotSong, riYuButtonHotSong, hanYuButtonHotSong };
|
|
|
|
|
|
|
|
foreach (var button in hotSongButtons)
|
|
|
|
{
|
|
|
|
button.Visible = isVisible;
|
|
|
|
if (isVisible)
|
|
|
|
{
|
|
|
|
button.BringToFront();
|
|
|
|
}
|
|
|
|
}
|
2025-08-12 17:11:13 +08:00
|
|
|
|
2025-04-07 16:54:10 +08:00
|
|
|
}
|
|
|
|
|
2025-05-08 10:09:14 +08:00
|
|
|
public void HotPlayButton_Click(object sender, EventArgs e)
|
2025-04-07 16:54:10 +08:00
|
|
|
{
|
2025-08-12 17:11:13 +08:00
|
|
|
UpdateButtonBackgrounds(hotPlayButton, hotPlayActiveBackground);
|
|
|
|
|
2025-04-07 16:54:10 +08:00
|
|
|
isOnOrderedSongsPage = false;
|
2025-04-23 13:55:11 +08:00
|
|
|
/* 清空搜尋欄 */
|
|
|
|
ResetinputBox();
|
2025-08-06 10:47:43 +08:00
|
|
|
string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY `song_counts` DESC LIMIT 1000;";
|
2025-04-14 16:33:06 +08:00
|
|
|
var guoYuSongs = SearchSongs_Mysql(query);
|
2025-04-07 16:54:10 +08:00
|
|
|
UpdateSongList(guoYuSongs);
|
2025-08-12 17:11:13 +08:00
|
|
|
|
2025-04-07 16:54:10 +08:00
|
|
|
SetButtonsVisibility();
|
2025-08-12 17:11:13 +08:00
|
|
|
UpdateHotSongButtons(guoYuNewSongButtonHotSong, guoYuNewSongHotSongActiveBackground);
|
2025-05-26 15:21:07 +08:00
|
|
|
//HideQRCode();
|
2025-04-07 16:54:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
private void OnHotSongButtonClick(Button activeButton, Bitmap activeBackground, string category)
|
|
|
|
{
|
|
|
|
UpdateHotSongButtons(activeButton, activeBackground);
|
|
|
|
|
2025-08-06 10:47:43 +08:00
|
|
|
string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY `song_counts` DESC LIMIT 1000;";
|
2025-04-11 17:16:59 +08:00
|
|
|
var selectedSongs = SearchSongs_Mysql(query);
|
2025-04-07 16:54:10 +08:00
|
|
|
|
|
|
|
UpdateSongList(selectedSongs);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void UpdateSongList(List<SongData> songs)
|
|
|
|
{
|
2025-08-12 17:11:13 +08:00
|
|
|
currentPage = 0;
|
2025-04-07 16:54:10 +08:00
|
|
|
totalPages = (int)Math.Ceiling((double)songs.Count / itemsPerPage);
|
|
|
|
|
2025-08-12 17:11:13 +08:00
|
|
|
|
2025-04-07 16:54:10 +08:00
|
|
|
multiPagePanel.currentPageIndex = 0;
|
2025-07-11 13:35:47 +08:00
|
|
|
multiPagePanel.LoadSongs(songs);
|
2025-04-07 16:54:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
private void SetButtonsVisibility()
|
|
|
|
{
|
|
|
|
SetNewSongButtonsVisibility(false);
|
|
|
|
SetSingerSearchButtonsVisibility(false);
|
|
|
|
SetSongSearchButtonsVisibility(false);
|
|
|
|
SetPictureBoxLanguageButtonsVisibility(false);
|
|
|
|
SetGroupButtonsVisibility(false);
|
|
|
|
SetPictureBoxCategoryAndButtonsVisibility(false);
|
|
|
|
SetZhuYinSingersAndButtonsVisibility(false);
|
|
|
|
SetZhuYinSongsAndButtonsVisibility(false);
|
|
|
|
SetEnglishSingersAndButtonsVisibility(false);
|
|
|
|
SetEnglishSongsAndButtonsVisibility(false);
|
|
|
|
SetPinYinSingersAndButtonsVisibility(false);
|
|
|
|
SetPinYinSongsAndButtonsVisibility(false);
|
|
|
|
SetPictureBoxToggleLightAndButtonsVisibility(false);
|
|
|
|
SetPictureBoxSceneSoundEffectsAndButtonsVisibility(false);
|
|
|
|
SetHotSongButtonsVisibility(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void HideQRCode()
|
|
|
|
{
|
2025-05-19 13:23:09 +08:00
|
|
|
pictureBoxQRCode.Visible = false;
|
|
|
|
closeQRCodeButton.Visible = false;
|
2025-04-07 16:54:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|