202508041725
搖控器 加入歌曲先判斷包廂狀態 搖控器 加入後只顯示歌曲名稱
This commit is contained in:
parent
09b6244f4c
commit
e787918be8
@ -13,9 +13,6 @@ namespace DualScreenDemo
|
|||||||
private readonly int _maxHistoryLength = 6; // 最多保留 6 筆
|
private readonly int _maxHistoryLength = 6; // 最多保留 6 筆
|
||||||
public static readonly Queue<string> _indataHistory = new Queue<string>();
|
public static readonly Queue<string> _indataHistory = new Queue<string>();
|
||||||
/* 顯示按鈕設定 */
|
/* 顯示按鈕設定 */
|
||||||
private int _wrongInputCountfor62 = 0; // 錯誤輸入計數器
|
|
||||||
private int _wrongInputCountfor61 = 0; // 錯誤輸入計數器
|
|
||||||
private const int MaxWrongLimit = 3; // 錯誤輸入限制次數
|
|
||||||
private readonly SQLManager songListManager;
|
private readonly SQLManager songListManager;
|
||||||
|
|
||||||
public CommandHandler(SQLManager songListManager)
|
public CommandHandler(SQLManager songListManager)
|
||||||
@ -33,15 +30,13 @@ namespace DualScreenDemo
|
|||||||
switch (indata)
|
switch (indata)
|
||||||
{
|
{
|
||||||
case "A261A4": // 輸入
|
case "A261A4": // 輸入
|
||||||
HandleInputA();
|
HandleInput("a");
|
||||||
break;
|
break;
|
||||||
case "A262A4": // 插播
|
case "A262A4": // 插播
|
||||||
HandleInputB();
|
HandleInput("b");
|
||||||
break;
|
break;
|
||||||
case "A263A4":
|
case "A263A4":
|
||||||
ClearDisplay();
|
ClearDisplay();
|
||||||
_wrongInputCountfor62 = 0; // 重置計數器
|
|
||||||
_wrongInputCountfor61 = 0; // 重置計數器
|
|
||||||
_indataHistory.Clear(); // 清空歷史紀錄
|
_indataHistory.Clear(); // 清空歷史紀錄
|
||||||
break;
|
break;
|
||||||
case "A268A4":
|
case "A268A4":
|
||||||
@ -199,7 +194,7 @@ namespace DualScreenDemo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InvokeAction(Action action)
|
static void InvokeAction(Action action)
|
||||||
{
|
{
|
||||||
if (OverlayForm.MainForm.InvokeRequired)
|
if (OverlayForm.MainForm.InvokeRequired)
|
||||||
{
|
{
|
||||||
@ -213,39 +208,21 @@ namespace DualScreenDemo
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static void SkipToNextSong()
|
private void SkipToNextSong()
|
||||||
{
|
{
|
||||||
if (PrimaryForm.Instance.InvokeRequired)
|
InvokeAction(() => PrimaryForm.Instance.videoPlayerForm.PlayNextSong());
|
||||||
PrimaryForm.Instance.Invoke(new System.Action(() => PrimaryForm.Instance.videoPlayerForm.PlayNextSong()));
|
InvokeAction(() => OverlayForm.MainForm.ShowTopRightEchoLabel("標準迴音"));
|
||||||
else
|
|
||||||
PrimaryForm.Instance.videoPlayerForm.PlayNextSong();
|
|
||||||
|
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() => { OverlayForm.MainForm.ShowTopRightEchoLabel("標準迴音"); } ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void ReplayCurrentSong()
|
private void ReplayCurrentSong()
|
||||||
{
|
{
|
||||||
if (PrimaryForm.Instance.InvokeRequired)
|
InvokeAction(() => PrimaryForm.Instance.videoPlayerForm.ReplayCurrentSong());
|
||||||
{
|
|
||||||
PrimaryForm.Instance.Invoke(new System.Action(() => PrimaryForm.Instance.videoPlayerForm.ReplayCurrentSong()));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PrimaryForm.Instance.videoPlayerForm.ReplayCurrentSong();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void PauseOrResumeSong()
|
private static void PauseOrResumeSong()
|
||||||
{
|
{
|
||||||
if (PrimaryForm.Instance.InvokeRequired)
|
InvokeAction(() => PrimaryForm.Instance.videoPlayerForm.PauseOrResumeSong());
|
||||||
{
|
|
||||||
PrimaryForm.Instance.Invoke(new System.Action(() => PrimaryForm.Instance.videoPlayerForm.PauseOrResumeSong()));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PrimaryForm.Instance.videoPlayerForm.PauseOrResumeSong();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ToggleMute()
|
public static void ToggleMute()
|
||||||
@ -277,205 +254,63 @@ namespace DualScreenDemo
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void HandleInputA()
|
private void HandleInput(string input)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
OverlayForm.displayTimer.Stop();
|
|
||||||
string input = "a";
|
|
||||||
|
|
||||||
// 輸入歌曲
|
|
||||||
string songNumber = OverlayForm.ReadSongNumber();
|
|
||||||
//Console.WriteLine("輸入A " + songNumber + " readyForSongListInput : " + readyForSongListInput);
|
|
||||||
var song = songListManager.SearchSongByNumber(songNumber);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (readyForSongListInput)
|
if (readyForSongListInput)
|
||||||
{
|
{
|
||||||
|
InvokeAction(() =>
|
||||||
if (OverlayForm.MainForm.InvokeRequired)
|
|
||||||
{
|
{
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
Console.WriteLine("F sign for input :" + input);
|
||||||
{
|
|
||||||
Console.WriteLine("F sign for input :" + input);
|
|
||||||
OverlayForm.MainForm.OnUserInput(input);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Console.WriteLine("A sign for input :" + input);
|
|
||||||
OverlayForm.MainForm.OnUserInput(input);
|
OverlayForm.MainForm.OnUserInput(input);
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (OverlayForm.MainForm.InvokeRequired)
|
InvokeAction(() =>
|
||||||
{
|
{
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
OverlayForm.displayTimer.Stop();
|
||||||
|
string songNumber = OverlayForm.ReadSongNumber();
|
||||||
|
var song = songListManager.SearchSongByNumber(songNumber);
|
||||||
|
ClearDisplay();
|
||||||
|
if (song != null)
|
||||||
{
|
{
|
||||||
if (song != null)
|
if (Program.room.IsOpen())
|
||||||
{
|
{
|
||||||
ClearDisplay();
|
if (input.Equals("a"))
|
||||||
OverlayForm.MainForm.displayLabel.Text = String.Format("已點歌曲:{0}", song);
|
{
|
||||||
SongList.Add(song);
|
OverlayForm.MainForm.displayLabel.Text = String.Format("已點歌曲:{0}", song);
|
||||||
OverlayForm.MainForm.topLeftLabel.Visible = false;
|
SongList.Add(song);
|
||||||
OverlayForm.displayTimer.Start();
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OverlayForm.MainForm.displayLabel.Text = String.Format("插播歌曲:{0}", song);
|
||||||
|
SongList.Insert(song);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ClearDisplay();
|
OverlayForm.MainForm.displayLabel.Text = "包廂己關閉";
|
||||||
_wrongInputCountfor61++;
|
|
||||||
if(_wrongInputCountfor61 <= MaxWrongLimit)
|
|
||||||
{
|
|
||||||
string old ="";
|
|
||||||
OverlayForm.MainForm.displayLabel.Text = check_control(old);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OverlayForm.MainForm.displayLabel.Text = "輸入錯誤!!!";
|
|
||||||
_indataHistory.Clear(); // 清空歷史紀錄
|
|
||||||
_wrongInputCountfor61 = 0; // 重置計數器
|
|
||||||
}
|
|
||||||
OverlayForm.MainForm.topLeftLabel.Visible = false;
|
|
||||||
OverlayForm.displayTimer.Start();
|
|
||||||
}
|
}
|
||||||
}));
|
|
||||||
}
|
_indataHistory.Clear(); // 清空歷史紀錄
|
||||||
else
|
|
||||||
{
|
|
||||||
if (song != null)
|
|
||||||
{
|
|
||||||
ClearDisplay();
|
|
||||||
OverlayForm.MainForm.displayLabel.Text = String.Format("{0}", song);
|
|
||||||
SongList.Add(song);
|
|
||||||
OverlayForm.MainForm.topLeftLabel.Visible = false;
|
|
||||||
OverlayForm.displayTimer.Start();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
OverlayForm.MainForm.displayLabel.Text = check_control();
|
||||||
ClearDisplay();
|
OverlayForm.MainForm.topLeftLabel.Visible = false;
|
||||||
_wrongInputCountfor61++;
|
OverlayForm.displayTimer.Start();
|
||||||
if(_wrongInputCountfor61 <= MaxWrongLimit)
|
});
|
||||||
{
|
|
||||||
string old ="";
|
|
||||||
OverlayForm.MainForm.displayLabel.Text = check_control(old);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OverlayForm.MainForm.displayLabel.Text = "輸入錯誤!!!";
|
|
||||||
_indataHistory.Clear(); // 清空歷史紀錄
|
|
||||||
_wrongInputCountfor61 = 0; // 重置計數器
|
|
||||||
}
|
|
||||||
OverlayForm.MainForm.topLeftLabel.Visible = false;
|
|
||||||
OverlayForm.displayTimer.Start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private string check_control(string old){
|
private string check_control(){
|
||||||
foreach(string item in _indataHistory)
|
string str = "";
|
||||||
|
foreach (string item in _indataHistory)
|
||||||
{
|
{
|
||||||
if(item == "A261A4")
|
if (item == "A261A4")
|
||||||
old += "#";
|
str += "#";
|
||||||
else if(item == "A262A4")
|
else if (item == "A262A4")
|
||||||
old += "*";
|
str += "*";
|
||||||
}
|
|
||||||
return old;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void HandleInputB()
|
|
||||||
{
|
|
||||||
|
|
||||||
OverlayForm.displayTimer.Stop();
|
|
||||||
string input = "b";
|
|
||||||
|
|
||||||
|
|
||||||
string songNumber = OverlayForm.ReadSongNumber();
|
|
||||||
var song = songListManager.SearchSongByNumber(songNumber);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (readyForSongListInput)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (OverlayForm.MainForm.InvokeRequired)
|
|
||||||
{
|
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
|
||||||
{
|
|
||||||
Console.WriteLine("B sign for input :" + input);
|
|
||||||
OverlayForm.MainForm.OnUserInput(input);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Console.WriteLine("C sign for input :" + input);
|
|
||||||
OverlayForm.MainForm.OnUserInput(input);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (OverlayForm.MainForm.InvokeRequired)
|
|
||||||
{
|
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
|
||||||
{
|
|
||||||
if (song != null)
|
|
||||||
{
|
|
||||||
ClearDisplay();
|
|
||||||
OverlayForm.MainForm.displayLabel.Text = String.Format("插播歌曲{0}", song);
|
|
||||||
SongList.Insert(song);
|
|
||||||
OverlayForm.MainForm.topLeftLabel.Visible = false;
|
|
||||||
OverlayForm.displayTimer.Start();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ClearDisplay();
|
|
||||||
_wrongInputCountfor62++;
|
|
||||||
if(_wrongInputCountfor62 <= MaxWrongLimit)
|
|
||||||
{
|
|
||||||
string old ="";
|
|
||||||
OverlayForm.MainForm.displayLabel.Text = check_control(old);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OverlayForm.MainForm.displayLabel.Text = "輸入錯誤!!!";
|
|
||||||
_indataHistory.Clear(); // 清空歷史紀錄
|
|
||||||
_wrongInputCountfor62 = 0; // 重置計數器
|
|
||||||
}
|
|
||||||
OverlayForm.MainForm.topLeftLabel.Visible = false;
|
|
||||||
OverlayForm.displayTimer.Start();
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (song != null)
|
|
||||||
{
|
|
||||||
ClearDisplay();
|
|
||||||
OverlayForm.MainForm.displayLabel.Text = String.Format("已點歌曲:{0}", song);
|
|
||||||
OverlayForm.MainForm.topLeftLabel.Visible = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ClearDisplay();
|
|
||||||
_wrongInputCountfor62++;
|
|
||||||
if(_wrongInputCountfor62 <= MaxWrongLimit)
|
|
||||||
{
|
|
||||||
string old ="";
|
|
||||||
OverlayForm.MainForm.displayLabel.Text = check_control(old);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OverlayForm.MainForm.displayLabel.Text = "輸入錯誤!!!";
|
|
||||||
_indataHistory.Clear(); // 清空歷史紀錄
|
|
||||||
_wrongInputCountfor62 = 0; // 重置計數器
|
|
||||||
}
|
|
||||||
OverlayForm.MainForm.topLeftLabel.Visible = false;
|
|
||||||
OverlayForm.displayTimer.Start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -487,14 +322,7 @@ namespace DualScreenDemo
|
|||||||
OverlayForm.displayTimer.Stop();
|
OverlayForm.displayTimer.Stop();
|
||||||
|
|
||||||
// 判斷是否需要透過 Invoke 回 UI 執行緒執行
|
// 判斷是否需要透過 Invoke 回 UI 執行緒執行
|
||||||
if (OverlayForm.MainForm.InvokeRequired)
|
InvokeAction(() => ClearControlsAndReset());
|
||||||
{
|
|
||||||
OverlayForm.MainForm.Invoke(new Action(ClearControlsAndReset));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ClearControlsAndReset();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -562,28 +390,19 @@ namespace DualScreenDemo
|
|||||||
for (int i = startIndex; i < endIndex; i++) {
|
for (int i = startIndex; i < endIndex; i++) {
|
||||||
historySongs.Add(history[i]);
|
historySongs.Add(history[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 錨點 遙控器
|
// 錨點 遙控器
|
||||||
|
|
||||||
// 安全更新 UI:若非 UI 執行緒則使用 Invoke 切換
|
// 安全更新 UI:若非 UI 執行緒則使用 Invoke 切換
|
||||||
if (OverlayForm.MainForm.InvokeRequired)
|
InvokeAction(() =>
|
||||||
{
|
{
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
// 更新主畫面的歷史播放顯示區
|
||||||
{
|
|
||||||
// 更新主畫面的歷史播放顯示區
|
|
||||||
OverlayForm.MainForm.UpdateHistoryLabel(historySongs, OverlayForm.MainForm.currentPage, totalPages);
|
|
||||||
|
|
||||||
// 隱藏下一首提示
|
|
||||||
OverlayForm.MainForm.topLeftLabel.Visible = false;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// 若已在 UI 執行緒,直接操作
|
|
||||||
OverlayForm.MainForm.UpdateHistoryLabel(historySongs, OverlayForm.MainForm.currentPage, totalPages);
|
OverlayForm.MainForm.UpdateHistoryLabel(historySongs, OverlayForm.MainForm.currentPage, totalPages);
|
||||||
OverlayForm.MainForm.topLeftLabel.Visible = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// 隱藏下一首提示
|
||||||
|
OverlayForm.MainForm.topLeftLabel.Visible = false;
|
||||||
|
});
|
||||||
|
|
||||||
// 切換 UI 狀態為播放歷史模式(可做為內部狀態管理用途)
|
// 切換 UI 狀態為播放歷史模式(可做為內部狀態管理用途)
|
||||||
OverlayForm.SetUIState(OverlayForm.UIState.PlayHistory);
|
OverlayForm.SetUIState(OverlayForm.UIState.PlayHistory);
|
||||||
}
|
}
|
||||||
@ -595,55 +414,18 @@ namespace DualScreenDemo
|
|||||||
{
|
{
|
||||||
if (OverlayForm.CurrentUIState == OverlayForm.UIState.SelectingSong)
|
if (OverlayForm.CurrentUIState == OverlayForm.UIState.SelectingSong)
|
||||||
{
|
{
|
||||||
|
InvokeAction(() =>OverlayForm.MainForm.PreviousPage());
|
||||||
if (OverlayForm.MainForm.InvokeRequired)
|
|
||||||
{
|
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
|
||||||
{
|
|
||||||
|
|
||||||
OverlayForm.MainForm.PreviousPage();
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
OverlayForm.MainForm.PreviousPage();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (OverlayForm.CurrentUIState == OverlayForm.UIState.SelectingArtist)
|
else if (OverlayForm.CurrentUIState == OverlayForm.UIState.SelectingArtist)
|
||||||
{
|
{
|
||||||
|
InvokeAction(() =>OverlayForm.MainForm.PreviousPage());
|
||||||
if (OverlayForm.MainForm.InvokeRequired)
|
|
||||||
{
|
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
|
||||||
{
|
|
||||||
|
|
||||||
OverlayForm.MainForm.PreviousPage();
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
OverlayForm.MainForm.PreviousPage();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (OverlayForm.CurrentUIState == OverlayForm.UIState.PlayHistory)
|
else if (OverlayForm.CurrentUIState == OverlayForm.UIState.PlayHistory)
|
||||||
{
|
{
|
||||||
if (OverlayForm.MainForm.currentPage > 1)
|
if (OverlayForm.MainForm.currentPage > 1)
|
||||||
{
|
{
|
||||||
OverlayForm.MainForm.currentPage--;
|
OverlayForm.MainForm.currentPage--;
|
||||||
|
InvokeAction(() => DisplaySongHistory());
|
||||||
if (OverlayForm.MainForm.InvokeRequired)
|
|
||||||
{
|
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
|
||||||
{
|
|
||||||
DisplaySongHistory();
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DisplaySongHistory();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -656,37 +438,11 @@ namespace DualScreenDemo
|
|||||||
{
|
{
|
||||||
if (OverlayForm.CurrentUIState == OverlayForm.UIState.SelectingSong)
|
if (OverlayForm.CurrentUIState == OverlayForm.UIState.SelectingSong)
|
||||||
{
|
{
|
||||||
|
InvokeAction(() => OverlayForm.MainForm.NextPage());
|
||||||
if (OverlayForm.MainForm.InvokeRequired)
|
|
||||||
{
|
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
|
||||||
{
|
|
||||||
|
|
||||||
OverlayForm.MainForm.NextPage();
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
OverlayForm.MainForm.NextPage();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (OverlayForm.CurrentUIState == OverlayForm.UIState.SelectingArtist)
|
else if (OverlayForm.CurrentUIState == OverlayForm.UIState.SelectingArtist)
|
||||||
{
|
{
|
||||||
|
InvokeAction(() => OverlayForm.MainForm.NextPage() );
|
||||||
if (OverlayForm.MainForm.InvokeRequired)
|
|
||||||
{
|
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
|
||||||
{
|
|
||||||
|
|
||||||
OverlayForm.MainForm.NextPage();
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
OverlayForm.MainForm.NextPage();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (OverlayForm.CurrentUIState == OverlayForm.UIState.PlayHistory)
|
else if (OverlayForm.CurrentUIState == OverlayForm.UIState.PlayHistory)
|
||||||
{
|
{
|
||||||
@ -695,17 +451,7 @@ namespace DualScreenDemo
|
|||||||
OverlayForm.MainForm.currentPage++;
|
OverlayForm.MainForm.currentPage++;
|
||||||
if (OverlayForm.CurrentUIState == OverlayForm.UIState.PlayHistory)
|
if (OverlayForm.CurrentUIState == OverlayForm.UIState.PlayHistory)
|
||||||
{
|
{
|
||||||
if (OverlayForm.MainForm.InvokeRequired)
|
InvokeAction(() => DisplaySongHistory() );
|
||||||
{
|
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
|
||||||
{
|
|
||||||
DisplaySongHistory();
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DisplaySongHistory();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -803,30 +549,8 @@ namespace DualScreenDemo
|
|||||||
|
|
||||||
private static void UpdateDisplayLabels(string[] messages)
|
private static void UpdateDisplayLabels(string[] messages)
|
||||||
{
|
{
|
||||||
if (OverlayForm.MainForm.InvokeRequired)
|
InvokeAction(() =>
|
||||||
{
|
{
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
|
||||||
{
|
|
||||||
|
|
||||||
foreach (var control in OverlayForm.MainForm.Controls.OfType<Control>().ToArray())
|
|
||||||
{
|
|
||||||
if (control != OverlayForm.MainForm.displayLabel &&
|
|
||||||
control != OverlayForm.MainForm.pauseLabel &&
|
|
||||||
control != OverlayForm.MainForm.muteLabel &&
|
|
||||||
control != OverlayForm.MainForm.topRightLabel &&
|
|
||||||
control != OverlayForm.MainForm.blackBackgroundPanel &&
|
|
||||||
control != OverlayForm.MainForm.topLeftLabel)
|
|
||||||
{
|
|
||||||
OverlayForm.MainForm.Controls.Remove(control);
|
|
||||||
control.Dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
OverlayForm.MainForm.UpdateDisplayLabels(messages);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
foreach (var control in OverlayForm.MainForm.Controls.OfType<Control>().ToArray())
|
foreach (var control in OverlayForm.MainForm.Controls.OfType<Control>().ToArray())
|
||||||
{
|
{
|
||||||
if (control != OverlayForm.MainForm.displayLabel &&
|
if (control != OverlayForm.MainForm.displayLabel &&
|
||||||
@ -841,7 +565,7 @@ namespace DualScreenDemo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
OverlayForm.MainForm.UpdateDisplayLabels(messages);
|
OverlayForm.MainForm.UpdateDisplayLabels(messages);
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void HandleNumberInput(string trimmedData)
|
private static void HandleNumberInput(string trimmedData)
|
||||||
@ -861,38 +585,19 @@ namespace DualScreenDemo
|
|||||||
|
|
||||||
if (readyForSongListInput)
|
if (readyForSongListInput)
|
||||||
{
|
{
|
||||||
|
InvokeAction(() =>
|
||||||
if (OverlayForm.MainForm.InvokeRequired)
|
|
||||||
{
|
{
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
Console.WriteLine("D sign for number :" + number);
|
||||||
{
|
OverlayForm.MainForm.OnUserInput(number);
|
||||||
Console.WriteLine("D sign for number :" + number);
|
});
|
||||||
OverlayForm.MainForm.OnUserInput(number);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Console.WriteLine("E sign for number :" + number);
|
|
||||||
OverlayForm.MainForm.OnUserInput(number);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
InvokeAction(() =>
|
||||||
if (OverlayForm.MainForm.InvokeRequired)
|
|
||||||
{
|
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
|
||||||
{
|
|
||||||
OverlayForm.MainForm.HideTopRightLabels();
|
|
||||||
OverlayForm.DisplayNumberAtTopLeft(number);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
OverlayForm.MainForm.HideTopRightLabels();
|
OverlayForm.MainForm.HideTopRightLabels();
|
||||||
OverlayForm.DisplayNumberAtTopLeft(number);
|
OverlayForm.DisplayNumberAtTopLeft(number);
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,10 +141,7 @@ namespace DBObj
|
|||||||
public int getHumanVoice() { return basic.getHumanVoice(); }
|
public int getHumanVoice() { return basic.getHumanVoice(); }
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
|
return String.Format("{0} {1}", basic.getName(),state.GetDescription() );
|
||||||
return B!=null
|
|
||||||
? String.Format("{0} - {1} - {2} - {3}", state, A.getName(), B.getName(), basic.getName())
|
|
||||||
: String.Format("{0} - {1} - {2}", state, A.getName(), basic.getName());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -13,7 +13,7 @@ namespace DualScreenDemo
|
|||||||
private static PrimaryForm primaryForm; // 儲存實例的參考
|
private static PrimaryForm primaryForm; // 儲存實例的參考
|
||||||
public static Room room = new Room();
|
public static Room room = new Room();
|
||||||
|
|
||||||
public static string verSion = "Server V2.7 202508041108";
|
public static string verSion = "Server V2.7 202508041725";
|
||||||
|
|
||||||
[STAThread]
|
[STAThread]
|
||||||
static void Main()
|
static void Main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user