202508081053
修正Room State 相同不做動作 修正包廂結束 不做 add close 歌曲
This commit is contained in:
parent
f8a6e5c40d
commit
b6e9bc45c6
@ -71,18 +71,12 @@ namespace DBObj
|
||||
{
|
||||
try
|
||||
{
|
||||
Console.WriteLine($"伺服器路徑: '{server}'");
|
||||
string fullPath = Path.Combine(server, basic.getFileName());
|
||||
|
||||
if (File.Exists(fullPath))
|
||||
{
|
||||
Console.WriteLine($"找到檔案: {fullPath}");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"找不到檔案: {fullPath}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -102,7 +96,6 @@ namespace DBObj
|
||||
{
|
||||
foreach (var server in Utils.Env.GetSongServers())
|
||||
{
|
||||
Console.WriteLine($"伺服器路徑: '{server}'");
|
||||
string fullPath = Path.Combine(server, filename);
|
||||
if (File.Exists(fullPath)) return fullPath;
|
||||
}
|
||||
|
@ -139,8 +139,6 @@ namespace DBObj
|
||||
song.SetState(PlayState.Skipped);
|
||||
played.Add(song);
|
||||
}
|
||||
|
||||
Add(close);
|
||||
}
|
||||
public static void clearSong()
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ namespace DualScreenDemo
|
||||
private static PrimaryForm primaryForm; // 儲存實例的參考
|
||||
public static Room room = new Room();
|
||||
|
||||
public static string verSion = "Server V2.8 202508071811";
|
||||
public static string verSion = "Server V2.8 202508081053";
|
||||
|
||||
[STAThread]
|
||||
static void Main()
|
||||
|
33
Room.cs
33
Room.cs
@ -32,6 +32,7 @@ namespace DualScreenDemo
|
||||
|
||||
private string getDB()
|
||||
{
|
||||
|
||||
using (var db = new MyDB())
|
||||
{
|
||||
string query = @"SELECT * FROM rooms WHERE branch_id = @branch_id AND CONCAT(type, name) = @hostName";
|
||||
@ -41,11 +42,11 @@ namespace DualScreenDemo
|
||||
};
|
||||
if (db.open(query, parameters) && db.found())
|
||||
{
|
||||
State = db.Field<string>("status");
|
||||
startedAt=ParseTime(db.Field<string>("started_at"));
|
||||
endedAt=ParseTime(db.Field<string>("ended_at"));
|
||||
if (State.Equals("maintain")) { State = "active"; }
|
||||
return State;
|
||||
var Statedb = db.Field<string>("status");
|
||||
startedAt = ParseTime(db.Field<string>("started_at"));
|
||||
endedAt = ParseTime(db.Field<string>("ended_at"));
|
||||
if (Statedb.Equals("maintain")) { Statedb = "active"; }
|
||||
return Statedb;
|
||||
}
|
||||
}
|
||||
return "error";
|
||||
@ -66,25 +67,29 @@ namespace DualScreenDemo
|
||||
public void set(string value)
|
||||
{
|
||||
string StateDB=getDB();
|
||||
if (!StateDB.Equals(State))
|
||||
{
|
||||
State = StateDB;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Console.WriteLine($"hostname status: {hostName},{StateDB},{startedAt},{endedAt} ,{State}");
|
||||
string marqueeMessage = "歡迎使用超級巨星歡唱,與你共度美好時光。";
|
||||
Color c = Color.White;
|
||||
if (StateDB.Equals("fire"))
|
||||
if (State.Equals("fire"))
|
||||
{
|
||||
PrimaryForm.Instance.ShowSendOffScreen();
|
||||
VideoPlayerForm.Instance.Pause();
|
||||
marqueeMessage = "發生火災,請跟隨引導至逃生出口!!!";
|
||||
c = Color.Red;
|
||||
}
|
||||
else if (StateDB.Equals("active"))
|
||||
else if (State.Equals("active"))
|
||||
{
|
||||
if (!State.Equals(StateDB))
|
||||
{
|
||||
DBObj.SongList.clearSong();
|
||||
PrimaryForm.Instance.HotPlayButton_Click(null, EventArgs.Empty);
|
||||
PrimaryForm.Instance.HideSendOffScreen();
|
||||
}
|
||||
DBObj.SongList.clearSong();
|
||||
PrimaryForm.Instance.HotPlayButton_Click(null, EventArgs.Empty);
|
||||
PrimaryForm.Instance.HideSendOffScreen();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -74,7 +74,7 @@ namespace DualScreenDemo
|
||||
|
||||
public static OverlayForm overlayForm;
|
||||
public bool isMuted = false;
|
||||
public int previousVolume = -1000;
|
||||
public int previousVolume = 0;
|
||||
public bool isPaused = false;
|
||||
private bool isSyncToPrimaryMonitor = false;
|
||||
|
||||
@ -363,14 +363,8 @@ namespace DualScreenDemo
|
||||
secondary.RenderMediaFile(pathToPlay,this.Handle,secondMonitor.Bounds.Width,secondMonitor.Bounds.Height);
|
||||
|
||||
// 音量處理
|
||||
if (isMuted)
|
||||
{
|
||||
SetVolume(-10000);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetVolume(previousVolume);
|
||||
}
|
||||
SetVolume(isMuted ? -10000 : previousVolume);
|
||||
|
||||
// 開始播放
|
||||
primary.Run();
|
||||
secondary.Run();
|
||||
|
Loading…
x
Reference in New Issue
Block a user