From 6a255211e211f1986ae77c68f61ba6d7c991e494 Mon Sep 17 00:00:00 2001 From: jasonchenwork Date: Tue, 17 Jun 2025 09:30:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A2=BA=E8=AA=8D=E9=97=9C=E5=8F=B0=E6=8C=89?= =?UTF-8?q?=E9=88=95+=E9=97=9C=E9=96=89X=E6=8C=89=E9=88=95+SVR=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E8=AE=8A=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PrimaryFormParts/PrimaryForm.cs | 66 +++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 23 deletions(-) diff --git a/PrimaryFormParts/PrimaryForm.cs b/PrimaryFormParts/PrimaryForm.cs index 3446797..29a3169 100644 --- a/PrimaryFormParts/PrimaryForm.cs +++ b/PrimaryFormParts/PrimaryForm.cs @@ -336,21 +336,25 @@ namespace DualScreenDemo } private void buttonMiddle_Click(object sender, EventArgs e) { + Console.WriteLine("巨"); sequenceManager.ProcessClick("巨"); } private void buttonTopRight_Click(object sender, EventArgs e) { + Console.WriteLine("級"); sequenceManager.ProcessClick("級"); } private void buttonTopLeft_Click(object sender, EventArgs e) { + Console.WriteLine("超"); sequenceManager.ProcessClick("超"); } private void buttonThanks_Click(object sender, EventArgs e) { + Console.WriteLine("星"); sequenceManager.ProcessClick("星"); } @@ -1372,12 +1376,12 @@ namespace DualScreenDemo TraditionalChineseButton_Click ); - + /* 關閉應用程式按鈕*/ exitButton = new Button{}; - exitButton.Name = "exitButton"; + /*exitButton.Name = "exitButton"; ConfigureButton(exitButton, 1394, 2, 1428 - 1394, 37 - 2, resizedNormalStateImage, resizedMouseOverImage, resizedMouseDownImage, - (sender, e) => Application.Exit()); + (sender, e) => Application.Exit());*/ } private void InitializeButton(ref Button button, ref Bitmap normalBackground, ref Bitmap activeBackground, string buttonName, int x, int y, int width, int height, string imagePath, EventHandler clickEventHandler) @@ -1533,12 +1537,25 @@ namespace DualScreenDemo try { // 1. 檢查是否能連接到 SVR01 - string serverVideoPath = @"\\SVR01\SuperstarB\video"; - string localVideoPath = @"C:\video"; + string serverVideoPath = @"\\SVR01\video"; + string serverVideoPath2 = @"\\SVR02\video"; + string selectedServerPath = null; - if (!Directory.Exists(serverVideoPath)) + string localVideoPath = @"D:\video"; + + if (Directory.Exists(serverVideoPath)) { - Console.WriteLine("未連接到SVR,使用本地影片"); + selectedServerPath = serverVideoPath; + Console.WriteLine("已連接到 SVR01"); + } + else if (Directory.Exists(serverVideoPath2)) + { + selectedServerPath = serverVideoPath2; + Console.WriteLine("已連接到 SVR02"); + } + else + { + Console.WriteLine("未連接到 SVR,使用本地影片"); LoadLocalVideoFiles(); return; } @@ -1550,7 +1567,7 @@ namespace DualScreenDemo } // 獲取服務器和本地的所有文件 - var serverFiles = Directory.GetFiles(serverVideoPath, "*.mpg") + var serverFiles = Directory.GetFiles(selectedServerPath, "*.mpg") .Select(f => new FileInfo(f)) .ToDictionary(f => f.Name, f => f); @@ -1606,7 +1623,7 @@ namespace DualScreenDemo { try { - string videoDirectory = @"C:\video\"; + string videoDirectory = @"D:\video\"; string[] videoFiles = Directory.GetFiles(videoDirectory, "*.mpg"); string pattern = @"^(?\d+)-.*?-(?[^-]+)-"; @@ -1880,7 +1897,7 @@ namespace DualScreenDemo string songInfo = songData.Song ?? "未提供歌曲信息"; - g.DrawString(songInfo, font, textBrush, new PointF(201, 29)); + g.DrawString(songInfo, font, textBrush, new PointF(73, 8)); } ResizeAndPositionPictureBox(VodScreenPictureBox, xPosition, yPosition, pictureBoxWidth, pictureBoxHeight); @@ -2137,19 +2154,21 @@ namespace DualScreenDemo /// /// 重置所有輸入框 /// - private void ResetinputBox(){ - inputBoxZhuYinSingers.Text = ""; - inputBoxZhuYinSongs.Text = ""; - inputBoxEnglishSingers.Text = ""; - inputBoxEnglishSongs.Text = ""; - inputBoxPinYinSingers.Text = ""; - inputBoxPinYinSongs.Text = ""; - inputBoxWordCountSingers.Text = ""; - inputBoxWordCountSongs.Text = ""; - inputBoxSongIDSearch.Text = ""; - handwritingInputBoxForSongs.Text = ""; - handwritingInputBoxForSingers.Text = ""; + private void ResetinputBox() + { + inputBoxZhuYinSingers?.Clear(); + inputBoxZhuYinSongs?.Clear(); + inputBoxEnglishSingers?.Clear(); + inputBoxEnglishSongs?.Clear(); + inputBoxPinYinSingers?.Clear(); + inputBoxPinYinSongs?.Clear(); + inputBoxWordCountSingers?.Clear(); + inputBoxWordCountSongs?.Clear(); + inputBoxSongIDSearch?.Clear(); + handwritingInputBoxForSongs?.Clear(); + handwritingInputBoxForSingers?.Clear(); } + private void MuteUnmuteButton_Click(object sender, EventArgs e) { @@ -2521,11 +2540,12 @@ namespace DualScreenDemo if (initialState.Equals("CLOSE", StringComparison.OrdinalIgnoreCase)) { + /* foreach (Control ctrl in this.Controls) { ctrl.Enabled = false; } - + */ ShowSendOffScreen(); } }