2509021146

遙控器訊號輸入判斷
This commit is contained in:
jasonchenwork 2025-09-02 11:46:50 +08:00
parent 5cb15a9422
commit e2a39fde2b
4 changed files with 82 additions and 46 deletions

View File

@ -30,10 +30,12 @@ namespace DualScreenDemo
switch (indata) switch (indata)
{ {
case "A261A4": // 輸入 case "A261A4": // 輸入
HandleInput("a"); // HandleInput("a");
HandleRoomState("A261A4");
break; break;
case "A262A4": // 插播 case "A262A4": // 插播
HandleInput("b"); // HandleInput("b");
HandleRoomState("A262A4");
break; break;
case "A263A4": case "A263A4":
ClearDisplay(); ClearDisplay();
@ -50,17 +52,21 @@ namespace DualScreenDemo
NextPage(); NextPage();
break; break;
case "A271A4": case "A271A4":
HandleNewSongAnnouncements(); // HandleNewSongAnnouncements();
HandleRoomState("A271A4");
break; break;
case "A273A4": case "A273A4":
HandleHotSongAnnouncements(); // HandleHotSongAnnouncements();
HandleRoomState("A273A4");
break; break;
case "A267A4": case "A267A4":
SkipToNextSong(); // SkipToNextSong();
ClearDisplay(); // ClearDisplay();
HandleRoomState("A267A4");
break; break;
case "A269A4": case "A269A4":
ReplayCurrentSong(); // ReplayCurrentSong();
HandleRoomState("A269A4");
break; break;
// 原唱 // 原唱
case "A26CA4": case "A26CA4":
@ -78,8 +84,9 @@ namespace DualScreenDemo
ToggleMute(); ToggleMute();
break; break;
case "A274A4": case "A274A4":
OverlayForm.MainForm.currentPage = 1; // OverlayForm.MainForm.currentPage = 1;
HandleArtistAnnouncements(); // HandleArtistAnnouncements();
HandleRoomState("A274A4");
break; break;
case "A2B3A4": case "A2B3A4":
SafeInvokeAction("A2B3A4",() => OverlayForm.MainForm.ShowTopRightLabelTime("音量 ↑ ")); SafeInvokeAction("A2B3A4",() => OverlayForm.MainForm.ShowTopRightLabelTime("音量 ↑ "));
@ -160,6 +167,44 @@ namespace DualScreenDemo
return Task.CompletedTask; return Task.CompletedTask;
} }
private void HandleRoomState(string action)
{
if (Program.room.IsOpen()==false)
{
switch (action)
{
case "A261A4": // 輸入
HandleInput("a");
break;
case "A262A4": // 插播
HandleInput("b");
break;
case "A271A4":
HandleNewSongAnnouncements();
break;
case "A273A4":
HandleHotSongAnnouncements();
break;
case "A267A4":
SkipToNextSong();
ClearDisplay();
break;
case "A269A4":
ReplayCurrentSong();
break;
case "A274A4":
OverlayForm.MainForm.currentPage = 1;
HandleArtistAnnouncements();
break;
default:
break;
}
}
}
private void SafeInvokeAction(string commandKey, Action action) private void SafeInvokeAction(string commandKey, Action action)
{ {
// 真正執行 UI 操作 // 真正執行 UI 操作

View File

@ -150,11 +150,9 @@ namespace DualScreenDemo
{ {
Bitmap originalImage = new Bitmap(imagePath); Bitmap originalImage = new Bitmap(imagePath);
Rectangle cropArea = new Rectangle(856, 422, 342, 295);
pictureBoxSceneSoundEffects.Image = originalImage; pictureBoxSceneSoundEffects.Image = originalImage;
ResizeAndPositionPictureBox(pictureBoxSceneSoundEffects, cropArea.X, cropArea.Y, cropArea.Width, cropArea.Height); ResizeAndPositionPictureBox(pictureBoxSceneSoundEffects, 856, 422, 342, 295);
pictureBoxSceneSoundEffects.Visible = true; pictureBoxSceneSoundEffects.Visible = true;
} }

View File

@ -152,7 +152,7 @@ namespace DualScreenDemo
private Timer autoRefreshTimer; private Timer autoRefreshTimer;
private Timer timerCountdown; private Timer timerCountdown;
string Rtime; string Rtime;
bool Gaintest = true; bool Gaintest = false;
//private Label pageNumberLabel; // 添加頁碼標籤 //private Label pageNumberLabel; // 添加頁碼標籤
public PrimaryForm() public PrimaryForm()
{ {
@ -1401,7 +1401,6 @@ namespace DualScreenDemo
using (Graphics g = Graphics.FromImage(bmp)) using (Graphics g = Graphics.FromImage(bmp))
{ {
g.DrawImage(source, 0, 0, section, GraphicsUnit.Pixel); g.DrawImage(source, 0, 0, section, GraphicsUnit.Pixel);
} }

View File

@ -354,16 +354,6 @@ namespace DualScreenDemo
PrimaryForm.Instance.videoView0.Visible = true; PrimaryForm.Instance.videoView0.Visible = true;
//影片畫面播放器載入media設置聲道 //影片畫面播放器載入media設置聲道
_mediaService1.LoadMedia(pathToPlay, song.isPublicSong ? 0 : 1); _mediaService1.LoadMedia(pathToPlay, song.isPublicSong ? 0 : 1);
//公播時註銷原唱按鈕事件
if (song.isPublicSong)
{
PrimaryForm.Instance.originalSongButton.Click -= PrimaryForm.Instance.OriginalSongButton_Click;
}
else
{
PrimaryForm.Instance.originalSongButton.Click -= PrimaryForm.Instance.OriginalSongButton_Click;
PrimaryForm.Instance.originalSongButton.Click += PrimaryForm.Instance.OriginalSongButton_Click;
}
isVocalRemoved = true; isVocalRemoved = true;
if (isMuted) { Mute(true); } if (isMuted) { Mute(true); }
@ -520,6 +510,8 @@ namespace DualScreenDemo
private bool isVocalRemoved = true; private bool isVocalRemoved = true;
public void ToggleVocalRemoval() public void ToggleVocalRemoval()
{
if (SongList.Current().isPublicSong == false)
{ {
if (isVocalRemoved) if (isVocalRemoved)
{ {
@ -537,6 +529,8 @@ namespace DualScreenDemo
} }
} }
}
} }