2508121700 1.圖片路徑遷移至ini 2.重構,功能重複的function清理 3.MuiltiPage人聲圖尺寸更改

This commit is contained in:
allen.yan 2025-08-12 17:11:13 +08:00
parent e7511ddba8
commit d36ddd9e90
38 changed files with 520 additions and 935 deletions

View File

@ -4,8 +4,8 @@ namespace DualScreenDemo
{ {
private void ChinaSongsButton_Click(object sender, EventArgs e) private void ChinaSongsButton_Click(object sender, EventArgs e)
{ {
ResetCatBtnStatus();
chinaSongsButton.BackgroundImage = chinaActiveBackground; UpdateCatBtns(chinaSongsButton, chinaActiveBackground);
/*chinaSongs = allSongs.Where(song => song.SongGenre.Contains("F1")) /*chinaSongs = allSongs.Where(song => song.SongGenre.Contains("F1"))
.OrderByDescending(song => song.Plays) .OrderByDescending(song => song.Plays)
.ToList();*/ .ToList();*/

View File

@ -4,9 +4,7 @@ namespace DualScreenDemo
{ {
private void LoveDuetButton_Click(object sender, EventArgs e) private void LoveDuetButton_Click(object sender, EventArgs e)
{ {
UpdateCatBtns(loveDuetButton, loveDuetActiveBackground);
ResetCatBtnStatus();
loveDuetButton.BackgroundImage = loveDuetActiveBackground;
/*loveDuetSongs = allSongs.Where(song => song.SongGenre.Contains("A1")) /*loveDuetSongs = allSongs.Where(song => song.SongGenre.Contains("A1"))
.OrderByDescending(song => song.Plays) .OrderByDescending(song => song.Plays)
.ToList();*/ .ToList();*/

View File

@ -4,8 +4,7 @@ namespace DualScreenDemo
{ {
private void MedleyDanceButton_Click(object sender, EventArgs e) private void MedleyDanceButton_Click(object sender, EventArgs e)
{ {
ResetCatBtnStatus(); UpdateCatBtns(medleyDanceButton, medleyDanceActiveBackground);
medleyDanceButton.BackgroundImage = medleyDanceActiveBackground;
/*medleyDanceSongs = allSongs.Where(song => song.SongGenre.Contains("C1")) /*medleyDanceSongs = allSongs.Where(song => song.SongGenre.Contains("C1"))
.OrderByDescending(song => song.Plays) .OrderByDescending(song => song.Plays)
.ToList();*/ .ToList();*/

View File

@ -4,8 +4,7 @@ namespace DualScreenDemo
{ {
private void NinetiesButton_Click(object sender, EventArgs e) private void NinetiesButton_Click(object sender, EventArgs e)
{ {
ResetCatBtnStatus(); UpdateCatBtns(ninetiesButton, ninetiesActiveBackground);
ninetiesButton.BackgroundImage = ninetiesActiveBackground;
/*ninetiesSongs = allSongs.Where(song => song.SongGenre.Contains("D1")) /*ninetiesSongs = allSongs.Where(song => song.SongGenre.Contains("D1"))
.OrderByDescending(song => song.Plays) .OrderByDescending(song => song.Plays)
.ToList();*/ .ToList();*/

View File

@ -4,8 +4,7 @@ namespace DualScreenDemo
{ {
private void NostalgicSongsButton_Click(object sender, EventArgs e) private void NostalgicSongsButton_Click(object sender, EventArgs e)
{ {
ResetCatBtnStatus(); UpdateCatBtns(nostalgicSongsButton, nostalgicSongsActiveBackground);
nostalgicSongsButton.BackgroundImage = nostalgicSongsActiveBackground;
/*nostalgicSongs = allSongs.Where(song => song.SongGenre.Contains("E1")) /*nostalgicSongs = allSongs.Where(song => song.SongGenre.Contains("E1"))
.OrderByDescending(song => song.Plays) .OrderByDescending(song => song.Plays)
.ToList();*/ .ToList();*/

View File

@ -4,8 +4,7 @@ namespace DualScreenDemo
{ {
private void TalentShowButton_Click(object sender, EventArgs e) private void TalentShowButton_Click(object sender, EventArgs e)
{ {
ResetCatBtnStatus(); UpdateCatBtns(talentShowButton, talentShowActiveBackground);
talentShowButton.BackgroundImage = talentShowActiveBackground;
/*talentShowSongs = allSongs.Where(song => song.SongGenre.Contains("B1")) /*talentShowSongs = allSongs.Where(song => song.SongGenre.Contains("B1"))
.OrderByDescending(song => song.Plays) .OrderByDescending(song => song.Plays)
.ToList();*/ .ToList();*/

View File

@ -4,8 +4,7 @@ namespace DualScreenDemo
{ {
private void VietnameseSongsButton_Click(object sender, EventArgs e) private void VietnameseSongsButton_Click(object sender, EventArgs e)
{ {
ResetCatBtnStatus(); UpdateCatBtns(vietnameseSongsButton, vietnameseActiveBackground);
vietnameseSongsButton.BackgroundImage = vietnameseActiveBackground;
/*vietnameseSongs = allSongs.Where(song => song.SongGenre.Contains("G1")) /*vietnameseSongs = allSongs.Where(song => song.SongGenre.Contains("G1"))
.OrderByDescending(song => song.Plays) .OrderByDescending(song => song.Plays)
.ToList();*/ .ToList();*/

View File

@ -1,5 +1,3 @@
using System.IO;
using Utils;
namespace DualScreenDemo namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
@ -30,9 +28,8 @@ namespace DualScreenDemo
private Bitmap vietnameseNormalBackground; private Bitmap vietnameseNormalBackground;
private Bitmap vietnameseActiveBackground; private Bitmap vietnameseActiveBackground;
private void ResetCatBtnStatus() private void UpdateCatBtns(Button activeButton, Image activeBackground)
{ {
loveDuetButton.BackgroundImage = loveDuetNormalBackground; loveDuetButton.BackgroundImage = loveDuetNormalBackground;
talentShowButton.BackgroundImage = talentShowNormalBackground; talentShowButton.BackgroundImage = talentShowNormalBackground;
medleyDanceButton.BackgroundImage = medleyDanceNormalBackground; medleyDanceButton.BackgroundImage = medleyDanceNormalBackground;
@ -40,31 +37,14 @@ namespace DualScreenDemo
nostalgicSongsButton.BackgroundImage = nostalgicSongsNormalBackground; nostalgicSongsButton.BackgroundImage = nostalgicSongsNormalBackground;
chinaSongsButton.BackgroundImage = chinaNormalBackground; chinaSongsButton.BackgroundImage = chinaNormalBackground;
vietnameseSongsButton.BackgroundImage = vietnameseNormalBackground; vietnameseSongsButton.BackgroundImage = vietnameseNormalBackground;
activeButton.BackgroundImage = activeBackground;
} }
//private void InitializeButtonsForCategorySearch()
//{
// var data=LoadConfigData();
// categorySearchNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_類別查詢(未按).png"));
// categorySearchActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_類別查詢(已按).png"));
// categorySearchButton = new Button { Text = "" };
// categorySearchButton.Name = "categorySearchButton";
// ConfigureButton(categorySearchButton, 731, 97, 99, 99,
// categorySearchNormalBackground,
// categorySearchActiveBackground,
// categorySearchActiveBackground,
// CategorySearchButton_Click);
//}
private void InitializeCategorySearchButtons() private void InitializeCategorySearchButtons()
{ {
var data = LoadBtnConfigData(); var data = LoadBtnConfigData();
InitializeButton(ref loveDuetButton, ref loveDuetNormalBackground, ref loveDuetActiveBackground, "loveDuetButton", 1197, 225, 225, 50, data["CategorySubBtn"]["LoveDuetNormal"], data["CategorySubBtn"]["LoveDuetActive"], LoveDuetButton_Click); InitializeButton(ref loveDuetButton, ref loveDuetNormalBackground, ref loveDuetActiveBackground, "loveDuetButton", 1197, 225, 225, 50, data["CategorySubBtn"]["LoveDuetNormal"], data["CategorySubBtn"]["LoveDuetActive"], LoveDuetButton_Click);
InitializeButton(ref talentShowButton, ref talentShowNormalBackground, ref talentShowActiveBackground, "talentShowButton", 1197, 280, 225, 50, data["CategorySubBtn"]["TalentNormal"], data["CategorySubBtn"]["TalentActive"], TalentShowButton_Click); InitializeButton(ref talentShowButton, ref talentShowNormalBackground, ref talentShowActiveBackground, "talentShowButton", 1197, 280, 225, 50, data["CategorySubBtn"]["TalentNormal"], data["CategorySubBtn"]["TalentActive"], TalentShowButton_Click);
@ -79,19 +59,14 @@ namespace DualScreenDemo
InitializeButton(ref vietnameseSongsButton, ref vietnameseNormalBackground, ref vietnameseActiveBackground, "vietnameseSongsButton", 1197, 555, 225, 50, data["CategorySubBtn"]["VietNormal"], data["CategorySubBtn"]["VietActive"], VietnameseSongsButton_Click); InitializeButton(ref vietnameseSongsButton, ref vietnameseNormalBackground, ref vietnameseActiveBackground, "vietnameseSongsButton", 1197, 555, 225, 50, data["CategorySubBtn"]["VietNormal"], data["CategorySubBtn"]["VietActive"], VietnameseSongsButton_Click);
} }
private void CategorySearchButton_Click(object sender, EventArgs e) private void CategorySearchButton_Click(object sender, EventArgs e)
{ {
ResetPrimaryBtnStatus(); UpdateButtonBackgrounds(categorySearchButton, categorySearchActiveBackground);
categorySearchButton.BackgroundImage = categorySearchActiveBackground;
isOnOrderedSongsPage = false; isOnOrderedSongsPage = false;
ResetCatBtnStatus();
loveDuetButton.BackgroundImage = loveDuetActiveBackground;
/*loveDuetSongs = allSongs.Where(song => song.SongGenre.Contains("A1")) /*loveDuetSongs = allSongs.Where(song => song.SongGenre.Contains("A1"))
.OrderByDescending(song => song.Plays) .OrderByDescending(song => song.Plays)
@ -107,7 +82,7 @@ namespace DualScreenDemo
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(loveDuetSongs); multiPagePanel.LoadSongs(loveDuetSongs);
SetHotSongButtonsVisibility(false); SetHotSongButtonsVisibility(false);
SetNewSongButtonsVisibility(false); SetNewSongButtonsVisibility(false);
SetSingerSearchButtonsVisibility(false); SetSingerSearchButtonsVisibility(false);
@ -124,7 +99,8 @@ namespace DualScreenDemo
SetPictureBoxSceneSoundEffectsAndButtonsVisibility(false); SetPictureBoxSceneSoundEffectsAndButtonsVisibility(false);
SetPictureBoxCategoryAndButtonsVisibility(true); SetPictureBoxCategoryAndButtonsVisibility(true);
UpdateCatBtns(loveDuetButton, loveDuetActiveBackground);
if (pictureBoxQRCode != null) if (pictureBoxQRCode != null)
{ {
pictureBoxQRCode.Visible = false; pictureBoxQRCode.Visible = false;
@ -142,30 +118,30 @@ namespace DualScreenDemo
} }
private void SetPictureBoxCategoryAndButtonsVisibility(bool isVisible) private void SetPictureBoxCategoryAndButtonsVisibility(bool isVisible)
{ {
loveDuetButton.Visible = isVisible; loveDuetButton.Visible = isVisible;
loveDuetButton.BringToFront(); loveDuetButton.BringToFront();
talentShowButton.Visible = isVisible; talentShowButton.Visible = isVisible;
talentShowButton.BringToFront(); talentShowButton.BringToFront();
medleyDanceButton.Visible = isVisible; medleyDanceButton.Visible = isVisible;
medleyDanceButton.BringToFront(); medleyDanceButton.BringToFront();
ninetiesButton.Visible = isVisible; ninetiesButton.Visible = isVisible;
ninetiesButton.BringToFront(); ninetiesButton.BringToFront();
nostalgicSongsButton.Visible = isVisible; nostalgicSongsButton.Visible = isVisible;
nostalgicSongsButton.BringToFront(); nostalgicSongsButton.BringToFront();
chinaSongsButton.Visible = isVisible; chinaSongsButton.Visible = isVisible;
chinaSongsButton.BringToFront(); chinaSongsButton.BringToFront();
vietnameseSongsButton.Visible = isVisible; vietnameseSongsButton.Visible = isVisible;
vietnameseSongsButton.BringToFront(); vietnameseSongsButton.BringToFront();
} }
private string SetQueryforSQL(string contains){ private string SetQueryforSQL(string contains){

View File

@ -4,12 +4,8 @@ namespace DualScreenDemo
{ {
private void GroupGuoYuButton_Click(object sender, EventArgs e) private void GroupGuoYuButton_Click(object sender, EventArgs e)
{ {
groupGuoYuButton.BackgroundImage = groupGuoYuActiveBackground;
groupTaiYuButton.BackgroundImage = groupTaiYuNormalBackground; UpdateGroupSubBtns(groupGuoYuButton, groupGuoYuActiveBackground);
groupYueYuButton.BackgroundImage = groupYueYuNormalBackground;
groupYingWenButton.BackgroundImage = groupYingWenNormalBackground;
groupRiYuButton.BackgroundImage = groupRiYuNormalBackground;
groupHanYuButton.BackgroundImage = groupHanYuNormalBackground;
/*guoYuSongs = allSongs.Where(song => song.Category == "國語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團")) /*guoYuSongs = allSongs.Where(song => song.Category == "國語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
.OrderByDescending(song => song.Plays) .OrderByDescending(song => song.Plays)

View File

@ -4,12 +4,7 @@ namespace DualScreenDemo
{ {
private void GroupHanYuButton_Click(object sender, EventArgs e) private void GroupHanYuButton_Click(object sender, EventArgs e)
{ {
groupGuoYuButton.BackgroundImage = groupGuoYuNormalBackground; UpdateGroupSubBtns(groupHanYuButton, groupHanYuActiveBackground);
groupTaiYuButton.BackgroundImage = groupTaiYuNormalBackground;
groupYueYuButton.BackgroundImage = groupYueYuNormalBackground;
groupYingWenButton.BackgroundImage = groupYingWenNormalBackground;
groupRiYuButton.BackgroundImage = groupRiYuNormalBackground;
groupHanYuButton.BackgroundImage = groupHanYuActiveBackground;
/*hanYuSongs = allSongs.Where(song => song.Category == "韓語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團")) /*hanYuSongs = allSongs.Where(song => song.Category == "韓語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
.OrderByDescending(song => song.Plays) .OrderByDescending(song => song.Plays)

View File

@ -4,17 +4,12 @@ namespace DualScreenDemo
{ {
private void GroupRiYuButton_Click(object sender, EventArgs e) private void GroupRiYuButton_Click(object sender, EventArgs e)
{ {
groupGuoYuButton.BackgroundImage = groupGuoYuNormalBackground; UpdateGroupSubBtns(groupRiYuButton, groupRiYuActiveBackground);
groupTaiYuButton.BackgroundImage = groupTaiYuNormalBackground;
groupYueYuButton.BackgroundImage = groupYueYuNormalBackground;
groupYingWenButton.BackgroundImage = groupYingWenNormalBackground;
groupRiYuButton.BackgroundImage = groupRiYuActiveBackground;
groupHanYuButton.BackgroundImage = groupHanYuNormalBackground;
/*riYuSongs = allSongs.Where(song => song.Category == "日語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團")) /*riYuSongs = allSongs.Where(song => song.Category == "日語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
.OrderByDescending(song => song.Plays) .OrderByDescending(song => song.Plays)
.ToList();*/ .ToList();*/
string query = "SELECT * FROM song_library_cache WHERE language_name = '日語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;"; string query = "SELECT * FROM song_library_cache WHERE language_name = '日語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;";
var riYuSongs = SearchSongs_Mysql(query); var riYuSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;

View File

@ -4,12 +4,7 @@ namespace DualScreenDemo
{ {
private void GroupTaiYuButton_Click(object sender, EventArgs e) private void GroupTaiYuButton_Click(object sender, EventArgs e)
{ {
groupGuoYuButton.BackgroundImage = groupGuoYuNormalBackground; UpdateGroupSubBtns(groupTaiYuButton, groupTaiYuActiveBackground);
groupTaiYuButton.BackgroundImage = groupTaiYuActiveBackground;
groupYueYuButton.BackgroundImage = groupYueYuNormalBackground;
groupYingWenButton.BackgroundImage = groupYingWenNormalBackground;
groupRiYuButton.BackgroundImage = groupRiYuNormalBackground;
groupHanYuButton.BackgroundImage = groupHanYuNormalBackground;
/*taiYuSongs = allSongs.Where(song => song.Category == "台語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團")) /*taiYuSongs = allSongs.Where(song => song.Category == "台語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
.OrderByDescending(song => song.Plays) .OrderByDescending(song => song.Plays)

View File

@ -4,12 +4,7 @@ namespace DualScreenDemo
{ {
private void GroupYingWenButton_Click(object sender, EventArgs e) private void GroupYingWenButton_Click(object sender, EventArgs e)
{ {
groupGuoYuButton.BackgroundImage = groupGuoYuNormalBackground; UpdateGroupSubBtns(groupYingWenButton, groupYingWenActiveBackground);
groupTaiYuButton.BackgroundImage = groupTaiYuNormalBackground;
groupYueYuButton.BackgroundImage = groupYueYuNormalBackground;
groupYingWenButton.BackgroundImage = groupYingWenActiveBackground;
groupRiYuButton.BackgroundImage = groupRiYuNormalBackground;
groupHanYuButton.BackgroundImage = groupHanYuNormalBackground;
/*yingWenSongs = allSongs.Where(song => song.Category == "英語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團")) /*yingWenSongs = allSongs.Where(song => song.Category == "英語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
.OrderByDescending(song => song.Plays) .OrderByDescending(song => song.Plays)

View File

@ -4,17 +4,12 @@ namespace DualScreenDemo
{ {
private void GroupYueYuButton_Click(object sender, EventArgs e) private void GroupYueYuButton_Click(object sender, EventArgs e)
{ {
groupGuoYuButton.BackgroundImage = groupGuoYuNormalBackground; UpdateGroupSubBtns(groupYueYuButton, groupYueYuActiveBackground);
groupTaiYuButton.BackgroundImage = groupTaiYuNormalBackground;
groupYueYuButton.BackgroundImage = groupYueYuActiveBackground;
groupYingWenButton.BackgroundImage = groupYingWenNormalBackground;
groupRiYuButton.BackgroundImage = groupRiYuNormalBackground;
groupHanYuButton.BackgroundImage = groupHanYuNormalBackground;
/*yueYuSongs = allSongs.Where(song => song.Category == "粵語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團")) /*yueYuSongs = allSongs.Where(song => song.Category == "粵語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
.OrderByDescending(song => song.Plays) .OrderByDescending(song => song.Plays)
.ToList();*/ .ToList();*/
string query = "SELECT * FROM song_library_cache WHERE language_name = '粵語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;"; string query = "SELECT * FROM song_library_cache WHERE language_name = '粵語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_counts DESC;";
var yueYuSongs = SearchSongs_Mysql(query); var yueYuSongs = SearchSongs_Mysql(query);
currentPage = 0; currentPage = 0;

View File

@ -1,5 +1,3 @@
using System.IO;
namespace DualScreenDemo namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
@ -27,108 +25,46 @@ namespace DualScreenDemo
private Bitmap groupHanYuNormalBackground; private Bitmap groupHanYuNormalBackground;
private Bitmap groupHanYuActiveBackground; private Bitmap groupHanYuActiveBackground;
private void UpdateGroupSubBtns(Button activeButton, Image activeBackground)
{
groupGuoYuButton.BackgroundImage = groupGuoYuNormalBackground;
groupTaiYuButton.BackgroundImage = groupTaiYuNormalBackground;
groupYueYuButton.BackgroundImage = groupYueYuNormalBackground;
groupYingWenButton.BackgroundImage = groupYingWenNormalBackground;
groupRiYuButton.BackgroundImage = groupRiYuNormalBackground;
groupHanYuButton.BackgroundImage = groupHanYuNormalBackground;
activeButton.BackgroundImage = activeBackground;
}
private void InitializeButtonsForGroupPictureBox() private void InitializeButtonsForGroupPictureBox()
{ {
var data = LoadBtnConfigData();
groupGuoYuButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(groupGuoYuButton, 1197, 225, 225, 50);
Rectangle groupGuoYuButtonCropArea = new Rectangle(1197, 225, 225, 50);
groupGuoYuNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_國語(未按).png"));
groupGuoYuActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_國語(已按).png"));
groupGuoYuButton.BackgroundImage = groupGuoYuNormalBackground;
groupGuoYuButton.BackgroundImageLayout = ImageLayout.Stretch;
groupGuoYuButton.FlatStyle = FlatStyle.Flat;
groupGuoYuButton.FlatAppearance.BorderSize = 0;
groupGuoYuButton.Click += GroupGuoYuButton_Click;
this.Controls.Add(groupGuoYuButton);
groupTaiYuButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(groupTaiYuButton, 1197, 280, 225, 50);
Rectangle groupTaiYuButtonCropArea = new Rectangle(1197, 280, 225, 50);
groupTaiYuNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_台語(未按).png"));
groupTaiYuActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_台語(已按).png"));
groupTaiYuButton.BackgroundImage = groupTaiYuNormalBackground;
groupTaiYuButton.BackgroundImageLayout = ImageLayout.Stretch;
groupTaiYuButton.FlatStyle = FlatStyle.Flat;
groupTaiYuButton.FlatAppearance.BorderSize = 0;
groupTaiYuButton.Click += GroupTaiYuButton_Click;
this.Controls.Add(groupTaiYuButton);
InitializeButton(ref groupGuoYuButton, ref groupGuoYuNormalBackground, ref groupGuoYuActiveBackground, "groupGuoYuButton", 1197, 225, 225, 50, data["GroupSubBtn"]["GuoYuNormal"], data["GroupSubBtn"]["GuoYuActive"], GroupGuoYuButton_Click);
groupYueYuButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(groupYueYuButton, 1197, 335, 225, 50);
Rectangle groupYueYuButtonCropArea = new Rectangle(1197, 335, 225, 50);
groupYueYuNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_粵語(未按).png"));
groupYueYuActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_粵語(已按).png"));
groupYueYuButton.BackgroundImage = groupYueYuNormalBackground;
groupYueYuButton.BackgroundImageLayout = ImageLayout.Stretch;
groupYueYuButton.FlatStyle = FlatStyle.Flat;
groupYueYuButton.FlatAppearance.BorderSize = 0;
groupYueYuButton.Click += GroupYueYuButton_Click;
this.Controls.Add(groupYueYuButton);
InitializeButton(ref groupTaiYuButton, ref groupTaiYuNormalBackground, ref groupTaiYuActiveBackground, "groupTaiYuButton", 1197, 280, 225, 50, data["GroupSubBtn"]["TaiYuNormal"], data["GroupSubBtn"]["TaiYuActive"], GroupTaiYuButton_Click);
groupYingWenButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(groupYingWenButton, 1197, 390, 225, 50);
Rectangle groupYingWenButtonCropArea = new Rectangle(1197, 390, 225, 50);
groupYingWenNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_英語(未按).png"));
groupYingWenActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_英語(已按).png"));
groupYingWenButton.BackgroundImage = groupYingWenNormalBackground;
groupYingWenButton.BackgroundImageLayout = ImageLayout.Stretch;
groupYingWenButton.FlatStyle = FlatStyle.Flat;
groupYingWenButton.FlatAppearance.BorderSize = 0;
groupYingWenButton.Click += GroupYingWenButton_Click;
this.Controls.Add(groupYingWenButton);
InitializeButton(ref groupYueYuButton, ref groupYueYuNormalBackground, ref groupYueYuActiveBackground, "groupYueYuButton", 1197, 335, 225, 50, data["GroupSubBtn"]["YueYuNormal"], data["GroupSubBtn"]["YueYuActive"], GroupYueYuButton_Click);
groupRiYuButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(groupRiYuButton, 1197, 445, 225, 50); InitializeButton(ref groupYingWenButton, ref groupYingWenNormalBackground, ref groupYingWenActiveBackground, "groupYingWenButton", 1197, 390, 225, 50, data["GroupSubBtn"]["YingWenNormal"], data["GroupSubBtn"]["YingWenActive"], GroupYingWenButton_Click);
Rectangle groupRiYuButtonCropArea = new Rectangle(1197, 445, 225, 50);
groupRiYuNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_日語(未按).png")); InitializeButton(ref groupRiYuButton, ref groupRiYuNormalBackground, ref groupRiYuActiveBackground, "groupRiYuButton", 1197, 445, 225, 50, data["GroupSubBtn"]["RiYuNormal"], data["GroupSubBtn"]["RiYuActive"], GroupRiYuButton_Click);
groupRiYuActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_日語(已按).png"));
groupRiYuButton.BackgroundImage = groupRiYuNormalBackground; InitializeButton(ref groupHanYuButton, ref groupHanYuNormalBackground, ref groupHanYuActiveBackground, "groupHanYuButton", 1197, 500, 225, 50, data["GroupSubBtn"]["HanYuNormal"], data["GroupSubBtn"]["HanYuActive"], GroupHanYuButton_Click);
groupRiYuButton.BackgroundImageLayout = ImageLayout.Stretch;
groupRiYuButton.FlatStyle = FlatStyle.Flat;
groupRiYuButton.FlatAppearance.BorderSize = 0;
groupRiYuButton.Click += GroupRiYuButton_Click;
this.Controls.Add(groupRiYuButton);
groupHanYuButton = new Button { Text = "", Visible = false };
ResizeAndPositionButton(groupHanYuButton, 1197, 500, 225, 50);
Rectangle groupHanYuButtonCropArea = new Rectangle(1197, 500, 225, 50);
groupHanYuNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_韓語(未按).png"));
groupHanYuActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\6.團體查詢_韓語(已按).png"));
groupHanYuButton.BackgroundImage = groupHanYuNormalBackground;
groupHanYuButton.BackgroundImageLayout = ImageLayout.Stretch;
groupHanYuButton.FlatStyle = FlatStyle.Flat;
groupHanYuButton.FlatAppearance.BorderSize = 0;
groupHanYuButton.Click += GroupHanYuButton_Click;
this.Controls.Add(groupHanYuButton);
} }
private void GroupSongSelectionButton_Click(object sender, EventArgs e) private void GroupSongSelectionButton_Click(object sender, EventArgs e)
{ {
newSongAlertButton.BackgroundImage = newSongAlertNormalBackground; UpdateButtonBackgrounds(groupSearchButton, groupSearchActiveBackground);
hotPlayButton.BackgroundImage = hotPlayNormalBackground;
singerSearchButton.BackgroundImage = singerSearchNormalBackground;
songSearchButton.BackgroundImage = songSearchNormalBackground;
languageSearchButton.BackgroundImage = languageSearchNormalBackground;
groupSearchButton.BackgroundImage = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_合唱查詢(已按).png"));
categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = promotionsNormalBackground;
deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground;
isOnOrderedSongsPage = false; isOnOrderedSongsPage = false;
groupGuoYuButton.BackgroundImage = groupGuoYuActiveBackground;
groupTaiYuButton.BackgroundImage = groupTaiYuNormalBackground;
groupYueYuButton.BackgroundImage = groupYueYuNormalBackground;
groupYingWenButton.BackgroundImage = groupYingWenNormalBackground;
groupRiYuButton.BackgroundImage = groupRiYuNormalBackground;
groupHanYuButton.BackgroundImage = groupHanYuNormalBackground;
/*guoYuSongs = allSongs.Where(song => song.Category == "國語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團")) /*guoYuSongs = allSongs.Where(song => song.Category == "國語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
.OrderByDescending(song => song.Plays) .OrderByDescending(song => song.Plays)
@ -161,7 +97,8 @@ namespace DualScreenDemo
SetPictureBoxSceneSoundEffectsAndButtonsVisibility(false); SetPictureBoxSceneSoundEffectsAndButtonsVisibility(false);
SetGroupButtonsVisibility(true); SetGroupButtonsVisibility(true);
UpdateGroupSubBtns(groupGuoYuButton, groupGuoYuActiveBackground);
if (pictureBoxQRCode != null) if (pictureBoxQRCode != null)
{ {
pictureBoxQRCode.Visible = false; pictureBoxQRCode.Visible = false;

View File

@ -1,12 +1,11 @@
using System.IO;
using DBObj; using DBObj;
namespace DualScreenDemo namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private Button hotPlayButton; private Button hotPlayButton;
private Bitmap hotPlayNormalBackground; private Bitmap hotPlayNormalBackground;
private Bitmap hotPlayActiveBackground; private Bitmap hotPlayActiveBackground;
private Button guoYuButtonHotSong; private Button guoYuButtonHotSong;
private Bitmap guoYuHotSongNormalBackground; private Bitmap guoYuHotSongNormalBackground;
@ -31,56 +30,71 @@ namespace DualScreenDemo
private Bitmap hanYuHotSongActiveBackground; private Bitmap hanYuHotSongActiveBackground;
private void UpdateHotSongButtons(Button activeButton, Image activeBackground)
{
guoYuButtonHotSong.BackgroundImage = guoYuHotSongNormalBackground;
taiYuButtonHotSong.BackgroundImage = taiYuHotSongNormalBackground;
taiYuNewSongButtonHotSong.BackgroundImage = taiYuNewSongHotSongNormalBackground;
guoYuNewSongButtonHotSong.BackgroundImage = guoYuNewSongHotSongNormalBackground;
yingWenButtonHotSong.BackgroundImage = yingWenHotSongNormalBackground;
riYuButtonHotSong.BackgroundImage = riYuHotSongNormalBackground;
hanYuButtonHotSong.BackgroundImage = hanYuHotSongNormalBackground;
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) private void SetHotSongButtonsVisibility(bool isVisible)
{ {
Button[] hotSongButtons = { guoYuButtonHotSong, taiYuButtonHotSong, taiYuNewSongButtonHotSong, guoYuNewSongButtonHotSong, yingWenButtonHotSong, riYuButtonHotSong, hanYuButtonHotSong }; Button[] hotSongButtons = { guoYuButtonHotSong, taiYuButtonHotSong, taiYuNewSongButtonHotSong, guoYuNewSongButtonHotSong, yingWenButtonHotSong, riYuButtonHotSong, hanYuButtonHotSong };
foreach (var button in hotSongButtons) foreach (var button in hotSongButtons)
{ {
button.Visible = isVisible; button.Visible = isVisible;
if (isVisible) if (isVisible)
{ {
button.BringToFront(); button.BringToFront();
} }
} }
} }
public void HotPlayButton_Click(object sender, EventArgs e) public void HotPlayButton_Click(object sender, EventArgs e)
{ {
UpdateButtonBackgrounds(hotPlayButton, new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_熱門排行(已按).png"))); UpdateButtonBackgrounds(hotPlayButton, hotPlayActiveBackground);
UpdateHotSongButtons(guoYuButtonHotSong, guoYuHotSongActiveBackground);
isOnOrderedSongsPage = false; isOnOrderedSongsPage = false;
/* 清空搜尋欄 */ /* 清空搜尋欄 */
ResetinputBox(); ResetinputBox();
string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY `song_counts` DESC LIMIT 1000;"; string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY `song_counts` DESC LIMIT 1000;";
var guoYuSongs = SearchSongs_Mysql(query); var guoYuSongs = SearchSongs_Mysql(query);
UpdateSongList(guoYuSongs); UpdateSongList(guoYuSongs);
SetButtonsVisibility();
//HideQRCode();
}
private void UpdateButtonBackgrounds(Button activeButton, Image activeBackground) SetButtonsVisibility();
{ UpdateHotSongButtons(guoYuNewSongButtonHotSong, guoYuNewSongHotSongActiveBackground);
newSongAlertButton.BackgroundImage = newSongAlertNormalBackground; //HideQRCode();
hotPlayButton.BackgroundImage = hotPlayNormalBackground;
singerSearchButton.BackgroundImage = singerSearchNormalBackground;
songSearchButton.BackgroundImage = songSearchNormalBackground;
languageSearchButton.BackgroundImage = languageSearchNormalBackground;
groupSearchButton.BackgroundImage = groupSearchNormalBackground;
categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = promotionsNormalBackground;
deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground;
activeButton.BackgroundImage = activeBackground;
} }
private void OnHotSongButtonClick(Button activeButton, Bitmap activeBackground, string category) private void OnHotSongButtonClick(Button activeButton, Bitmap activeBackground, string category)
@ -93,25 +107,12 @@ namespace DualScreenDemo
UpdateSongList(selectedSongs); UpdateSongList(selectedSongs);
} }
private void UpdateHotSongButtons(Button activeButton, Image activeBackground)
{
guoYuButtonHotSong.BackgroundImage = guoYuHotSongNormalBackground;
taiYuButtonHotSong.BackgroundImage = taiYuHotSongNormalBackground;
taiYuNewSongButtonHotSong.BackgroundImage = taiYuNewSongHotSongNormalBackground;
guoYuNewSongButtonHotSong.BackgroundImage = guoYuNewSongHotSongNormalBackground;
yingWenButtonHotSong.BackgroundImage = yingWenHotSongNormalBackground;
riYuButtonHotSong.BackgroundImage = riYuHotSongNormalBackground;
hanYuButtonHotSong.BackgroundImage = hanYuHotSongNormalBackground;
activeButton.BackgroundImage = activeBackground;
}
private void UpdateSongList(List<SongData> songs) private void UpdateSongList(List<SongData> songs)
{ {
currentPage = 0; currentPage = 0;
totalPages = (int)Math.Ceiling((double)songs.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)songs.Count / itemsPerPage);
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(songs); multiPagePanel.LoadSongs(songs);
} }
@ -141,89 +142,7 @@ namespace DualScreenDemo
closeQRCodeButton.Visible = false; closeQRCodeButton.Visible = false;
} }
private void InitializeButtonsForHotSong()
{
InitializeHotSongButton(ref guoYuNewSongButtonHotSong, "國語新歌", 1197, 225, 225, 50,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_國語新歌排行(未按).png")),
out guoYuNewSongHotSongNormalBackground,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_國語新歌排行(已按).png")),
out guoYuNewSongHotSongActiveBackground,
GuoYuNewSongButtonHotSong_Click);
InitializeHotSongButton(ref taiYuNewSongButtonHotSong, "台語新歌", 1197, 280, 225, 50,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_台語新歌排行(未按).png")),
out taiYuNewSongHotSongNormalBackground,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_台語新歌排行(已按).png")),
out taiYuNewSongHotSongActiveBackground,
TaiYuNewSongButtonHotSong_Click);
InitializeHotSongButton(ref taiYuButtonHotSong, "台語", 1197, 335, 225, 50,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_台語人氣排行(未按).png")),
out taiYuHotSongNormalBackground,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_台語人氣排行(已按).png")),
out taiYuHotSongActiveBackground,
TaiYuButtonHotSong_Click);
InitializeHotSongButton(ref guoYuButtonHotSong, "國語", 1197, 390, 225, 50,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_國語人氣排行(未按).png")),
out guoYuHotSongNormalBackground,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_國語人氣排行(已按).png")),
out guoYuHotSongActiveBackground,
GuoYuButtonHotSong_Click);
InitializeHotSongButton(ref yingWenButtonHotSong, "英文", 1197, 445, 225, 50,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_英語人氣排行(未按).png")),
out yingWenHotSongNormalBackground,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_英語人氣排行(已按).png")),
out yingWenHotSongActiveBackground,
YingWenButtonHotSong_Click);
InitializeHotSongButton(ref riYuButtonHotSong, "日語", 1197, 500, 225, 50,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_日語人氣排行(未按).png")),
out riYuHotSongNormalBackground,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_日語人氣排行(已按).png")),
out riYuHotSongActiveBackground,
RiYuButtonHotSong_Click);
InitializeHotSongButton(ref hanYuButtonHotSong, "韓語", 1197, 555, 225, 50,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_韓語人氣排行(未按).png")),
out hanYuHotSongNormalBackground,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\2.熱門排行_韓語人氣排行(已按).png")),
out hanYuHotSongActiveBackground,
HanYuButtonHotSong_Click);
}
private void InitializeHotSongButton(ref Button button, string buttonText, int x, int y, int width, int height,
Image normalBackground, out Bitmap normalBackgroundOut,
Image activeBackground, out Bitmap activeBackgroundOut,
EventHandler clickEventHandler)
{
button = new Button {
Text = "", // 移除文字
Visible = false
};
ResizeAndPositionButton(button, x, y, width, height);
// 修改裁剪區域,避開文字部分
Rectangle cropArea = new Rectangle(1214, y, 209, 58); // 使用固定的裁剪區域
//normalBackgroundOut = new Bitmap(normalBackground).Clone(cropArea, normalBackground.PixelFormat);
//activeBackgroundOut = new Bitmap(activeBackground).Clone(cropArea, activeBackground.PixelFormat);
normalBackgroundOut = new Bitmap(normalBackground);
activeBackgroundOut = new Bitmap(activeBackground);
button.BackgroundImage = normalBackgroundOut;
button.BackgroundImageLayout = ImageLayout.Stretch;
button.FlatStyle = FlatStyle.Flat;
button.FlatAppearance.BorderSize = 0;
button.Click += clickEventHandler;
this.Controls.Add(button);
}
} }
} }

View File

@ -4,11 +4,6 @@ namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private void InitializeGuoYuButton()
{
Rectangle guoYuButtonCropArea = new Rectangle(1197, 225, 225, 20);
InitializeButton(ref guoYuButton, "國語", 1197, 225, 225, 50, guoYuButtonCropArea, new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_國語(未按).png")), out guoYuNormalBackground, new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_國語(已按).png")), out guoYuActiveBackground, GuoYuButton_Click);
}
private void GuoYuButton_Click(object sender, EventArgs e) private void GuoYuButton_Click(object sender, EventArgs e)
{ {

View File

@ -4,11 +4,6 @@ namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private void InitializeHanYuButton()
{
Rectangle hanYuButtonCropArea = new Rectangle(1197, 500, 225, 50);
InitializeButton(ref hanYuButton, "韓語", 1197, 500, 225, 50, hanYuButtonCropArea, new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_韓語(未按).png")), out hanYuNormalBackground, new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_韓語(已按).png")), out hanYuActiveBackground, HanYuButton_Click);
}
private void HanYuButton_Click(object sender, EventArgs e) private void HanYuButton_Click(object sender, EventArgs e)
{ {

View File

@ -4,12 +4,6 @@ namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private void InitializeKeYuButton()
{
Rectangle keYuButtonCropArea = new Rectangle(1197, 555, 225, 50);
InitializeButton(ref keYuButton, "客語", 1197, 555, 225, 50, keYuButtonCropArea, new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_客語(未按).png")), out keYuNormalBackground, new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_客語(已按).png")), out keYuActiveBackground, KeYuButton_Click);
}
private void KeYuButton_Click(object sender, EventArgs e) private void KeYuButton_Click(object sender, EventArgs e)
{ {
OnLanguageButtonClick(keYuButton, keYuActiveBackground, "客語"); OnLanguageButtonClick(keYuButton, keYuActiveBackground, "客語");

View File

@ -4,11 +4,6 @@ namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private void InitializeRiYuButton()
{
Rectangle riYuButtonCropArea = new Rectangle(1197, 445, 225, 50);
InitializeButton(ref riYuButton, "日語", 1197, 445, 225, 50, riYuButtonCropArea, new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_日語(未按).png")), out riYuNormalBackground, new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_日語(已按).png")), out riYuActiveBackground, RiYuButton_Click);
}
private void RiYuButton_Click(object sender, EventArgs e) private void RiYuButton_Click(object sender, EventArgs e)
{ {

View File

@ -4,11 +4,6 @@ namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private void InitializeTaiYuButton()
{
Rectangle taiYuButtonCropArea = new Rectangle(1197, 280, 225, 50);
InitializeButton(ref taiYuButton, "台語", 1197, 280, 225, 50, taiYuButtonCropArea, new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_台語(未按).png")), out taiYuNormalBackground, new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_台語(已按).png")), out taiYuActiveBackground, TaiYuButton_Click);
}
private void TaiYuButton_Click(object sender, EventArgs e) private void TaiYuButton_Click(object sender, EventArgs e)
{ {

View File

@ -4,11 +4,6 @@ namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private void InitializeYingWenButton()
{
Rectangle yingWenButtonCropArea = new Rectangle(1197, 390, 225, 50);
InitializeButton(ref yingWenButton, "英文", 1197, 390, 225, 50, yingWenButtonCropArea, new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_英語(未按).png")), out yingWenNormalBackground, new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_英語(已按).png")), out yingWenActiveBackground, YingWenButton_Click);
}
private void YingWenButton_Click(object sender, EventArgs e) private void YingWenButton_Click(object sender, EventArgs e)
{ {

View File

@ -4,11 +4,6 @@ namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private void InitializeYueYuButton()
{
Rectangle yueYuButtonCropArea = new Rectangle(1197, 335, 225, 50);
InitializeButton(ref yueYuButton, "粵語", 1197, 335, 225, 50, yueYuButtonCropArea, new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_粵語(未按).png")), out yueYuNormalBackground, new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\5.語別查詢_粵語(已按).png")), out yueYuActiveBackground, YueYuButton_Click);
}
private void YueYuButton_Click(object sender, EventArgs e) private void YueYuButton_Click(object sender, EventArgs e)
{ {

View File

@ -1,29 +1,11 @@
using DBObj; using DBObj;
using MySqlConnector; using MySqlConnector;
using System.Globalization; using System.Globalization;
using System.IO;
namespace DualScreenDemo namespace DualScreenDemo
{ {
public partial class PrimaryForm public partial class PrimaryForm
{ {
private void InitializeButton(ref Button button, string buttonText, int x, int y, int width, int height, Rectangle cropArea, Image normalBackground, out Bitmap normalBackgroundOut, Image activeBackground, out Bitmap activeBackgroundOut, EventHandler clickEventHandler)
{
button = new Button { Text = "", Visible = false };
ResizeAndPositionButton(button, x, y, width, height);
//normalBackgroundOut = new Bitmap(normalBackground).Clone(cropArea, normalBackground.PixelFormat);
//activeBackgroundOut = new Bitmap(activeBackground).Clone(cropArea, activeBackground.PixelFormat);
normalBackgroundOut = new Bitmap(normalBackground);
activeBackgroundOut = new Bitmap(activeBackground);
button.BackgroundImage = normalBackgroundOut;
button.BackgroundImageLayout = ImageLayout.Stretch;
button.FlatStyle = FlatStyle.Flat;
button.FlatAppearance.BorderSize = 0;
button.Click += clickEventHandler;
this.Controls.Add(button);
}
private Button languageSearchButton; private Button languageSearchButton;
private Bitmap languageSearchNormalBackground; private Bitmap languageSearchNormalBackground;
private Bitmap languageSearchActiveBackground; private Bitmap languageSearchActiveBackground;
@ -49,25 +31,10 @@ namespace DualScreenDemo
private Button keYuButton; private Button keYuButton;
private Bitmap keYuNormalBackground; private Bitmap keYuNormalBackground;
private Bitmap keYuActiveBackground; private Bitmap keYuActiveBackground;
// 語別查詢 query LIMIT 100 可更改
private void LanguageSongSelectionButton_Click(object sender, EventArgs e) private void UpdateLangBtns(Button activeButton, Image activeBackground)
{ {
newSongAlertButton.BackgroundImage = newSongAlertNormalBackground; guoYuButton.BackgroundImage = guoYuNormalBackground;
hotPlayButton.BackgroundImage = hotPlayNormalBackground;
singerSearchButton.BackgroundImage = singerSearchNormalBackground;
songSearchButton.BackgroundImage = songSearchNormalBackground;
languageSearchButton.BackgroundImage = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_語別查詢(已按).png"));
groupSearchButton.BackgroundImage = groupSearchNormalBackground;
categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = promotionsNormalBackground;
deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground;
isOnOrderedSongsPage = false;
guoYuButton.BackgroundImage = guoYuActiveBackground;
taiYuButton.BackgroundImage = taiYuNormalBackground; taiYuButton.BackgroundImage = taiYuNormalBackground;
yueYuButton.BackgroundImage = yueYuNormalBackground; yueYuButton.BackgroundImage = yueYuNormalBackground;
yingWenButton.BackgroundImage = yingWenNormalBackground; yingWenButton.BackgroundImage = yingWenNormalBackground;
@ -75,6 +42,37 @@ namespace DualScreenDemo
hanYuButton.BackgroundImage = hanYuNormalBackground; hanYuButton.BackgroundImage = hanYuNormalBackground;
keYuButton.BackgroundImage = keYuNormalBackground; keYuButton.BackgroundImage = keYuNormalBackground;
activeButton.BackgroundImage = activeBackground;
}
private void InitializeLangSearchButtons()
{
var data = LoadBtnConfigData();
InitializeButton(ref guoYuButton, ref guoYuNormalBackground, ref guoYuActiveBackground, "guoYuButton", 1197, 225, 225, 50, data["LangSearchSubBtn"]["GuoYuLangNormal"], data["LangSearchSubBtn"]["GuoYuLangActive"], GuoYuButton_Click);
InitializeButton(ref taiYuButton, ref taiYuNormalBackground, ref taiYuActiveBackground, "taiYuButton", 1197, 280, 225, 50, data["LangSearchSubBtn"]["TaiYuLangNormal"], data["LangSearchSubBtn"]["TaiYuLangActive"], TaiYuButton_Click);
InitializeButton(ref yueYuButton, ref yueYuNormalBackground, ref yueYuActiveBackground, "yueYuButton", 1197, 335, 225, 50, data["LangSearchSubBtn"]["YueYuLangNormal"], data["LangSearchSubBtn"]["YueYuLangActive"], YueYuButton_Click);
InitializeButton(ref yingWenButton, ref yingWenNormalBackground, ref yingWenActiveBackground, "yingWenButton", 1197, 390, 225, 50, data["LangSearchSubBtn"]["EngLangNormal"], data["LangSearchSubBtn"]["EngLangActive"], YingWenButton_Click);
InitializeButton(ref riYuButton, ref riYuNormalBackground, ref riYuActiveBackground, "riYuButton", 1197, 445, 225, 50, data["LangSearchSubBtn"]["JapLangNormal"], data["LangSearchSubBtn"]["JapLangActive"], RiYuButton_Click);
InitializeButton(ref hanYuButton, ref hanYuNormalBackground, ref hanYuActiveBackground, "hanYuButton", 1197, 500, 225, 50, data["LangSearchSubBtn"]["KrLangNormal"], data["LangSearchSubBtn"]["KrLangActive"], HanYuButton_Click);
InitializeButton(ref keYuButton, ref keYuNormalBackground, ref keYuActiveBackground, "keYuButton", 1197, 555, 225, 50, data["LangSearchSubBtn"]["KeYuLangNormal"], data["LangSearchSubBtn"]["KeYuLangActive"], KeYuButton_Click);
}
private void LanguageSongSelectionButton_Click(object sender, EventArgs e)
{
UpdateButtonBackgrounds(languageSearchButton, languageSearchActiveBackground);
isOnOrderedSongsPage = false;
/* 清空搜尋欄 */ /* 清空搜尋欄 */
ResetinputBox(); ResetinputBox();
string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY song_counts DESC LIMIT 1000"; string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY song_counts DESC LIMIT 1000";
@ -101,7 +99,10 @@ namespace DualScreenDemo
SetPictureBoxSceneSoundEffectsAndButtonsVisibility(false); SetPictureBoxSceneSoundEffectsAndButtonsVisibility(false);
SetPictureBoxLanguageButtonsVisibility(true); SetPictureBoxLanguageButtonsVisibility(true);
UpdateLangBtns(guoYuButton, guoYuActiveBackground);
if (pictureBoxQRCode != null) if (pictureBoxQRCode != null)
{ {
pictureBoxQRCode.Visible = false; pictureBoxQRCode.Visible = false;
@ -111,17 +112,9 @@ namespace DualScreenDemo
private void OnLanguageButtonClick(Button activeButton, Image activeBackground, string category) private void OnLanguageButtonClick(Button activeButton, Image activeBackground, string category)
{ {
guoYuButton.BackgroundImage = guoYuNormalBackground;
taiYuButton.BackgroundImage = taiYuNormalBackground;
yueYuButton.BackgroundImage = yueYuNormalBackground;
yingWenButton.BackgroundImage = yingWenNormalBackground;
riYuButton.BackgroundImage = riYuNormalBackground;
hanYuButton.BackgroundImage = hanYuNormalBackground;
keYuButton.BackgroundImage = keYuNormalBackground;
UpdateLangBtns(activeButton, activeBackground);
activeButton.BackgroundImage = activeBackground;
string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY song_counts DESC LIMIT 1000"; string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY song_counts DESC LIMIT 1000";
var selectedSongs = SearchSongs_Mysql(query); var selectedSongs = SearchSongs_Mysql(query);
@ -133,22 +126,22 @@ namespace DualScreenDemo
} }
private void SetPictureBoxLanguageButtonsVisibility(bool isVisible) private void SetPictureBoxLanguageButtonsVisibility(bool isVisible)
{ {
guoYuButton.Visible = isVisible; guoYuButton.Visible = isVisible;
guoYuButton.BringToFront(); guoYuButton.BringToFront();
taiYuButton.Visible = isVisible; taiYuButton.Visible = isVisible;
taiYuButton.BringToFront(); taiYuButton.BringToFront();
yueYuButton.Visible = isVisible; yueYuButton.Visible = isVisible;
yueYuButton.BringToFront(); yueYuButton.BringToFront();
yingWenButton.Visible = isVisible; yingWenButton.Visible = isVisible;
yingWenButton.BringToFront(); yingWenButton.BringToFront();
riYuButton.Visible = isVisible; riYuButton.Visible = isVisible;
riYuButton.BringToFront(); riYuButton.BringToFront();
hanYuButton.Visible = isVisible; hanYuButton.Visible = isVisible;
hanYuButton.BringToFront(); hanYuButton.BringToFront();
@ -156,15 +149,5 @@ namespace DualScreenDemo
keYuButton.BringToFront(); keYuButton.BringToFront();
} }
private void InitializeButtonsForPictureBoxLanguageQuery()
{
InitializeGuoYuButton();
InitializeTaiYuButton();
InitializeYueYuButton();
InitializeYingWenButton();
InitializeRiYuButton();
InitializeHanYuButton();
InitializeKeYuButton();
}
} }
} }

View File

@ -27,29 +27,50 @@ namespace DualScreenDemo
private Bitmap hanYuNewSongNormalBackground; private Bitmap hanYuNewSongNormalBackground;
private Bitmap hanYuNewSongActiveBackground; private Bitmap hanYuNewSongActiveBackground;
private void ToggleNewSongButtonsVisibility() private void UpdateNewSongBtns(Button activeButton, Image activeBackground)
{ {
guoYuButtonNewSong.BackgroundImage = guoYuNewSongNormalBackground;
bool areButtonsVisible = guoYuButtonNewSong.Visible; taiYuButtonNewSong.BackgroundImage = taiYuNewSongNormalBackground;
yueYuButtonNewSong.BackgroundImage = yueYuNewSongNormalBackground;
yingWenButtonNewSong.BackgroundImage = yingWenNewSongNormalBackground;
riYuButtonNewSong.BackgroundImage = riYuNewSongNormalBackground;
hanYuButtonNewSong.BackgroundImage = hanYuNewSongNormalBackground;
activeButton.BackgroundImage = activeBackground;
}
private void InitializeButtonsForNewSong()
{
var data = LoadBtnConfigData();
InitializeButton(ref guoYuButtonNewSong, ref guoYuNewSongNormalBackground, ref guoYuNewSongActiveBackground, "guoYuButtonNewSong", 1197, 225, 225, 50, data["NewSongAlertBtn"]["GuoYuNewNormal"], data["NewSongAlertBtn"]["GuoYuNewActive"], GuoYuButtonNewSong_Click);
InitializeButton(ref taiYuButtonNewSong, ref taiYuNewSongNormalBackground, ref taiYuNewSongActiveBackground, "taiYuButtonNewSong", 1197, 280, 225, 50, data["NewSongAlertBtn"]["TaiYuNewNormal"], data["NewSongAlertBtn"]["TaiYuNewActive"], TaiYuButtonNewSong_Click);
InitializeButton(ref yueYuButtonNewSong, ref yueYuNewSongNormalBackground, ref yueYuNewSongActiveBackground, "yueYuButtonNewSong", 1197, 335, 225, 50, data["NewSongAlertBtn"]["YueYuNewNormal"], data["NewSongAlertBtn"]["YueYuNewActive"], YueYuButtonNewSong_Click);
InitializeButton(ref yingWenButtonNewSong, ref yingWenNewSongNormalBackground, ref yingWenNewSongActiveBackground, "yingWenButtonNewSong", 1197, 390, 225, 50, data["NewSongAlertBtn"]["EngNewNormal"], data["NewSongAlertBtn"]["EngNewActive"], YingWenButtonNewSong_Click);
InitializeButton(ref riYuButtonNewSong, ref riYuNewSongNormalBackground, ref riYuNewSongActiveBackground, "riYuButtonNewSong", 1197, 445, 225, 50, data["NewSongAlertBtn"]["JapNewNormal"], data["NewSongAlertBtn"]["JapNewActive"], RiYuButtonNewSong_Click);
InitializeButton(ref hanYuButtonNewSong, ref hanYuNewSongNormalBackground, ref hanYuNewSongActiveBackground, "hanYuButtonNewSong", 1197, 500, 225, 50, data["NewSongAlertBtn"]["KrNewNormal"], data["NewSongAlertBtn"]["KrNewActive"], HanYuButtonNewSong_Click);
SetNewSongButtonsVisibility(!areButtonsVisible);
} }
private void SetNewSongButtonsVisibility(bool isVisible) private void SetNewSongButtonsVisibility(bool isVisible)
{ {
Button[] pictureBox2Buttons = { guoYuButtonNewSong, taiYuButtonNewSong, yueYuButtonNewSong, yingWenButtonNewSong, riYuButtonNewSong, hanYuButtonNewSong }; Button[] pictureBox2Buttons = { guoYuButtonNewSong, taiYuButtonNewSong, yueYuButtonNewSong, yingWenButtonNewSong, riYuButtonNewSong, hanYuButtonNewSong };
foreach (var button in pictureBox2Buttons) foreach (var button in pictureBox2Buttons)
{ {
button.Visible = isVisible; button.Visible = isVisible;
if (isVisible) if (isVisible)
{ {
button.BringToFront(); button.BringToFront();
@ -59,27 +80,10 @@ namespace DualScreenDemo
private void NewSongAlertButton_Click(object sender, EventArgs e) private void NewSongAlertButton_Click(object sender, EventArgs e)
{ {
UpdateButtonBackgrounds(newSongAlertButton, newSongAlertActiveBackground);
//newSongAlertButton.BackgroundImage = newSongAlertActiveBackground;
newSongAlertButton.BackgroundImage= new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_新歌快報(已按).png"));
hotPlayButton.BackgroundImage = hotPlayNormalBackground;
singerSearchButton.BackgroundImage = singerSearchNormalBackground;
songSearchButton.BackgroundImage = songSearchNormalBackground;
languageSearchButton.BackgroundImage = languageSearchNormalBackground;
groupSearchButton.BackgroundImage = groupSearchNormalBackground;
categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = promotionsNormalBackground;
deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground;
isOnOrderedSongsPage = false; isOnOrderedSongsPage = false;
guoYuButtonNewSong.BackgroundImage = guoYuNewSongActiveBackground;
taiYuButtonNewSong.BackgroundImage = taiYuNewSongNormalBackground;
yueYuButtonNewSong.BackgroundImage = yueYuNewSongNormalBackground;
yingWenButtonNewSong.BackgroundImage = yingWenNewSongNormalBackground;
riYuButtonNewSong.BackgroundImage = riYuNewSongNormalBackground;
hanYuButtonNewSong.BackgroundImage = hanYuNewSongNormalBackground;
/* 清空搜尋欄 */ /* 清空搜尋欄 */
ResetinputBox(); ResetinputBox();
@ -105,9 +109,11 @@ namespace DualScreenDemo
SetPinYinSongsAndButtonsVisibility(false); SetPinYinSongsAndButtonsVisibility(false);
SetPictureBoxToggleLightAndButtonsVisibility(false); SetPictureBoxToggleLightAndButtonsVisibility(false);
SetPictureBoxSceneSoundEffectsAndButtonsVisibility(false); SetPictureBoxSceneSoundEffectsAndButtonsVisibility(false);
ToggleNewSongButtonsVisibility(); SetNewSongButtonsVisibility(true);
UpdateNewSongBtns(guoYuButtonNewSong, guoYuNewSongActiveBackground);
if (pictureBoxQRCode != null) if (pictureBoxQRCode != null)
{ {
pictureBoxQRCode.Visible = false; pictureBoxQRCode.Visible = false;
@ -115,105 +121,6 @@ namespace DualScreenDemo
} }
} }
private void InitializeButtonsForNewSong()
{
guoYuButtonNewSong = new Button{ Text = "", Visible = false };
ResizeAndPositionButton(guoYuButtonNewSong, 1197, 225, 225, 50);
Rectangle guoYuNewSongButtonCropArea = new Rectangle(1197, 225, 225, 50);
guoYuNewSongNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_國語(未按).png"));
guoYuNewSongActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_國語(已按).png"));
guoYuButtonNewSong.BackgroundImage = guoYuNewSongNormalBackground;
guoYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
guoYuButtonNewSong.FlatStyle = FlatStyle.Flat;
guoYuButtonNewSong.FlatAppearance.BorderSize = 0;
guoYuButtonNewSong.Click += GuoYuButtonNewSong_Click;
this.Controls.Add(guoYuButtonNewSong);
taiYuButtonNewSong = new Button { Text = "", Visible = false };
ResizeAndPositionButton(taiYuButtonNewSong, 1197, 280, 225, 50);
Rectangle taiYuNewSongButtonCropArea = new Rectangle(1197, 280, 225, 50);
taiYuNewSongNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_台語(未按).png"));
taiYuNewSongActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_台語(已按).png"));
taiYuButtonNewSong.BackgroundImage = taiYuNewSongNormalBackground;
taiYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
taiYuButtonNewSong.FlatStyle = FlatStyle.Flat;
taiYuButtonNewSong.FlatAppearance.BorderSize = 0;
taiYuButtonNewSong.Click += TaiYuButtonNewSong_Click;
this.Controls.Add(taiYuButtonNewSong);
yueYuButtonNewSong = new Button { Text = "", Visible = false };
ResizeAndPositionButton(yueYuButtonNewSong, 1197, 335, 225, 50);
Rectangle yueYuNewSongButtonCropArea = new Rectangle(1197, 335, 225, 50);
yueYuNewSongNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_粵語(未按).png"));
yueYuNewSongActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_粵語(已按).png"));
yueYuButtonNewSong.BackgroundImage = yueYuNewSongNormalBackground;
yueYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
yueYuButtonNewSong.FlatStyle = FlatStyle.Flat;
yueYuButtonNewSong.FlatAppearance.BorderSize = 0;
yueYuButtonNewSong.Click += YueYuButtonNewSong_Click;
this.Controls.Add(yueYuButtonNewSong);
yingWenButtonNewSong = new Button {Visible = false };
ResizeAndPositionButton(yingWenButtonNewSong, 1197, 390, 225, 50);
Rectangle yingWenNewSongButtonCropArea = new Rectangle(1197, 390, 225, 50);
yingWenNewSongNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_英語(未按).png"));
yingWenNewSongActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_英語(已按).png"));
yingWenButtonNewSong.BackgroundImage = yingWenNewSongNormalBackground;
yingWenButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
yingWenButtonNewSong.FlatStyle = FlatStyle.Flat;
yingWenButtonNewSong.FlatAppearance.BorderSize = 0;
yingWenButtonNewSong.Click += YingWenButtonNewSong_Click;
this.Controls.Add(yingWenButtonNewSong);
riYuButtonNewSong = new Button { Visible = false };
ResizeAndPositionButton(riYuButtonNewSong, 1197, 445, 225, 50);
Rectangle riYuNewSongButtonCropArea = new Rectangle(1197, 445, 225, 50);
riYuNewSongNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_日語(未按).png"));
riYuNewSongActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_日語(已按).png"));
riYuButtonNewSong.BackgroundImage = riYuNewSongNormalBackground;
riYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
riYuButtonNewSong.FlatStyle = FlatStyle.Flat;
riYuButtonNewSong.FlatAppearance.BorderSize = 0;
riYuButtonNewSong.Click += RiYuButtonNewSong_Click;
this.Controls.Add(riYuButtonNewSong);
hanYuButtonNewSong = new Button {Visible = false };
ResizeAndPositionButton(hanYuButtonNewSong, 1197, 500, 225, 50);
Rectangle hanYuNewSongButtonCropArea = new Rectangle(1197, 500, 490, 50);
hanYuNewSongNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_韓語(未按).png"));
hanYuNewSongActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\1.新歌快報_韓語(已按).png"));
hanYuButtonNewSong.BackgroundImage = hanYuNewSongNormalBackground;
hanYuButtonNewSong.BackgroundImageLayout = ImageLayout.Stretch;
hanYuButtonNewSong.FlatStyle = FlatStyle.Flat;
hanYuButtonNewSong.FlatAppearance.BorderSize = 0;
hanYuButtonNewSong.Click += HanYuButtonNewSong_Click;
this.Controls.Add(hanYuButtonNewSong);
}
private string setQueryforNewSong(string category){ private string setQueryforNewSong(string category){
string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY add_date DESC LIMIT 1000;"; string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY add_date DESC LIMIT 1000;";

View File

@ -4,13 +4,8 @@ namespace DualScreenDemo
{ {
private void YueYuButtonNewSong_Click(object sender, EventArgs e) private void YueYuButtonNewSong_Click(object sender, EventArgs e)
{ {
guoYuButtonNewSong.BackgroundImage = guoYuNewSongNormalBackground;
taiYuButtonNewSong.BackgroundImage = taiYuNewSongNormalBackground;
yueYuButtonNewSong.BackgroundImage = yueYuNewSongActiveBackground;
yingWenButtonNewSong.BackgroundImage = yingWenNewSongNormalBackground;
riYuButtonNewSong.BackgroundImage = riYuNewSongNormalBackground;
hanYuButtonNewSong.BackgroundImage = hanYuNewSongNormalBackground;
UpdateNewSongBtns(yueYuButtonNewSong, yueYuNewSongActiveBackground);
var yueYuSongs2 = SearchSongs_Mysql(setQueryforNewSong("粵語")); var yueYuSongs2 = SearchSongs_Mysql(setQueryforNewSong("粵語"));
currentPage = 0; currentPage = 0;
totalPages = (int)Math.Ceiling((double)yueYuSongs2.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)yueYuSongs2.Count / itemsPerPage);

View File

@ -4,13 +4,8 @@ namespace DualScreenDemo
{ {
private void GuoYuButtonNewSong_Click(object sender, EventArgs e) private void GuoYuButtonNewSong_Click(object sender, EventArgs e)
{ {
guoYuButtonNewSong.BackgroundImage = guoYuNewSongActiveBackground;
taiYuButtonNewSong.BackgroundImage = taiYuNewSongNormalBackground;
yueYuButtonNewSong.BackgroundImage = yueYuNewSongNormalBackground;
yingWenButtonNewSong.BackgroundImage = yingWenNewSongNormalBackground;
riYuButtonNewSong.BackgroundImage = riYuNewSongNormalBackground;
hanYuButtonNewSong.BackgroundImage = hanYuNewSongNormalBackground;
UpdateNewSongBtns(guoYuButtonNewSong, guoYuNewSongActiveBackground);
var guoYuSongs2 = SearchSongs_Mysql(setQueryforNewSong("國語")); var guoYuSongs2 = SearchSongs_Mysql(setQueryforNewSong("國語"));
currentPage = 0; currentPage = 0;
totalPages = (int)Math.Ceiling((double)guoYuSongs2.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)guoYuSongs2.Count / itemsPerPage);

View File

@ -4,13 +4,8 @@ namespace DualScreenDemo
{ {
private void YingWenButtonNewSong_Click(object sender, EventArgs e) private void YingWenButtonNewSong_Click(object sender, EventArgs e)
{ {
guoYuButtonNewSong.BackgroundImage = guoYuNewSongNormalBackground;
taiYuButtonNewSong.BackgroundImage = taiYuNewSongNormalBackground;
yueYuButtonNewSong.BackgroundImage = yueYuNewSongNormalBackground;
yingWenButtonNewSong.BackgroundImage = yingWenNewSongActiveBackground;
riYuButtonNewSong.BackgroundImage = riYuNewSongNormalBackground;
hanYuButtonNewSong.BackgroundImage = hanYuNewSongNormalBackground;
UpdateNewSongBtns(yingWenButtonNewSong, yingWenNewSongActiveBackground);
var yingWenSongs2 = SearchSongs_Mysql(setQueryforNewSong("英語")); var yingWenSongs2 = SearchSongs_Mysql(setQueryforNewSong("英語"));
currentPage = 0; currentPage = 0;

View File

@ -4,13 +4,8 @@ namespace DualScreenDemo
{ {
private void RiYuButtonNewSong_Click(object sender, EventArgs e) private void RiYuButtonNewSong_Click(object sender, EventArgs e)
{ {
guoYuButtonNewSong.BackgroundImage = guoYuNewSongNormalBackground;
taiYuButtonNewSong.BackgroundImage = taiYuNewSongNormalBackground;
yueYuButtonNewSong.BackgroundImage = yueYuNewSongNormalBackground;
yingWenButtonNewSong.BackgroundImage = yingWenNewSongNormalBackground;
riYuButtonNewSong.BackgroundImage = riYuNewSongActiveBackground;
hanYuButtonNewSong.BackgroundImage = hanYuNewSongNormalBackground;
UpdateNewSongBtns(riYuButtonNewSong, riYuNewSongActiveBackground);
var riYuSongs2 = SearchSongs_Mysql(setQueryforNewSong("日語")); var riYuSongs2 = SearchSongs_Mysql(setQueryforNewSong("日語"));
currentPage = 0; currentPage = 0;
totalPages = (int)Math.Ceiling((double)riYuSongs2.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)riYuSongs2.Count / itemsPerPage);

View File

@ -4,13 +4,8 @@ namespace DualScreenDemo
{ {
private void HanYuButtonNewSong_Click(object sender, EventArgs e) private void HanYuButtonNewSong_Click(object sender, EventArgs e)
{ {
guoYuButtonNewSong.BackgroundImage = guoYuNewSongNormalBackground;
taiYuButtonNewSong.BackgroundImage = taiYuNewSongNormalBackground;
yueYuButtonNewSong.BackgroundImage = yueYuNewSongNormalBackground;
yingWenButtonNewSong.BackgroundImage = yingWenNewSongNormalBackground;
riYuButtonNewSong.BackgroundImage = riYuNewSongNormalBackground;
hanYuButtonNewSong.BackgroundImage = hanYuNewSongActiveBackground;
UpdateNewSongBtns(hanYuButtonNewSong, hanYuNewSongActiveBackground);
var hanYuSongs2 = SearchSongs_Mysql(setQueryforNewSong("韓語")); var hanYuSongs2 = SearchSongs_Mysql(setQueryforNewSong("韓語"));
currentPage = 0; currentPage = 0;
totalPages = (int)Math.Ceiling((double)hanYuSongs2.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)hanYuSongs2.Count / itemsPerPage);

View File

@ -4,13 +4,8 @@ namespace DualScreenDemo
{ {
private void TaiYuButtonNewSong_Click(object sender, EventArgs e) private void TaiYuButtonNewSong_Click(object sender, EventArgs e)
{ {
guoYuButtonNewSong.BackgroundImage = guoYuNewSongNormalBackground;
taiYuButtonNewSong.BackgroundImage = taiYuNewSongActiveBackground;
yueYuButtonNewSong.BackgroundImage = yueYuNewSongNormalBackground;
yingWenButtonNewSong.BackgroundImage = yingWenNewSongNormalBackground;
riYuButtonNewSong.BackgroundImage = riYuNewSongNormalBackground;
hanYuButtonNewSong.BackgroundImage = hanYuNewSongNormalBackground;
UpdateNewSongBtns(taiYuButtonNewSong, taiYuNewSongActiveBackground);
var taiYuSongs2 = SearchSongs_Mysql(setQueryforNewSong("台語")); var taiYuSongs2 = SearchSongs_Mysql(setQueryforNewSong("台語"));
currentPage = 0; currentPage = 0;
totalPages = (int)Math.Ceiling((double)taiYuSongs2.Count / itemsPerPage); totalPages = (int)Math.Ceiling((double)taiYuSongs2.Count / itemsPerPage);

View File

@ -449,16 +449,18 @@ namespace DualScreenDemo
int artistWidth = (int)(this.Width * ArtistWidth); int artistWidth = (int)(this.Width * ArtistWidth);
int artistX = songX + songWidth + 10; int artistX = songX + songWidth + 10;
var data = LoadConfigData(); var data = PrimaryForm.Instance.LoadBtnConfigData();
// 添加人聲標籤 // 添加人聲標籤
if (song.getHumanVoice() == 1) if (song.getHumanVoice() == 1)
{ {
PictureBox icon = new PictureBox() PictureBox icon = new PictureBox()
{ {
Image = Image.FromFile(Path.Combine(serverPath, @"themes\superstar\button\3.介面\其他符號_人聲.png")), Image = Image.FromFile(Path.Combine(serverPath,data["PrimaryFormBtn"]["Voice"])),
SizeMode = PictureBoxSizeMode.Zoom, SizeMode = PictureBoxSizeMode.Zoom,
Size = new Size(30, 30), Size = new Size(26, 26),
Location = new Point(songX + 5, y + 8) Location = new Point(songX + 5, y + 8)
}; };
this.Controls.Add(icon); this.Controls.Add(icon);

View File

@ -11,7 +11,7 @@ namespace DualScreenDemo
private Button favoriteButton; private Button favoriteButton;
private Panel disabledPanel; private Panel disabledPanel;
private Button vodScreenCloseButton; private Button vodScreenCloseButton;
private void InitializeButtonsForVodScreenPictureBox() private void InitializeButtonsForVodScreenPictureBox()
{ {
int screenWidth = 1920; int screenWidth = 1920;
@ -22,35 +22,19 @@ namespace DualScreenDemo
int xPosition = (screenWidth - pictureBoxWidth) / 2; int xPosition = (screenWidth - pictureBoxWidth) / 2;
int yPosition = (screenHeight - pictureBoxHeight) / 2; int yPosition = (screenHeight - pictureBoxHeight) / 2;
var data=LoadConfigData(); var data = LoadBtnConfigData();
if (isOnOrderedSongsPage)
{
vodButton = new Button();
vodButton.Text = "";
ConfigureButton(vodButton, xPosition - 119, yPosition + 35, 110, 50,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播-08.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播-08.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播-08.png")),
VodButton_Click);
vodButton.Visible = false;
}
else
{
vodButton = new Button();
vodButton.Text = "";
ConfigureButton(vodButton, xPosition - 119, yPosition + 35, 110, 50,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播_點播.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播_點播.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播_點播.png")),
VodButton_Click);
vodButton.Visible = false;
}
vodButton = new Button();
vodButton.Text = "";
ConfigureButton(vodButton, xPosition - 119, yPosition + 35, 110, 50,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播_點播.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播_點播.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播_點播.png")),
VodButton_Click);
vodButton.Visible = false;
insertButton = new Button(); insertButton = new Button();
insertButton.Text = ""; insertButton.Text = "";
ConfigureButton(insertButton, xPosition + 12, yPosition + 35, 110, 50, ConfigureButton(insertButton, xPosition + 12, yPosition + 35, 110, 50,
@ -61,7 +45,7 @@ namespace DualScreenDemo
insertButton.Visible = false; insertButton.Visible = false;
albumButton = new Button(); albumButton = new Button();
albumButton.Text = ""; albumButton.Text = "";
ConfigureButton(albumButton, xPosition + 142, yPosition + 35, 140, 50, ConfigureButton(albumButton, xPosition + 142, yPosition + 35, 140, 50,
@ -72,7 +56,7 @@ namespace DualScreenDemo
albumButton.Visible = false; albumButton.Visible = false;
favoriteButton = new Button(); favoriteButton = new Button();
favoriteButton.Text = ""; favoriteButton.Text = "";
ConfigureButton(favoriteButton, xPosition + 302, yPosition + 35, 140, 50, ConfigureButton(favoriteButton, xPosition + 302, yPosition + 35, 140, 50,
@ -81,24 +65,25 @@ namespace DualScreenDemo
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播_我的最愛.png")), new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播_我的最愛.png")),
FavoriteButton_Click); FavoriteButton_Click);
disabledPanel = new Panel();
disabledPanel.BackColor = Color.FromArgb(128, Color.Black);
disabledPanel.Dock = DockStyle.Fill;
disabledPanel.Visible = !isLoggedIn;
disabledPanel = new Panel();
disabledPanel.BackColor = Color.FromArgb(128, Color.Black);
disabledPanel.Dock = DockStyle.Fill;
disabledPanel.Visible = !isLoggedIn;
favoriteButton.Controls.Add(disabledPanel); favoriteButton.Controls.Add(disabledPanel);
if (!isLoggedIn) { if (!isLoggedIn)
{
favoriteButton.Enabled = false; favoriteButton.Enabled = false;
favoriteButton.BackColor = SystemColors.Control; favoriteButton.BackColor = SystemColors.Control;
} }
favoriteButton.Visible = isLoggedIn; favoriteButton.Visible = isLoggedIn;
vodScreenCloseButton = new Button(); vodScreenCloseButton = new Button();
vodScreenCloseButton.Text = ""; vodScreenCloseButton.Text = "";
ConfigureButton(vodScreenCloseButton, xPosition + 462, yPosition + 35, 110, 50, ConfigureButton(vodScreenCloseButton, xPosition + 462, yPosition + 35, 110, 50,
@ -107,7 +92,7 @@ namespace DualScreenDemo
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播_關閉.png")), new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\歌曲點播_關閉.png")),
VodScreenCloseButton_Click); VodScreenCloseButton_Click);
this.Controls.Add(vodButton); this.Controls.Add(vodButton);
this.Controls.Add(insertButton); this.Controls.Add(insertButton);
this.Controls.Add(albumButton); this.Controls.Add(albumButton);
@ -116,7 +101,7 @@ namespace DualScreenDemo
} }
private void VodButton_Click(object sender, EventArgs e) private void VodButton_Click(object sender, EventArgs e)
{ {
if (isOnOrderedSongsPage) if (isOnOrderedSongsPage)
{ {
SetVodScreenPictureBoxAndButtonsVisibility(false); SetVodScreenPictureBoxAndButtonsVisibility(false);
SongList.Cancel(currentSelectedSong); SongList.Cancel(currentSelectedSong);
@ -160,7 +145,7 @@ namespace DualScreenDemo
// 更新多頁面面板的內容 // 更新多頁面面板的內容
multiPagePanel.currentPageIndex = 0; multiPagePanel.currentPageIndex = 0;
multiPagePanel.LoadSongs(searchResults); multiPagePanel.LoadSongs(searchResults);
SetVodScreenPictureBoxAndButtonsVisibility(false); SetVodScreenPictureBoxAndButtonsVisibility(false);
} }
@ -169,7 +154,7 @@ namespace DualScreenDemo
SetVodScreenPictureBoxAndButtonsVisibility(false); SetVodScreenPictureBoxAndButtonsVisibility(false);
} }
private void SetVodScreenPictureBoxAndButtonsVisibility(bool isVisible) private void SetVodScreenPictureBoxAndButtonsVisibility(bool isVisible)
{ {
@ -180,13 +165,17 @@ namespace DualScreenDemo
albumButton.Visible = isVisible; albumButton.Visible = isVisible;
favoriteButton.Visible = isVisible; favoriteButton.Visible = isVisible;
vodScreenCloseButton.Visible = isVisible; vodScreenCloseButton.Visible = isVisible;
if (isVisible){ if (isVisible)
if (isLoggedIn){ {
if (isLoggedIn)
{
favoriteButton.Enabled = true; favoriteButton.Enabled = true;
favoriteButton.Controls.Remove(disabledPanel); favoriteButton.Controls.Remove(disabledPanel);
} else { }
else
{
favoriteButton.Enabled = false; favoriteButton.Enabled = false;
} }
overlayPanel.BringToFront(); overlayPanel.BringToFront();
VodScreenPictureBox.BringToFront(); VodScreenPictureBox.BringToFront();

View File

@ -77,50 +77,50 @@ namespace DualScreenDemo
private Button btnSimplifiedChinese; private Button btnSimplifiedChinese;
private Button btnTraditionalChinese; private Button btnTraditionalChinese;
private Button exitButton; private Button exitButton;
private static Bitmap normalStateImage; //private static Bitmap normalStateImage;
private static Bitmap mouseOverImage; //private static Bitmap mouseOverImage;
private static Bitmap mouseDownImage; //private static Bitmap mouseDownImage;
private static Bitmap resizedNormalStateImage; //private static Bitmap resizedNormalStateImage;
private static Bitmap resizedMouseOverImage; //private static Bitmap resizedMouseOverImage;
private static Bitmap resizedMouseDownImage; //private static Bitmap resizedMouseDownImage;
private static Bitmap normalStateImageNewSongAlert; //private static Bitmap normalStateImageNewSongAlert;
private static Bitmap mouseOverImageNewSongAlert; //private static Bitmap mouseOverImageNewSongAlert;
private static Bitmap mouseDownImageNewSongAlert; //private static Bitmap mouseDownImageNewSongAlert;
private static Bitmap resizedNormalStateImageForNewSongAlert; //private static Bitmap resizedNormalStateImageForNewSongAlert;
private static Bitmap resizedMouseOverImageForNewSongAlert; //private static Bitmap resizedMouseOverImageForNewSongAlert;
private static Bitmap resizedMouseDownImageForNewSongAlert; //private static Bitmap resizedMouseDownImageForNewSongAlert;
private static Bitmap normalStateImageArtistQuery; //private static Bitmap normalStateImageArtistQuery;
private static Bitmap mouseOverImageArtistQuery; //private static Bitmap mouseOverImageArtistQuery;
private static Bitmap mouseDownImageArtistQuery; //private static Bitmap mouseDownImageArtistQuery;
private static Bitmap resizedNormalStateImageForArtistQuery; //private static Bitmap resizedNormalStateImageForArtistQuery;
private static Bitmap resizedMouseOverImageForArtistQuery; //private static Bitmap resizedMouseOverImageForArtistQuery;
private static Bitmap resizedMouseDownImageForArtistQuery; //private static Bitmap resizedMouseDownImageForArtistQuery;
private static Bitmap normalStateImageSongQuery; //private static Bitmap normalStateImageSongQuery;
private static Bitmap mouseOverImageSongQuery; //private static Bitmap mouseOverImageSongQuery;
private static Bitmap mouseDownImageSongQuery; //private static Bitmap mouseDownImageSongQuery;
private static Bitmap resizedNormalStateImageForSongQuery; //private static Bitmap resizedNormalStateImageForSongQuery;
private static Bitmap resizedMouseOverImageForSongQuery; //private static Bitmap resizedMouseOverImageForSongQuery;
private static Bitmap resizedMouseDownImageForSongQuery; //private static Bitmap resizedMouseDownImageForSongQuery;
private static Bitmap normalStateImageLanguageQuery; //private static Bitmap normalStateImageLanguageQuery;
private static Bitmap mouseOverImageLanguageQuery; //private static Bitmap mouseOverImageLanguageQuery;
private static Bitmap mouseDownImageLanguageQuery; //private static Bitmap mouseDownImageLanguageQuery;
private static Bitmap resizedNormalStateImageForLanguageQuery; //private static Bitmap resizedNormalStateImageForLanguageQuery;
private static Bitmap resizedMouseOverImageForLanguageQuery; //private static Bitmap resizedMouseOverImageForLanguageQuery;
private static Bitmap resizedMouseDownImageForLanguageQuery; //private static Bitmap resizedMouseDownImageForLanguageQuery;
private static Bitmap normalStateImageCategoryQuery; //private static Bitmap normalStateImageCategoryQuery;
private static Bitmap mouseOverImageCategoryQuery; //private static Bitmap mouseOverImageCategoryQuery;
private static Bitmap mouseDownImageCategoryQuery; //private static Bitmap mouseDownImageCategoryQuery;
private static Bitmap resizedNormalStateImageForCategoryQuery; //private static Bitmap resizedNormalStateImageForCategoryQuery;
private static Bitmap resizedMouseOverImageForCategoryQuery; //private static Bitmap resizedMouseOverImageForCategoryQuery;
private static Bitmap resizedMouseDownImageForCategoryQuery; //private static Bitmap resizedMouseDownImageForCategoryQuery;
private static Bitmap normalStateImageForPromotionsAndMenu; //private static Bitmap normalStateImageForPromotionsAndMenu;
private static Bitmap resizedNormalStateImageForPromotionsAndMenu; //private static Bitmap resizedNormalStateImageForPromotionsAndMenu;
private static Bitmap normalStateImageForSyncScreen; //private static Bitmap normalStateImageForSyncScreen;
private static Bitmap resizedNormalStateImageForSyncScreen; //private static Bitmap resizedNormalStateImageForSyncScreen;
private static Bitmap normalStateImageForSceneSoundEffects; //private static Bitmap normalStateImageForSceneSoundEffects;
private static Bitmap resizedNormalStateImageForSceneSoundEffects; //private static Bitmap resizedNormalStateImageForSceneSoundEffects;
private static Bitmap normalStateImageForLightControl; //private static Bitmap normalStateImageForLightControl;
private static Bitmap resizedNormalStateImageForLightControl; //private static Bitmap resizedNormalStateImageForLightControl;
public VideoPlayerForm videoPlayerForm; public VideoPlayerForm videoPlayerForm;
public List<Artist> currentArtistList; public List<Artist> currentArtistList;
public MultiPagePanel multiPagePanel; public MultiPagePanel multiPagePanel;
@ -168,10 +168,10 @@ namespace DualScreenDemo
private Panel sendOffPanel; private Panel sendOffPanel;
private static Bitmap normalStateImageHotSong; //private static Bitmap normalStateImageHotSong;
private static Bitmap mouseDownImageHotSong; //private static Bitmap mouseDownImageHotSong;
private static Bitmap resizedNormalStateImageForHotSong; //private static Bitmap resizedNormalStateImageForHotSong;
private static Bitmap resizedMouseDownImageForHotSong; //private static Bitmap resizedMouseDownImageForHotSong;
private PictureBox serviceBellPictureBox; // 添加为类成员变量 private PictureBox serviceBellPictureBox; // 添加为类成员变量
private Timer autoRefreshTimer; private Timer autoRefreshTimer;
@ -208,7 +208,7 @@ namespace DualScreenDemo
InitializeRecording(); InitializeRecording();
InitializeMediaPlayer(); InitializeMediaPlayer();
LoadImages(); //LoadImages();
InitializeFormAndControls(); InitializeFormAndControls();
InitializeMultiPagePanel(); InitializeMultiPagePanel();
OverlayQRCodeOnImage(HttpServer.randomFolderPath); OverlayQRCodeOnImage(HttpServer.randomFolderPath);
@ -497,9 +497,9 @@ namespace DualScreenDemo
string selectedTheme = ReadSelectedThemePath(); string selectedTheme = ReadSelectedThemePath();
if (!string.IsNullOrEmpty(selectedTheme)) if (!string.IsNullOrEmpty(selectedTheme))
{ {
var data = LoadConfigData(); var data = LoadBtnConfigData();
string backgroundImagePath = Path.Combine(serverPath, "themes\\superstar\\主畫面\\0.下方選單_主畫面.jpg"); string backgroundImagePath = Path.Combine(serverPath, data["PrimaryFormBtn"]["MainFrameWSubBtn"]);
try try
{ {
using (Image originalImage = Image.FromFile(backgroundImagePath)) using (Image originalImage = Image.FromFile(backgroundImagePath))
@ -520,7 +520,7 @@ namespace DualScreenDemo
InitializeButtonsForNewSong(); InitializeButtonsForNewSong();
InitializeButtonsForSingerSearch(); InitializeButtonsForSingerSearch();
InitializeButtonsForSongSearch(); InitializeButtonsForSongSearch();
InitializeButtonsForPictureBoxLanguageQuery(); InitializeLangSearchButtons();
InitializeButtonsForGroupPictureBox(); InitializeButtonsForGroupPictureBox();
InitializeCategorySearchButtons(); InitializeCategorySearchButtons();
InitializeButtonsForZhuYinSingers(); InitializeButtonsForZhuYinSingers();
@ -535,7 +535,7 @@ namespace DualScreenDemo
InitializeButtonsForFavoritePictureBox(); InitializeButtonsForFavoritePictureBox();
InitializePromotionsButton(); InitializePromotionsButton();
InitializeButtonsForPictureBoxToggleLight(); InitializeButtonsForPictureBoxToggleLight();
//InitializeButtonsForVodScreenPictureBox(); InitializeButtonsForVodScreenPictureBox();
InitializeSoundEffectButtons(); InitializeSoundEffectButtons();
InitializeSyncScreen(); InitializeSyncScreen();
@ -1050,9 +1050,9 @@ namespace DualScreenDemo
serviceBellButton = new Button { Text = "" }; serviceBellButton = new Button { Text = "" };
ConfigureButton(serviceBellButton, 843, 98, 107, 120, ConfigureButton(serviceBellButton, 843, 98, 107, 120,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_服務鈴(未按).png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormBtn"]["BellNormal"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_服務鈴(已按).png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormBtn"]["BellActive"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_服務鈴(已按).png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormBtn"]["BellActive"])),
(sender, e) => OnServiceBellButtonClick(sender, e)); (sender, e) => OnServiceBellButtonClick(sender, e));
@ -1068,72 +1068,72 @@ namespace DualScreenDemo
mobileSongRequestButton = new Button { Text = "" }; mobileSongRequestButton = new Button { Text = "" };
mobileSongRequestButton.Name = "mobileSongRequestButton"; mobileSongRequestButton.Name = "mobileSongRequestButton";
ConfigureButton(mobileSongRequestButton, 1198, 629, 223, 88, ConfigureButton(mobileSongRequestButton, 1198, 629, 223, 88,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_手機點歌.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MobileOrder"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_手機點歌.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MobileOrder"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_手機點歌.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MobileOrder"])),
MobileSongRequestButton_Click); MobileSongRequestButton_Click);
qieGeButton = new Button { Text = "" }; qieGeButton = new Button { Text = "" };
qieGeButton.Name = "qieGeButton"; qieGeButton.Name = "qieGeButton";
ConfigureButton(qieGeButton, 20, 738, 92, 147, ConfigureButton(qieGeButton, 20, 738, 92, 147,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_切歌.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["QieGe"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_切歌.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["QieGe"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_切歌.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["QieGe"])),
(sender, e) => videoPlayerForm.PlayNextSong()); (sender, e) => videoPlayerForm.PlayNextSong());
musicUpButton = new Button { Text = "" }; musicUpButton = new Button { Text = "" };
musicUpButton.Name = "musicUpButton"; musicUpButton.Name = "musicUpButton";
ConfigureButton(musicUpButton, 128, 738, 93, 62, ConfigureButton(musicUpButton, 128, 738, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音樂+.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MusicGainNormal"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音樂+.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MusicGainNormal"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\音樂及麥克風icon_音樂++.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MusicGainActive"])),
(sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↑", "a2 b3 a4"); }); (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↑", "a2 b3 a4"); });
musicDownButton = new Button { Text = "" }; musicDownButton = new Button { Text = "" };
musicDownButton.Name = "musicDownButton"; musicDownButton.Name = "musicDownButton";
ConfigureButton(musicDownButton, 128, 823, 93, 62, ConfigureButton(musicDownButton, 128, 823, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音樂-.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MusicLowNormal"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音樂-.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MusicLowNormal"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\音樂及麥克風icon_音樂--.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MusicLowActive"])),
(sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↓", "a2 b4 a4"); }); (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↓", "a2 b4 a4"); });
micUpButton = new Button { Text = "" }; micUpButton = new Button { Text = "" };
micUpButton.Name = "micUpButton"; micUpButton.Name = "micUpButton";
ConfigureButton(micUpButton, 238, 738, 93, 62, ConfigureButton(micUpButton, 238, 738, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_麥克風+.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MiPhoneGainNormal"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_麥克風+.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MiPhoneGainNormal"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\音樂及麥克風icon_麥克風++.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MiPhoneGainActive"])),
(sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↑", "a2 b5 a4"); }); (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↑", "a2 b5 a4"); });
micDownButton = new Button { Text = "" }; micDownButton = new Button { Text = "" };
micDownButton.Name = "micDownButton"; micDownButton.Name = "micDownButton";
ConfigureButton(micDownButton, 238, 823, 93, 62, ConfigureButton(micDownButton, 238, 823, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_麥克風-.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MiPhoneLowNormal"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_麥克風-.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MiPhoneLowNormal"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\音樂及麥克風icon_麥克風--.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MiPhoneLowActive"])),
(sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↓", "a2 b6 a4"); }); (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↓", "a2 b6 a4"); });
originalSongButton = new Button { Text = "" }; originalSongButton = new Button { Text = "" };
originalSongButton.Name = "originalSongButton"; originalSongButton.Name = "originalSongButton";
ConfigureButton(originalSongButton, 347, 738, 93, 62, ConfigureButton(originalSongButton, 347, 738, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_原唱.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["OriginalSound"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_原唱.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["OriginalSound"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_原唱.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["OriginalSound"])),
OriginalSongButton_Click); OriginalSongButton_Click);
replayButton = new Button { Text = "" }; replayButton = new Button { Text = "" };
replayButton.Name = "replayButton"; replayButton.Name = "replayButton";
ConfigureButton(replayButton, 347, 823, 93, 62, ConfigureButton(replayButton, 347, 823, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_重唱.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Replay"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_重唱.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Replay"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_重唱.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Replay"])),
ReplayButton_Click); ReplayButton_Click);
@ -1143,9 +1143,9 @@ namespace DualScreenDemo
Name = "pauseButton" Name = "pauseButton"
}; };
ConfigureButton(pauseButton, 456, 738, 93, 62, ConfigureButton(pauseButton, 456, 738, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Pause"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Pause"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Pause"])),
PauseButton_Click); PauseButton_Click);
@ -1156,144 +1156,144 @@ namespace DualScreenDemo
Visible = false Visible = false
}; };
ConfigureButton(playButton, 456, 738, 93, 62, ConfigureButton(playButton, 456, 738, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Play"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Play"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_暫停.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Play"])),
PlayButton_Click); PlayButton_Click);
muteButton = new Button { Text = "" }; muteButton = new Button { Text = "" };
muteButton.Name = "muteButton"; muteButton.Name = "muteButton";
ConfigureButton(muteButton, 456, 823, 93, 62, ConfigureButton(muteButton, 456, 823, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_靜音.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Mute"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_靜音.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Mute"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_靜音.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Mute"])),
MuteUnmuteButton_Click); MuteUnmuteButton_Click);
maleKeyButton = new Button { Text = "" }; maleKeyButton = new Button { Text = "" };
maleKeyButton.Name = "maleKeyButton"; maleKeyButton.Name = "maleKeyButton";
ConfigureButton(maleKeyButton, 564, 738, 93, 62, ConfigureButton(maleKeyButton, 564, 738, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_男調.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MaleTone"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_男調.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MaleTone"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_男調.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MaleTone"])),
MaleKeyButton_Click); MaleKeyButton_Click);
femaleKeyButton = new Button { Text = "" }; femaleKeyButton = new Button { Text = "" };
femaleKeyButton.Name = "femaleKeyButton"; femaleKeyButton.Name = "femaleKeyButton";
ConfigureButton(femaleKeyButton, 565, 823, 93, 62, ConfigureButton(femaleKeyButton, 565, 823, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_女調.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["FemaleTone"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_女調.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["FemaleTone"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_女調.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["FemaleTone"])),
FemaleKeyButton_Click); FemaleKeyButton_Click);
standardKeyButton = new Button { Text = "" }; standardKeyButton = new Button { Text = "" };
standardKeyButton.Name = "standardKeyButton"; standardKeyButton.Name = "standardKeyButton";
ConfigureButton(standardKeyButton, 674, 738, 93, 62, ConfigureButton(standardKeyButton, 674, 738, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_標準調.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["StandardTone"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_標準調.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["StandardTone"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_標準調.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["StandardTone"])),
StandardKeyButton_Click); StandardKeyButton_Click);
soundEffectButton = new Button { Text = "" }; soundEffectButton = new Button { Text = "" };
soundEffectButton.Name = "soundEffectButton"; soundEffectButton.Name = "soundEffectButton";
ConfigureButton(soundEffectButton, 674, 823, 93, 62, ConfigureButton(soundEffectButton, 674, 823, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音效.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["SoundEffect"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音效.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["SoundEffect"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_音效.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["SoundEffect"])),
SoundEffectButton_Click); SoundEffectButton_Click);
pitchUpButton = new Button { Text = "" }; pitchUpButton = new Button { Text = "" };
pitchUpButton.Name = "pitchUpButton"; pitchUpButton.Name = "pitchUpButton";
ConfigureButton(pitchUpButton, 784, 738, 93, 62, ConfigureButton(pitchUpButton, 784, 738, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_升調.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["HigherTone"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_升調.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["HigherTone"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_升調.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["HigherTone"])),
PitchUpButton_Click); PitchUpButton_Click);
pitchDownButton = new Button { Text = "" }; pitchDownButton = new Button { Text = "" };
pitchDownButton.Name = "pitchDownButton"; pitchDownButton.Name = "pitchDownButton";
ConfigureButton(pitchDownButton, 784, 823, 93, 62, ConfigureButton(pitchDownButton, 784, 823, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_降調.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["LowerTone"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_降調.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["LowerTone"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_降調.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["LowerTone"])),
PitchDownButton_Click); PitchDownButton_Click);
syncScreenButton = new Button { Text = "" }; syncScreenButton = new Button { Text = "" };
syncScreenButton.Name = "syncScreenButton"; syncScreenButton.Name = "syncScreenButton";
ConfigureButton(syncScreenButton, 893, 736, 92, 149, ConfigureButton(syncScreenButton, 893, 736, 92, 149,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_同步畫面.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["ScreenSync"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_同步畫面.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["ScreenSync"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_同步畫面.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["ScreenSync"])),
SyncScreenButton_Click); SyncScreenButton_Click);
toggleLightButton = new Button { Text = "" }; toggleLightButton = new Button { Text = "" };
toggleLightButton.Name = "toggleLightButton"; toggleLightButton.Name = "toggleLightButton";
ConfigureButton(toggleLightButton, 1002, 736, 92, 149, ConfigureButton(toggleLightButton, 1002, 736, 92, 149,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_燈光控制.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["LightControl"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_燈光控制.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["LightControl"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_燈光控制.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["LightControl"])),
ToggleLightButton_Click); ToggleLightButton_Click);
btnPreviousPage = new Button { Text = "" }; btnPreviousPage = new Button { Text = "" };
btnPreviousPage.Name = "btnPreviousPageButton"; btnPreviousPage.Name = "btnPreviousPageButton";
ConfigureButton(btnPreviousPage, 1110, 738, 93, 62, ConfigureButton(btnPreviousPage, 1110, 738, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_上一頁.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["PrePage"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_上一頁.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["PrePage"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_上一頁.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["PrePage"])),
PreviousPageButton_Click); PreviousPageButton_Click);
btnReturn = new Button { Text = "" }; btnReturn = new Button { Text = "" };
btnReturn.Name = "btnReturn"; btnReturn.Name = "btnReturn";
ConfigureButton(btnReturn, 1220, 738, 93, 62, ConfigureButton(btnReturn, 1220, 738, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_退出.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Exit"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_退出.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Exit"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_退出.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Exit"])),
ShouYeButton_Click); ShouYeButton_Click);
btnNextPage = new Button { Text = "" }; btnNextPage = new Button { Text = "" };
btnNextPage.Name = "btnNextPage"; btnNextPage.Name = "btnNextPage";
ConfigureButton(btnNextPage, 1330, 738, 93, 62, ConfigureButton(btnNextPage, 1330, 738, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_下一頁.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["NextPage"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_下一頁.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["NextPage"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_下一頁.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["NextPage"])),
NextPageButton_Click); NextPageButton_Click);
btnApplause = new Button { Text = "" }; btnApplause = new Button { Text = "" };
btnApplause.Name = "btnApplause"; btnApplause.Name = "btnApplause";
ConfigureButton(btnApplause, 1110, 823, 93, 62, ConfigureButton(btnApplause, 1110, 823, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_掌聲.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Appaulse"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_掌聲.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Appaulse"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_掌聲.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Appaulse"])),
ApplauseButton_Click); ApplauseButton_Click);
btnSimplifiedChinese = new Button { Text = "" }; btnSimplifiedChinese = new Button { Text = "" };
btnSimplifiedChinese.Name = "btnSimplifiedChinese"; btnSimplifiedChinese.Name = "btnSimplifiedChinese";
ConfigureButton(btnSimplifiedChinese, 1330, 823, 93, 62, ConfigureButton(btnSimplifiedChinese, 1330, 823, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_簡體.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Simplified"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_簡體.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Simplified"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_簡體.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Simplified"])),
SimplifiedChineseButton_Click); SimplifiedChineseButton_Click);
btnTraditionalChinese = new Button { Text = "" }; btnTraditionalChinese = new Button { Text = "" };
btnTraditionalChinese.Name = "btnTraditionalChinese"; btnTraditionalChinese.Name = "btnTraditionalChinese";
ConfigureButton(btnTraditionalChinese, 1220, 823, 93, 62, ConfigureButton(btnTraditionalChinese, 1220, 823, 93, 62,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_繁體.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Traditional"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_繁體.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Traditional"])),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別下方_繁體.png")), new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["Traditional"])),
TraditionalChineseButton_Click); TraditionalChineseButton_Click);
/* 關閉應用程式按鈕*/ /* 關閉應用程式按鈕*/
@ -1356,9 +1356,8 @@ namespace DualScreenDemo
public void Label_Click(object sender, EventArgs e) public void Label_Click(object sender, EventArgs e)
{ {
InitializeButtonsForVodScreenPictureBox();
var data = LoadConfigData(); var data = LoadBtnConfigData();
var label = sender as Label; var label = sender as Label;
if (label != null && label.Tag is SongData) if (label != null && label.Tag is SongData)
{ {
@ -1367,10 +1366,19 @@ namespace DualScreenDemo
this.DoubleBuffered = true; this.DoubleBuffered = true;
this.SuspendLayout(); this.SuspendLayout();
DrawTextOnVodScreenPictureBox(Path.Combine(serverPath, @"themes\superstar\button\3.介面\歌曲點播_空白介面.png"), currentSelectedSong); DrawTextOnVodScreenPictureBox(Path.Combine(serverPath, data["SongOrderPanel"]["UIBase"]), currentSelectedSong);
SetVodScreenPictureBoxAndButtonsVisibility(true); SetVodScreenPictureBoxAndButtonsVisibility(true);
this.ResumeLayout(true); this.ResumeLayout(true);
} }
if (isOnOrderedSongsPage)
{
vodButton.BackgroundImage = new Bitmap(Path.Combine(serverPath, data["SongOrderPanel"]["DelBtn"]));
vodButton.MouseEnter += (sender, e) => vodButton.BackgroundImage = new Bitmap(Path.Combine(serverPath, data["SongOrderPanel"]["DelBtn"])); ;
vodButton.MouseLeave += (sender, e) => vodButton.BackgroundImage = new Bitmap(Path.Combine(serverPath, data["SongOrderPanel"]["DelBtn"])); ;
vodButton.MouseDown += (sender, e) => vodButton.BackgroundImage = new Bitmap(Path.Combine(serverPath, data["SongOrderPanel"]["DelBtn"])); ;
vodButton.MouseUp += (sender, e) => vodButton.BackgroundImage = new Bitmap(Path.Combine(serverPath, data["SongOrderPanel"]["DelBtn"])); ;
}
} }
public static void WriteLog(string message) public static void WriteLog(string message)
@ -1442,123 +1450,125 @@ namespace DualScreenDemo
return destImage; return destImage;
} }
private void LoadImages() #region LoadImages
{ //private void LoadImages()
var data = LoadConfigData(); //{
// var data = LoadBtnConfigData();
string selectedThemePath = ReadSelectedThemePath(); // string selectedThemePath = ReadSelectedThemePath();
string basePath = Path.Combine(serverPath, selectedThemePath); // string basePath = Path.Combine(serverPath, selectedThemePath);
int targetWidth = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width; // int targetWidth = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
int targetHeight = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height; // int targetHeight = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
normalStateImage = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\0.下方選單_主畫面.jpg")); // normalStateImage = new Bitmap(Path.Combine(serverPath, data["PrimaryFormBtn"]["MainFrameWSubBtn"]));
resizedNormalStateImage = ResizeImage(normalStateImage, targetWidth, targetHeight); // resizedNormalStateImage = ResizeImage(normalStateImage, targetWidth, targetHeight);
mouseOverImage = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\0.主選單_已按.jpg")); // mouseOverImage = new Bitmap(Path.Combine(serverPath, data["PrimaryFormBtn"]["MainFrameBtnPressed"]));
resizedMouseOverImage = ResizeImage(mouseOverImage, targetWidth, targetHeight); // resizedMouseOverImage = ResizeImage(mouseOverImage, targetWidth, targetHeight);
mouseDownImage = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\0.主選單_已按.jpg")); // mouseDownImage = new Bitmap(Path.Combine(serverPath, data["PrimaryFormBtn"]["MainFrameBtnPressed"]));
resizedMouseDownImage = ResizeImage(mouseDownImage, targetWidth, targetHeight); // resizedMouseDownImage = ResizeImage(mouseDownImage, targetWidth, targetHeight);
normalStateImageNewSongAlert = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\1.新歌快報_未按.jpg")); // normalStateImageNewSongAlert = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\1.新歌快報_未按.jpg"));
resizedNormalStateImageForNewSongAlert = ResizeImage(normalStateImageNewSongAlert, targetWidth, targetHeight); // resizedNormalStateImageForNewSongAlert = ResizeImage(normalStateImageNewSongAlert, targetWidth, targetHeight);
mouseOverImageNewSongAlert = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\1.新歌快報_已按.jpg")); // mouseOverImageNewSongAlert = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\1.新歌快報_已按.jpg"));
resizedMouseOverImageForNewSongAlert = ResizeImage(mouseOverImageNewSongAlert, targetWidth, targetHeight); // resizedMouseOverImageForNewSongAlert = ResizeImage(mouseOverImageNewSongAlert, targetWidth, targetHeight);
mouseDownImageNewSongAlert = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\1.新歌快報_已按.jpg")); // mouseDownImageNewSongAlert = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\1.新歌快報_已按.jpg"));
resizedMouseDownImageForNewSongAlert = ResizeImage(mouseDownImageNewSongAlert, targetWidth, targetHeight); // resizedMouseDownImageForNewSongAlert = ResizeImage(mouseDownImageNewSongAlert, targetWidth, targetHeight);
normalStateImageArtistQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\3.歌星查詢_未按.jpg")); // normalStateImageArtistQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\3.歌星查詢_未按.jpg"));
resizedNormalStateImageForArtistQuery = ResizeImage(normalStateImageArtistQuery, targetWidth, targetHeight); // resizedNormalStateImageForArtistQuery = ResizeImage(normalStateImageArtistQuery, targetWidth, targetHeight);
mouseOverImageArtistQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\3.歌星查詢_已按.jpg")); // mouseOverImageArtistQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\3.歌星查詢_已按.jpg"));
resizedMouseOverImageForArtistQuery = ResizeImage(mouseOverImageArtistQuery, targetWidth, targetHeight); // resizedMouseOverImageForArtistQuery = ResizeImage(mouseOverImageArtistQuery, targetWidth, targetHeight);
mouseDownImageArtistQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\3.歌星查詢_已按.jpg")); // mouseDownImageArtistQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\3.歌星查詢_已按.jpg"));
resizedMouseDownImageForArtistQuery = ResizeImage(mouseDownImageArtistQuery, targetWidth, targetHeight); // resizedMouseDownImageForArtistQuery = ResizeImage(mouseDownImageArtistQuery, targetWidth, targetHeight);
normalStateImageSongQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\4.歌名查詢_未按.jpg")); // normalStateImageSongQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\4.歌名查詢_未按.jpg"));
resizedNormalStateImageForSongQuery = ResizeImage(normalStateImageSongQuery, targetWidth, targetHeight); // resizedNormalStateImageForSongQuery = ResizeImage(normalStateImageSongQuery, targetWidth, targetHeight);
mouseOverImageSongQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\4.歌名查詢_已按.jpg")); // mouseOverImageSongQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\4.歌名查詢_已按.jpg"));
resizedMouseOverImageForSongQuery = ResizeImage(mouseOverImageSongQuery, targetWidth, targetHeight); // resizedMouseOverImageForSongQuery = ResizeImage(mouseOverImageSongQuery, targetWidth, targetHeight);
mouseDownImageSongQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\4.歌名查詢_已按.jpg")); // mouseDownImageSongQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\4.歌名查詢_已按.jpg"));
resizedMouseDownImageForSongQuery = ResizeImage(mouseDownImageSongQuery, targetWidth, targetHeight); // resizedMouseDownImageForSongQuery = ResizeImage(mouseDownImageSongQuery, targetWidth, targetHeight);
normalStateImageLanguageQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\5.語別查詢_未按.jpg")); // normalStateImageLanguageQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\5.語別查詢_未按.jpg"));
resizedNormalStateImageForLanguageQuery = ResizeImage(normalStateImageLanguageQuery, targetWidth, targetHeight); // resizedNormalStateImageForLanguageQuery = ResizeImage(normalStateImageLanguageQuery, targetWidth, targetHeight);
mouseOverImageLanguageQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\5.語別查詢_已按.jpg")); // mouseOverImageLanguageQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\5.語別查詢_已按.jpg"));
resizedMouseOverImageForLanguageQuery = ResizeImage(mouseOverImageLanguageQuery, targetWidth, targetHeight); // resizedMouseOverImageForLanguageQuery = ResizeImage(mouseOverImageLanguageQuery, targetWidth, targetHeight);
mouseDownImageLanguageQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\5.語別查詢_已按.jpg")); // mouseDownImageLanguageQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\5.語別查詢_已按.jpg"));
resizedMouseDownImageForLanguageQuery = ResizeImage(mouseDownImageLanguageQuery, targetWidth, targetHeight); // resizedMouseDownImageForLanguageQuery = ResizeImage(mouseDownImageLanguageQuery, targetWidth, targetHeight);
normalStateImageCategoryQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\7.類別查詢_未按.jpg")); // normalStateImageCategoryQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\7.類別查詢_未按.jpg"));
resizedNormalStateImageForCategoryQuery = ResizeImage(normalStateImageCategoryQuery, targetWidth, targetHeight); // resizedNormalStateImageForCategoryQuery = ResizeImage(normalStateImageCategoryQuery, targetWidth, targetHeight);
mouseOverImageCategoryQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\7.類別查詢_已按.jpg")); // mouseOverImageCategoryQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\7.類別查詢_已按.jpg"));
resizedMouseOverImageForCategoryQuery = ResizeImage(mouseOverImageCategoryQuery, targetWidth, targetHeight); // resizedMouseOverImageForCategoryQuery = ResizeImage(mouseOverImageCategoryQuery, targetWidth, targetHeight);
mouseDownImageCategoryQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\7.類別查詢_已按.jpg")); // mouseDownImageCategoryQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\7.類別查詢_已按.jpg"));
resizedMouseDownImageForCategoryQuery = ResizeImage(mouseDownImageCategoryQuery, targetWidth, targetHeight); // resizedMouseDownImageForCategoryQuery = ResizeImage(mouseDownImageCategoryQuery, targetWidth, targetHeight);
normalStateImageForPromotionsAndMenu = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\555021.jpg")); // normalStateImageForPromotionsAndMenu = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\555021.jpg"));
resizedNormalStateImageForPromotionsAndMenu = ResizeImage(normalStateImageForPromotionsAndMenu, targetWidth, targetHeight); // resizedNormalStateImageForPromotionsAndMenu = ResizeImage(normalStateImageForPromotionsAndMenu, targetWidth, targetHeight);
try // try
{ // {
string imagePath = Path.Combine(serverPath, "themes\\superstar\\主畫面\\選單內介面_同步畫面.jpg"); // string imagePath = Path.Combine(serverPath, "themes\\superstar\\主畫面\\選單內介面_同步畫面.jpg");
if (File.Exists(imagePath)) // if (File.Exists(imagePath))
{ // {
normalStateImageForSyncScreen = new Bitmap(imagePath); // normalStateImageForSyncScreen = new Bitmap(imagePath);
resizedNormalStateImageForSyncScreen = ResizeImage(normalStateImageForSyncScreen, targetWidth, targetHeight); // resizedNormalStateImageForSyncScreen = ResizeImage(normalStateImageForSyncScreen, targetWidth, targetHeight);
Console.WriteLine("Image loaded successfully."); // Console.WriteLine("Image loaded successfully.");
} // }
else // else
{ // {
Console.WriteLine("Image file does not exist: " + imagePath); // Console.WriteLine("Image file does not exist: " + imagePath);
} // }
} // }
catch (Exception ex) // catch (Exception ex)
{ // {
Console.WriteLine("Failed to load image: " + ex.Message); // Console.WriteLine("Failed to load image: " + ex.Message);
} // }
normalStateImageForSceneSoundEffects = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\555022.jpg")); // normalStateImageForSceneSoundEffects = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\555022.jpg"));
resizedNormalStateImageForSceneSoundEffects = ResizeImage(normalStateImageForSceneSoundEffects, targetWidth, targetHeight); // resizedNormalStateImageForSceneSoundEffects = ResizeImage(normalStateImageForSceneSoundEffects, targetWidth, targetHeight);
normalStateImageHotSong = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\2.熱門排行_未按.jpg")); // normalStateImageHotSong = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\2.熱門排行_未按.jpg"));
resizedNormalStateImageForHotSong = ResizeImage(normalStateImageHotSong, targetWidth, targetHeight); // resizedNormalStateImageForHotSong = ResizeImage(normalStateImageHotSong, targetWidth, targetHeight);
mouseDownImageHotSong = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\2.熱門排行_已按.jpg")); // mouseDownImageHotSong = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\2.熱門排行_已按.jpg"));
resizedMouseDownImageForHotSong = ResizeImage(mouseDownImageHotSong, targetWidth, targetHeight); // resizedMouseDownImageForHotSong = ResizeImage(mouseDownImageHotSong, targetWidth, targetHeight);
normalStateImageForLightControl = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\選單內介面_燈光控制.jpg")); // normalStateImageForLightControl = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\選單內介面_燈光控制.jpg"));
resizedNormalStateImageForLightControl = ResizeImage(normalStateImageForLightControl, targetWidth, targetHeight); // resizedNormalStateImageForLightControl = ResizeImage(normalStateImageForLightControl, targetWidth, targetHeight);
} //}
#endregion
private Bitmap CropImage(Bitmap source, Rectangle section) private Bitmap CropImage(Bitmap source, Rectangle section)
{ {
@ -1689,10 +1699,10 @@ namespace DualScreenDemo
private void DeliciousFoodButton_Click(object sender, EventArgs e) private void DeliciousFoodButton_Click(object sender, EventArgs e)
{ {
var data = LoadConfigData(); var data = LoadBtnConfigData();
UpdateButtonBackgrounds(deliciousFoodButton, new Bitmap(Path.Combine(serverPath, data["PrimaryFormBtn"]["FoodActive"])));
ResetPrimaryBtnStatus();
deliciousFoodButton.BackgroundImage = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_美味菜單(已按).png"));
isOnOrderedSongsPage = false; isOnOrderedSongsPage = false;
SetHotSongButtonsVisibility(false); SetHotSongButtonsVisibility(false);
@ -1885,12 +1895,6 @@ namespace DualScreenDemo
private void MuteUnmuteButton_Click(object sender, EventArgs e) private void MuteUnmuteButton_Click(object sender, EventArgs e)
{ {
//SetHotSongButtonsVisibility(false);
//SetNewSongButtonsVisibility(false);
//SetSingerSearchButtonsVisibility(false);
//SetSongSearchButtonsVisibility(false);
//SetPictureBoxToggleLightAndButtonsVisibility(false);
if (videoPlayerForm.isMuted) if (videoPlayerForm.isMuted)
{ {
@ -2194,11 +2198,11 @@ namespace DualScreenDemo
/// <returns></returns> /// <returns></returns>
private Image LoadSendOffImage() private Image LoadSendOffImage()
{ {
var data = LoadConfigData(); var data = LoadBtnConfigData();
try try
{ {
string filePath = Path.Combine(serverPath, "themes\\superstar\\主畫面\\選單內介面_送客畫面.jpg"); string filePath = Path.Combine(serverPath, data["PrimaryFormBtn"]["Close"]);
if (File.Exists(filePath)) if (File.Exists(filePath))
{ {
return Image.FromFile(filePath); return Image.FromFile(filePath);
@ -2241,11 +2245,9 @@ namespace DualScreenDemo
private void OrderedSongsButton_Click(object sender, EventArgs e) private void OrderedSongsButton_Click(object sender, EventArgs e)
{ {
var data = LoadConfigData(); var data = LoadBtnConfigData();
ResetPrimaryBtnStatus();
orderedSongsButton.BackgroundImage = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_已點歌曲(已按).png"));
UpdateButtonBackgrounds(orderedSongsButton,orderedSongsActiveBackground);
isOnOrderedSongsPage = true; isOnOrderedSongsPage = true;
autoRefreshTimer.Start(); // 开始自动刷新 autoRefreshTimer.Start(); // 开始自动刷新
@ -2340,10 +2342,9 @@ namespace DualScreenDemo
} }
} }
//主畫面按鍵圖形重 //主畫面上排按鍵圖形狀態設
private void ResetPrimaryBtnStatus() private void UpdateButtonBackgrounds(Button activeButton, Image activeBackground)
{ {
newSongAlertButton.BackgroundImage = newSongAlertNormalBackground; newSongAlertButton.BackgroundImage = newSongAlertNormalBackground;
hotPlayButton.BackgroundImage = hotPlayNormalBackground; hotPlayButton.BackgroundImage = hotPlayNormalBackground;
singerSearchButton.BackgroundImage = singerSearchNormalBackground; singerSearchButton.BackgroundImage = singerSearchNormalBackground;
@ -2355,6 +2356,8 @@ namespace DualScreenDemo
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground; myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = promotionsNormalBackground; promotionsButton.BackgroundImage = promotionsNormalBackground;
deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground; deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground;
activeButton.BackgroundImage = activeBackground;
} }
} }

View File

@ -40,12 +40,8 @@ namespace DualScreenDemo
private void ZhuyinSearchSingersButton_Click(object sender, EventArgs e) private void ZhuyinSearchSingersButton_Click(object sender, EventArgs e)
{ {
// 設定按鈕背景,將「注音搜尋」設為啟動狀態,其餘按鈕恢復為正常狀態 // 設定按鈕背景,將「注音搜尋」設為啟動狀態,其餘按鈕恢復為正常狀態
zhuyinSearchButton.BackgroundImage = zhuyinSearchActiveBackground;
englishSearchButton.BackgroundImage = englishSearchNormalBackground;
pinyinSearchButton.BackgroundImage = pinyinSearchNormalBackground;
wordCountSearchButton.BackgroundImage = wordCountSearchNormalBackground;
handWritingSearchButton.BackgroundImage = handWritingSearchNormalBackground;
UpdateButtonBackgrounds(zhuyinSearchButton, zhuyinSearchActiveBackground);
// 載入設定檔,取得圖片路徑資訊 // 載入設定檔,取得圖片路徑資訊
var configData = LoadConfigData(); var configData = LoadConfigData();

View File

@ -1,4 +1,3 @@
using System.IO;
namespace DualScreenDemo namespace DualScreenDemo
{ {
@ -24,11 +23,21 @@ namespace DualScreenDemo
private Bitmap handWritingSearchNormalBackground; private Bitmap handWritingSearchNormalBackground;
private Bitmap handWritingSearchActiveBackground; private Bitmap handWritingSearchActiveBackground;
private void UpdateSSearchBtn(Button activeButton, Image activeBackground)
{
zhuyinSearchButton.BackgroundImage = zhuyinSearchNormalBackground;
englishSearchButton.BackgroundImage = englishSearchNormalBackground;
pinyinSearchButton.BackgroundImage = pinyinSearchNormalBackground;
wordCountSearchButton.BackgroundImage = wordCountSearchNormalBackground;
handWritingSearchButton.BackgroundImage = handWritingSearchNormalBackground;
activeButton.BackgroundImage = activeBackground;
}
private void SingerSearchButton_Click(object sender, EventArgs e) private void SingerSearchButton_Click(object sender, EventArgs e)
{ {
ResetPrimaryBtnStatus();
singerSearchButton.BackgroundImage = singerSearchActiveBackground; UpdateButtonBackgrounds(singerSearchButton, singerSearchActiveBackground);
isOnOrderedSongsPage = false; isOnOrderedSongsPage = false;
/* 清空搜尋欄 */ /* 清空搜尋欄 */
@ -83,30 +92,22 @@ namespace DualScreenDemo
private void InitializeButtonsForSingerSearch() private void InitializeButtonsForSingerSearch()
{ {
var data = LoadBtnConfigData();
zhuyinSearchNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_注音查詢(未按).png")); InitializeButton(ref zhuyinSearchButton, ref zhuyinSearchNormalBackground, ref zhuyinSearchActiveBackground, "zhuyinSearchButton", 1197, 225, 225, 50, data["SingerSearch"]["ZhuYinSingerNormal"], data["SingerSearch"]["ZhuYinSingerActive"], ZhuyinSearchSingersButton_Click);
zhuyinSearchActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_注音查詢(已按).png")); ;
englishSearchNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_英文查詢(未按).png"));
englishSearchActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_英文查詢(已按).png"));
pinyinSearchNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_拼音查詢(未按).png"));
pinyinSearchActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_拼音查詢(已按).png"));
wordCountSearchNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_字數查詢(未按).png"));
wordCountSearchActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_字數查詢(已按).png"));
handWritingSearchNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_手寫查詢(未按).png"));
handWritingSearchActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\3.歌星查詢_手寫查詢(已按).png"));
InitializeSearchButton(ref zhuyinSearchButton, "zhuyinSearchButton", 1197, 225, 225, 50, ref zhuyinSearchNormalBackground, ref zhuyinSearchActiveBackground, normalStateImageArtistQuery, mouseDownImageArtistQuery, ZhuyinSearchSingersButton_Click); InitializeButton(ref englishSearchButton, ref englishSearchNormalBackground, ref englishSearchActiveBackground, "englishSearchButton", 1197, 280, 225, 50, data["SingerSearch"]["EngSingerNormal"], data["SingerSearch"]["EngSingerActive"], EnglishSearchSingersButton_Click);
InitializeSearchButton(ref englishSearchButton, "englishSearchButton", 1197, 280, 225, 50, ref englishSearchNormalBackground, ref englishSearchActiveBackground, normalStateImageArtistQuery, mouseDownImageArtistQuery, EnglishSearchSingersButton_Click); InitializeButton(ref pinyinSearchButton, ref pinyinSearchNormalBackground, ref pinyinSearchActiveBackground, "pinyinSearchButton", 1197, 335, 225, 50, data["SingerSearch"]["PinYinSingerNormal"], data["SingerSearch"]["PinYinSingerActive"], PinyinSingerSearchButton_Click);
InitializeSearchButton(ref pinyinSearchButton, "pinyinSearchButton", 1197, 335, 225, 50, ref pinyinSearchNormalBackground, ref pinyinSearchActiveBackground, normalStateImageArtistQuery, mouseDownImageArtistQuery, PinyinSingerSearchButton_Click); InitializeButton(ref wordCountSearchButton, ref wordCountSearchNormalBackground, ref wordCountSearchActiveBackground, "wordCountSearchButton", 1197, 390, 225, 50, data["SingerSearch"]["WordCntSingerNormal"], data["SingerSearch"]["WordCntSingerActive"], WordCountSearchSingersButton_Click);
InitializeSearchButton(ref wordCountSearchButton, "workCountSearchButton", 1197, 390, 225, 50, ref wordCountSearchNormalBackground, ref wordCountSearchActiveBackground, normalStateImageArtistQuery, mouseDownImageArtistQuery, WordCountSearchSingersButton_Click);
InitializeSearchButton(ref handWritingSearchButton, "handWritingSearchButton", 1197, 445, 225, 50, ref handWritingSearchNormalBackground, ref handWritingSearchActiveBackground, normalStateImageArtistQuery, mouseDownImageArtistQuery, HandWritingSearchButtonForSingers_Click); InitializeButton(ref handWritingSearchButton, ref handWritingSearchNormalBackground, ref handWritingSearchActiveBackground, "handWritingSearchButton", 1197, 445, 225, 50, data["SingerSearch"]["EngSingerNormal"], data["SingerSearch"]["EngSingerActive"], HandWritingSearchButtonForSingers_Click);
} }
private void InitializeSearchButton(ref Button button, string name, int x, int y, int width, int height, ref Bitmap normalBackground, ref Bitmap activeBackground, Bitmap normalImage, Bitmap activeImage, EventHandler clickEventHandler) private void InitializeSearchButton(ref Button button, string name, int x, int y, int width, int height, ref Bitmap normalBackground, ref Bitmap activeBackground, Bitmap normalImage, Bitmap activeImage, EventHandler clickEventHandler)

View File

@ -23,13 +23,8 @@ namespace DualScreenDemo
private void ZhuyinSearchSongsButton_Click(object sender, EventArgs e) private void ZhuyinSearchSongsButton_Click(object sender, EventArgs e)
{ {
//更新搜尋模式按鈕的背景圖 //更新搜尋模式按鈕的背景圖
zhuyinSearchSongButton.BackgroundImage = zhuyinSearchSongActiveBackground;
englishSearchSongButton.BackgroundImage = englishSearchSongNormalBackground;
pinyinSearchSongButton.BackgroundImage = pinyinSearchSongNormalBackground;
wordCountSearchSongButton.BackgroundImage = wordCountSearchSongNormalBackground;
handWritingSearchSongButton.BackgroundImage = handWritingSearchSongNormalBackground;
numberSearchSongButton.BackgroundImage = numberSearchSongNormalBackground;
UpdateSongSearchBtn(zhuyinSearchSongButton,zhuyinSearchSongActiveBackground);
// 讀取 config.ini 並獲取注音圖片的路徑 // 讀取 config.ini 並獲取注音圖片的路徑
var configData = LoadConfigData(); var configData = LoadConfigData();
string imagePath = Path.Combine(serverPath, configData["ImagePaths"]["ZhuYinSongs"]); string imagePath = Path.Combine(serverPath, configData["ImagePaths"]["ZhuYinSongs"]);

View File

@ -28,6 +28,20 @@ namespace DualScreenDemo
private Bitmap numberSearchSongNormalBackground; private Bitmap numberSearchSongNormalBackground;
private Bitmap numberSearchSongActiveBackground; private Bitmap numberSearchSongActiveBackground;
private void UpdateSongSearchBtn(Button activeButton, Image activeBackground)
{
zhuyinSearchSongButton.BackgroundImage = zhuyinSearchSongNormalBackground;
englishSearchSongButton.BackgroundImage = englishSearchSongNormalBackground;
pinyinSearchSongButton.BackgroundImage = pinyinSearchSongNormalBackground;
wordCountSearchSongButton.BackgroundImage = wordCountSearchSongNormalBackground;
handWritingSearchSongButton.BackgroundImage = handWritingSearchSongNormalBackground;
numberSearchSongButton.BackgroundImage = numberSearchSongNormalBackground;
activeButton.BackgroundImage = activeBackground;
}
/// <summary> /// <summary>
/// 點擊「歌曲搜尋」按鈕時的事件處理函式 /// 點擊「歌曲搜尋」按鈕時的事件處理函式
/// 1. 更新導航按鈕的背景圖片,使「歌曲搜尋」按鈕顯示為啟動狀態 /// 1. 更新導航按鈕的背景圖片,使「歌曲搜尋」按鈕顯示為啟動狀態
@ -36,21 +50,9 @@ namespace DualScreenDemo
/// </summary> /// </summary>
private void SongSearchButton_Click(object sender, EventArgs e) private void SongSearchButton_Click(object sender, EventArgs e)
{ {
// 更新導航按鈕的背景圖片
newSongAlertButton.BackgroundImage = newSongAlertNormalBackground;
hotPlayButton.BackgroundImage = hotPlayNormalBackground;
singerSearchButton.BackgroundImage = singerSearchNormalBackground;
songSearchButton.BackgroundImage = songSearchActiveBackground;
songSearchButton.BackgroundImage = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\1.主類別\\主類別上方_歌名查詢(已按).png"));
languageSearchButton.BackgroundImage = languageSearchNormalBackground;
groupSearchButton.BackgroundImage = groupSearchNormalBackground;
categorySearchButton.BackgroundImage = categorySearchNormalBackground;
orderedSongsButton.BackgroundImage = orderedSongsNormalBackground;
myFavoritesButton.BackgroundImage = myFavoritesNormalBackground;
promotionsButton.BackgroundImage = promotionsNormalBackground;
deliciousFoodButton.BackgroundImage = deliciousFoodNormalBackground;
isOnOrderedSongsPage = false;
isOnOrderedSongsPage = false;
UpdateButtonBackgrounds(songSearchButton, songSearchActiveBackground);
ResetinputBox(); ResetinputBox();
string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' LIMIT 1000;"; string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' LIMIT 1000;";
var searchResult = SearchSongs_Mysql(query); var searchResult = SearchSongs_Mysql(query);
@ -64,7 +66,7 @@ namespace DualScreenDemo
// 隱藏其他 UI // 隱藏其他 UI
SetHotSongButtonsVisibility(false); SetHotSongButtonsVisibility(false);
SetNewSongButtonsVisibility(false); SetNewSongButtonsVisibility(false);
SetSingerSearchButtonsVisibility(false); SetSongSearchButtonsVisibility(false);
SetPictureBoxLanguageButtonsVisibility(false); SetPictureBoxLanguageButtonsVisibility(false);
SetGroupButtonsVisibility(false); SetGroupButtonsVisibility(false);
SetPictureBoxCategoryAndButtonsVisibility(false); SetPictureBoxCategoryAndButtonsVisibility(false);
@ -122,49 +124,26 @@ namespace DualScreenDemo
/// </summary> /// </summary>
private void InitializeButtonsForSongSearch() private void InitializeButtonsForSongSearch()
{ {
zhuyinSearchSongNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_注音查詢(未按).png"));
zhuyinSearchSongActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_注音查詢(已按).png")); var data = LoadBtnConfigData();
englishSearchSongNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_英文查詢(未按).png"));
englishSearchSongActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_英文查詢(已按).png")); InitializeButton(ref zhuyinSearchSongButton, ref zhuyinSearchSongNormalBackground, ref zhuyinSearchSongActiveBackground, "zhuyinSearchSongButton", 1197, 225, 225, 50, data["SongSearch"]["ZhuYinSongNormal"], data["SongSearch"]["ZhuYinSongActive"], ZhuyinSearchSongsButton_Click);
wordCountSearchSongNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_字數查詢(未按).png"));
wordCountSearchSongActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_字數查詢(已按).png"));
pinyinSearchSongNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_拼音查詢(未按).png"));
pinyinSearchSongActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_拼音查詢(已按).png"));
handWritingSearchSongNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_手寫查詢(未按).png"));
handWritingSearchSongActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_手寫查詢(已按).png"));
numberSearchSongNormalBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_編號查詢(未按).png"));
numberSearchSongActiveBackground = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\2.次類別\\4.歌名查詢_編號查詢(已按).png"));
// 初始化「注音搜尋」按鈕 InitializeButton(ref englishSearchSongButton, ref englishSearchSongNormalBackground, ref englishSearchSongActiveBackground, "englishSearchSongButton", 1197, 280, 225, 50, data["SongSearch"]["EngSongNormal"], data["SongSearch"]["EngSongActive"], EnglishSearchSongsButton_Click);
InitializeSearchButton(ref zhuyinSearchSongButton, "zhuyinSearchSongButton",
1197, 225, 225, 50, ref zhuyinSearchSongNormalBackground, ref zhuyinSearchSongActiveBackground,
normalStateImageSongQuery, mouseDownImageSongQuery, ZhuyinSearchSongsButton_Click);
// 初始化「英文搜尋」按鈕
InitializeSearchButton(ref englishSearchSongButton, "englishSearchSongButton",
1197, 280, 225, 50, ref englishSearchSongNormalBackground, ref englishSearchSongActiveBackground,
normalStateImageSongQuery, mouseDownImageSongQuery, EnglishSearchSongsButton_Click);
// 初始化「拼音搜尋」按鈕 InitializeButton(ref pinyinSearchSongButton, ref pinyinSearchSongNormalBackground, ref pinyinSearchSongActiveBackground, "pinyinSearchSongButton", 1197, 335, 225, 50, data["SongSearch"]["PinYingNormal"], data["SongSearch"]["PinYingActive"], PinyinSearchSongsButton_Click);
InitializeSearchButton(ref pinyinSearchSongButton, "pinyinSearchSongButton",
1197, 335, 225, 50, ref pinyinSearchSongNormalBackground, ref pinyinSearchSongActiveBackground,
normalStateImageSongQuery, mouseDownImageSongQuery, PinyinSearchSongsButton_Click);
// 初始化「筆劃搜尋」按鈕
InitializeSearchButton(ref wordCountSearchSongButton, "wordCountSearchSongButton",
1197, 390, 225, 50, ref wordCountSearchSongNormalBackground, ref wordCountSearchSongActiveBackground,
normalStateImageSongQuery, mouseDownImageSongQuery, WordCountSearchSongsButton_Click);
// 初始化「手寫搜尋」按鈕 InitializeButton(ref wordCountSearchSongButton, ref wordCountSearchSongNormalBackground, ref wordCountSearchSongActiveBackground, "wordCountSearchSongButton", 1197, 390, 225, 50, data["SongSearch"]["WordCntSongNormal"], data["SongSearch"]["WordCntSongActive"], WordCountSearchSongsButton_Click);
InitializeSearchButton(ref handWritingSearchSongButton, "handWritingSearchSongButton",
1197, 445, 225, 50, ref handWritingSearchSongNormalBackground, ref handWritingSearchSongActiveBackground,
normalStateImageSongQuery, mouseDownImageSongQuery, HandWritingSearchButtonForSongs_Click); InitializeButton(ref handWritingSearchSongButton, ref handWritingSearchSongNormalBackground, ref handWritingSearchSongActiveBackground, "handWritingSearchSongButton", 1197, 445, 225, 50, data["SongSearch"]["HWritingSongNormal"], data["SongSearch"]["HWritingSongActive"], HandWritingSearchButtonForSongs_Click);
InitializeButton(ref numberSearchSongButton, ref numberSearchSongNormalBackground, ref numberSearchSongActiveBackground, "numberSearchSongButton", 1197, 500, 225, 50, data["SongSearch"]["IDSearchNormal"], data["SongSearch"]["IDSearchActive"], SongIDSearchSongsButton_Click);
// 初始化「數字搜尋」按鈕
InitializeSearchButton(ref numberSearchSongButton, "numberSearchSongButton",
1197, 500, 225, 50, ref numberSearchSongNormalBackground, ref numberSearchSongActiveBackground,
normalStateImageSongQuery, mouseDownImageSongQuery, SongIDSearchSongsButton_Click);
} }
} }
} }