2509021146
遙控器訊號輸入判斷
This commit is contained in:
parent
5cb15a9422
commit
e2a39fde2b
@ -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();
|
||||||
@ -47,20 +49,24 @@ namespace DualScreenDemo
|
|||||||
PreviousPage();
|
PreviousPage();
|
||||||
break;
|
break;
|
||||||
case "A26BA4":
|
case "A26BA4":
|
||||||
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":
|
||||||
@ -69,41 +75,42 @@ namespace DualScreenDemo
|
|||||||
break;
|
break;
|
||||||
// 導唱
|
// 導唱
|
||||||
case "A26EA4":
|
case "A26EA4":
|
||||||
SafeInvokeAction("A26EA4",() => VideoPlayerForm.Instance.ToggleVocalRemoval());
|
SafeInvokeAction("A26EA4",() => VideoPlayerForm.Instance.ToggleVocalRemoval());
|
||||||
break;
|
break;
|
||||||
case "A26DA4":
|
case "A26DA4":
|
||||||
PauseOrResumeSong();
|
PauseOrResumeSong();
|
||||||
break;
|
break;
|
||||||
case "A276A4":
|
case "A276A4":
|
||||||
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("音量 ↑ "));
|
||||||
break;
|
break;
|
||||||
case "A2B4A4":
|
case "A2B4A4":
|
||||||
SafeInvokeAction("A2B4A4",() => OverlayForm.MainForm.ShowTopRightLabelTime("音量 ↓ "));
|
SafeInvokeAction("A2B4A4",() => OverlayForm.MainForm.ShowTopRightLabelTime("音量 ↓ "));
|
||||||
break;
|
break;
|
||||||
case "A2B5A4":
|
case "A2B5A4":
|
||||||
SafeInvokeAction("A2B5A4",() => OverlayForm.MainForm.ShowTopRightLabelTime("麥克風 ↑ "));
|
SafeInvokeAction("A2B5A4",() => OverlayForm.MainForm.ShowTopRightLabelTime("麥克風 ↑ "));
|
||||||
break;
|
break;
|
||||||
case "A2B6A4":
|
case "A2B6A4":
|
||||||
SafeInvokeAction("A2B6A4",() => OverlayForm.MainForm.ShowTopRightLabelTime("麥克風 ↓ "));
|
SafeInvokeAction("A2B6A4",() => OverlayForm.MainForm.ShowTopRightLabelTime("麥克風 ↓ "));
|
||||||
break;
|
break;
|
||||||
case "A2C2A4":
|
case "A2C2A4":
|
||||||
SafeInvokeAction("A2C2A4",() => OverlayForm.MainForm.ShowTopRightEchoLabel("標準迴音"));
|
SafeInvokeAction("A2C2A4",() => OverlayForm.MainForm.ShowTopRightEchoLabel("標準迴音"));
|
||||||
break;
|
break;
|
||||||
case "A2C3A4":
|
case "A2C3A4":
|
||||||
SafeInvokeAction("A2C3A4",() => OverlayForm.MainForm.ShowTopRightEchoLabel("專業迴音"));
|
SafeInvokeAction("A2C3A4",() => OverlayForm.MainForm.ShowTopRightEchoLabel("專業迴音"));
|
||||||
break;
|
break;
|
||||||
case "A2C4A4":
|
case "A2C4A4":
|
||||||
SafeInvokeAction("A2C4A4",() => OverlayForm.MainForm.ShowTopRightEchoLabel("廣場迴音"));
|
SafeInvokeAction("A2C4A4",() => OverlayForm.MainForm.ShowTopRightEchoLabel("廣場迴音"));
|
||||||
break;
|
break;
|
||||||
case "A2C1A4":
|
case "A2C1A4":
|
||||||
SafeInvokeAction("A2C1A4",() => OverlayForm.MainForm.ShowTopRightEchoLabel("唱將迴音"));
|
SafeInvokeAction("A2C1A4",() => OverlayForm.MainForm.ShowTopRightEchoLabel("唱將迴音"));
|
||||||
break;
|
break;
|
||||||
case "A2D5A4":
|
case "A2D5A4":
|
||||||
SafeInvokeAction("A2D5A4",() => OverlayForm.MainForm.ShowTopRightLabelTime(" 明亮 "));
|
SafeInvokeAction("A2D5A4",() => 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 操作
|
||||||
|
@ -149,12 +149,10 @@ namespace DualScreenDemo
|
|||||||
private void ShowImageOnPictureBoxSceneSoundEffects(string imagePath)
|
private void ShowImageOnPictureBoxSceneSoundEffects(string imagePath)
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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); }
|
||||||
@ -521,19 +511,23 @@ namespace DualScreenDemo
|
|||||||
private bool isVocalRemoved = true;
|
private bool isVocalRemoved = true;
|
||||||
public void ToggleVocalRemoval()
|
public void ToggleVocalRemoval()
|
||||||
{
|
{
|
||||||
if (isVocalRemoved)
|
if (SongList.Current().isPublicSong == false)
|
||||||
{
|
{
|
||||||
_mediaService1.Player.Select(TrackType.Audio, "audio/2");
|
if (isVocalRemoved)
|
||||||
|
{
|
||||||
|
_mediaService1.Player.Select(TrackType.Audio, "audio/2");
|
||||||
|
|
||||||
isVocalRemoved = false;
|
isVocalRemoved = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_mediaService1.Player.Select(TrackType.Audio, "audio/1,audio/3");
|
||||||
|
// _mediaService1.Player.Select(TrackType.Audio, "audio/3");
|
||||||
|
isVocalRemoved = true;
|
||||||
|
}
|
||||||
|
OverlayForm.MainForm.ShowTopRightLabelTime(isVocalRemoved ? "無人聲" : "有人聲");
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
_mediaService1.Player.Select(TrackType.Audio, "audio/1,audio/3");
|
|
||||||
// _mediaService1.Player.Select(TrackType.Audio, "audio/3");
|
|
||||||
isVocalRemoved = true;
|
|
||||||
}
|
|
||||||
OverlayForm.MainForm.ShowTopRightLabelTime(isVocalRemoved ? "無人聲" : "有人聲");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user