手機,遙控器點歌歌名作標記

This commit is contained in:
allen.yan 2025-08-12 17:15:57 +08:00
parent d36ddd9e90
commit 685afb1642
3 changed files with 9 additions and 2 deletions

View File

@ -274,6 +274,8 @@ namespace DualScreenDemo
ClearDisplay(); ClearDisplay();
if (song != null) if (song != null)
{ {
song.getBasic().setNameTest(".");
if (Program.room.IsOpen()) if (Program.room.IsOpen())
{ {
if (input.Equals("a")) if (input.Equals("a"))

View File

@ -22,5 +22,6 @@ namespace DBObj
public string getName() =>Name; public string getName() =>Name;
public string getFileName() => FileName; public string getFileName() => FileName;
public int getHumanVoice() => HumanVoice; public int getHumanVoice() => HumanVoice;
public string setNameTest(string s) => Name = Name+s;
} }
} }

View File

@ -47,12 +47,15 @@ namespace DualScreenDemo
_listener = new HttpListener(); _listener = new HttpListener();
_listener.Prefixes.Add($"http://{localAddress}:{port}/"); _listener.Prefixes.Add($"http://{localAddress}:{port}/");
string hostName = System.Net.Dns.GetHostName(); string hostName = System.Net.Dns.GetHostName();
//string hostName = "pc101";
string externalPort = '1' + hostName.Substring(Math.Max(2, hostName.Length - 20)); string externalPort = '1' + hostName.Substring(Math.Max(2, hostName.Length - 20));
if (!string.IsNullOrEmpty(externalAddress)) if (!string.IsNullOrEmpty(externalAddress))
{ {
string host = externalAddress.Split(':')[0]; string host = externalAddress.Split(':')[0];
externalPort = '1' + System.Net.Dns.GetHostName().Substring(Math.Max(2, System.Net.Dns.GetHostName().Length - 20)); externalPort = '1' + System.Net.Dns.GetHostName().Substring(Math.Max(2, System.Net.Dns.GetHostName().Length - 20));
_listener.Prefixes.Add($"http://{host}:{externalPort}/"); _listener.Prefixes.Add($"http://{host}:{externalPort}/");
//externalPort = '1' + hostName.Substring(Math.Max(2, System.Net.Dns.GetHostName().Length - 20));
//_listener.Prefixes.Add($"http://{host}:{externalPort}/");
} }
string localQrContent = String.Format("http://{0}:{1}/{2}/windows.html", localAddress, port, randomFolderName); string localQrContent = String.Format("http://{0}:{1}/{2}/windows.html", localAddress, port, randomFolderName);
@ -708,6 +711,7 @@ namespace DualScreenDemo
Console.WriteLine($"Ordering Song: {song.getName()} by {song.getArtist_A()}"); Console.WriteLine($"Ordering Song: {song.getName()} by {song.getArtist_A()}");
// 这里可以添加处理逻辑,例如将歌曲加入到播放列表或数据库中 // 这里可以添加处理逻辑,例如将歌曲加入到播放列表或数据库中
song.getBasic().setNameTest("*");
SongList.Add(song); SongList.Add(song);
var response = new { status = "success", message = "Song ordered successfully" }; var response = new { status = "success", message = "Song ordered successfully" };