Compare commits
9 Commits
99ae486567
...
3d255da675
Author | SHA1 | Date | |
---|---|---|---|
3d255da675 | |||
020f19bf93 | |||
2e664788ca | |||
b8416494d8 | |||
1ac545ecaf | |||
9f5b51649d | |||
e9ba3b229e | |||
6f8dd92285 | |||
e77b4f4fec |
@ -55,7 +55,7 @@ namespace DBObj
|
|||||||
return PrimaryForm.Instance.SearchSongs_Mysql(query);
|
return PrimaryForm.Instance.SearchSongs_Mysql(query);
|
||||||
}
|
}
|
||||||
public List<SongData> SearchHotSongs(){
|
public List<SongData> SearchHotSongs(){
|
||||||
string query= $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY song_conts DESC LIMIT {PrimaryForm.ReadHotSongLimit()};";
|
string query= $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY song_counts DESC LIMIT {PrimaryForm.ReadHotSongLimit()};";
|
||||||
return PrimaryForm.Instance.SearchSongs_Mysql(query);
|
return PrimaryForm.Instance.SearchSongs_Mysql(query);
|
||||||
}
|
}
|
||||||
public List<SongData> SearchSongsBySinger(string keyword)
|
public List<SongData> SearchSongsBySinger(string keyword)
|
||||||
|
@ -41,8 +41,8 @@ namespace DualScreenDemo
|
|||||||
randomFolderPath = randomFolderName;
|
randomFolderPath = randomFolderName;
|
||||||
|
|
||||||
string localAddress = GetLocalIPAddress();
|
string localAddress = GetLocalIPAddress();
|
||||||
string externalAddress = File.Exists(@"\\JLDKTV\txt\ip.txt")
|
string externalAddress = File.Exists(@"\\svr01\txt\ip.txt")
|
||||||
? File.ReadAllText(@"\\JLDKTV\txt\ip.txt").Trim()
|
? File.ReadAllText(@"\\svr01\txt\ip.txt").Trim()
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
_listener = new HttpListener();
|
_listener = new HttpListener();
|
||||||
@ -964,6 +964,7 @@ namespace DualScreenDemo
|
|||||||
// 将读取到的 "message" 字段传递给 UI 控件显示
|
// 将读取到的 "message" 字段传递给 UI 控件显示
|
||||||
InvokeAction(() => OverlayForm.MainForm.ShowmessageLabel(Messagefist+Messagelast+'_'));
|
InvokeAction(() => OverlayForm.MainForm.ShowmessageLabel(Messagefist+Messagelast+'_'));
|
||||||
}
|
}
|
||||||
|
// 真情告白顯示秒數
|
||||||
await Task.Delay(3000);
|
await Task.Delay(3000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ namespace OverlayFormObj
|
|||||||
standardKeyTimer.Interval = 1000;
|
standardKeyTimer.Interval = 1000;
|
||||||
standardKeyTimer.Tick += (sender, e) => {standardKeyLabel.Visible = false;standardKeyTimer.Stop();keepshowmic();};
|
standardKeyTimer.Tick += (sender, e) => {standardKeyLabel.Visible = false;standardKeyTimer.Stop();keepshowmic();};
|
||||||
|
|
||||||
messageTimer.Interval = 1000;
|
messageTimer.Interval = 5000;
|
||||||
messageTimer.Tick += (sender, e) => {messageLabel.Visible = false;messageTimer.Stop();keepshowmic();};
|
messageTimer.Tick += (sender, e) => {messageLabel.Visible = false;messageTimer.Stop();keepshowmic();};
|
||||||
|
|
||||||
keyUpTimer.Interval = 1000;
|
keyUpTimer.Interval = 1000;
|
||||||
@ -1144,7 +1144,7 @@ public void UpdateNextSongLabelFromPlaylist(bool isUserPlaylistPlaying, SongData
|
|||||||
public void ShowmessageLabel(string customText)
|
public void ShowmessageLabel(string customText)
|
||||||
{
|
{
|
||||||
messageLabel.Visible = true;
|
messageLabel.Visible = true;
|
||||||
messageLabel.Text =customText;
|
messageLabel.Text = customText;
|
||||||
messageTimer.Start();
|
messageTimer.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ namespace DualScreenDemo
|
|||||||
if (isDragging)
|
if (isDragging)
|
||||||
{
|
{
|
||||||
int deltaX = e.X - mouseDownLocation.X;
|
int deltaX = e.X - mouseDownLocation.X;
|
||||||
if (Math.Abs(deltaX) > 50) // 滑動距離超過50像素才觸發
|
if (Math.Abs(deltaX) > 20) // 滑動距離超過50像素才觸發
|
||||||
{
|
{
|
||||||
if (deltaX > 0 && currentPageIndex > 0)
|
if (deltaX > 0 && currentPageIndex > 0)
|
||||||
{
|
{
|
||||||
@ -158,10 +158,10 @@ namespace DualScreenDemo
|
|||||||
}
|
}
|
||||||
public void LoadPreviousPage()
|
public void LoadPreviousPage()
|
||||||
{
|
{
|
||||||
if (currentPageIndex > 0)
|
if (currentPageIndex - 1 >= 0)
|
||||||
{
|
{
|
||||||
currentPageIndex--;
|
currentPageIndex--;
|
||||||
if(currentSongList.Count == 0)
|
if(_isShowingSinger)
|
||||||
{
|
{
|
||||||
RefreshDisplayBase_Singer();
|
RefreshDisplayBase_Singer();
|
||||||
}
|
}
|
||||||
@ -358,6 +358,10 @@ namespace DualScreenDemo
|
|||||||
// 添加滑鼠事件
|
// 添加滑鼠事件
|
||||||
artistLabel.MouseEnter += mouseEnter;
|
artistLabel.MouseEnter += mouseEnter;
|
||||||
artistLabel.MouseLeave += mouseLeave;
|
artistLabel.MouseLeave += mouseLeave;
|
||||||
|
// 滑動
|
||||||
|
artistLabel.MouseDown += MultiPagePanel_MouseDown;
|
||||||
|
artistLabel.MouseMove += MultiPagePanel_MouseMove;
|
||||||
|
artistLabel.MouseUp += MultiPagePanel_MouseUp;
|
||||||
separatorPanel.MouseEnter += mouseEnter;
|
separatorPanel.MouseEnter += mouseEnter;
|
||||||
separatorPanel.MouseLeave += mouseLeave;
|
separatorPanel.MouseLeave += mouseLeave;
|
||||||
// 添加到畫面上
|
// 添加到畫面上
|
||||||
@ -612,10 +616,18 @@ namespace DualScreenDemo
|
|||||||
// 添加事件处理
|
// 添加事件处理
|
||||||
songLabel.Click += PrimaryForm.Instance.Label_Click;
|
songLabel.Click += PrimaryForm.Instance.Label_Click;
|
||||||
artistLabel.Click += PrimaryForm.Instance.Label_Click;
|
artistLabel.Click += PrimaryForm.Instance.Label_Click;
|
||||||
|
// 滑動事件調整位置
|
||||||
|
songLabel.MouseDown += MultiPagePanel_MouseDown;
|
||||||
|
songLabel.MouseMove += MultiPagePanel_MouseMove;
|
||||||
|
songLabel.MouseUp += MultiPagePanel_MouseUp;
|
||||||
songLabel.MouseEnter += mouseEnter;
|
songLabel.MouseEnter += mouseEnter;
|
||||||
songLabel.MouseLeave += mouseLeave;
|
songLabel.MouseLeave += mouseLeave;
|
||||||
artistLabel.MouseEnter += mouseEnter;
|
artistLabel.MouseEnter += mouseEnter;
|
||||||
artistLabel.MouseLeave += mouseLeave;
|
artistLabel.MouseLeave += mouseLeave;
|
||||||
|
// 滑動事件調整位置
|
||||||
|
artistLabel.MouseDown += MultiPagePanel_MouseDown;
|
||||||
|
artistLabel.MouseMove += MultiPagePanel_MouseMove;
|
||||||
|
artistLabel.MouseUp += MultiPagePanel_MouseUp;
|
||||||
separatorPanel.MouseEnter += mouseEnter;
|
separatorPanel.MouseEnter += mouseEnter;
|
||||||
separatorPanel.MouseLeave += mouseLeave;
|
separatorPanel.MouseLeave += mouseLeave;
|
||||||
// 按正确顺序添加控件
|
// 按正确顺序添加控件
|
||||||
|
@ -64,8 +64,8 @@ namespace DualScreenDemo
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 有人聲入口位置
|
||||||
ConfigureButton(this.syncOriginalSongButton, 1218, 335, 205, 56, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, null);
|
ConfigureButton(this.syncOriginalSongButton, 1218, 335, 205, 56, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, resizedNormalStateImageForSyncScreen, (sender,e) => videoPlayerForm.ToggleVocalRemoval());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,14 +18,14 @@ namespace DualScreenDemo
|
|||||||
static void Main()
|
static void Main()
|
||||||
{
|
{
|
||||||
Console.WriteLine("隱藏滑鼠游標");
|
Console.WriteLine("隱藏滑鼠游標");
|
||||||
Cursor.Hide();
|
// Cursor.Hide();
|
||||||
AppDomain.CurrentDomain.ProcessExit += (s, e) =>
|
AppDomain.CurrentDomain.ProcessExit += (s, e) =>
|
||||||
{
|
{
|
||||||
Cursor.Show();
|
Cursor.Show();
|
||||||
};
|
};
|
||||||
|
|
||||||
Console.WriteLine("正在與中控取得聯繫");
|
Console.WriteLine("正在與中控取得聯繫");
|
||||||
var sender = new HeartbeatSender.heartbeatSender();
|
/*var sender = new HeartbeatSender.heartbeatSender();
|
||||||
|
|
||||||
// 同步呼叫非同步登入取得 token
|
// 同步呼叫非同步登入取得 token
|
||||||
bool loginSuccess = sender.LoginAndGetTokenAsync().GetAwaiter().GetResult();
|
bool loginSuccess = sender.LoginAndGetTokenAsync().GetAwaiter().GetResult();
|
||||||
@ -49,7 +49,7 @@ namespace DualScreenDemo
|
|||||||
{
|
{
|
||||||
Console.WriteLine("登入失敗,無法送出心跳");
|
Console.WriteLine("登入失敗,無法送出心跳");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// COM 初始化
|
// COM 初始化
|
||||||
|
29
TCPServer.cs
29
TCPServer.cs
@ -86,28 +86,30 @@ namespace DualScreenDemo
|
|||||||
//heartbeatSender sender = new heartbeatSender("127.0.0.1", 8888);
|
//heartbeatSender sender = new heartbeatSender("127.0.0.1", 8888);
|
||||||
//sender.Start();
|
//sender.Start();
|
||||||
// Console.WriteLine($"heart beat for server{sender.RemoteEndPoint.Address}:{sender.RemoteEndPoint.Port}");
|
// Console.WriteLine($"heart beat for server{sender.RemoteEndPoint.Address}:{sender.RemoteEndPoint.Port}");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
string stateFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"txt","states.txt");
|
string stateFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "txt", "states.txt");
|
||||||
string initialState = ReadStateFile(stateFilePath);
|
string initialState = ReadStateFile(stateFilePath);
|
||||||
|
/*
|
||||||
if (initialState.Equals("CLOSE", StringComparison.OrdinalIgnoreCase))
|
if (initialState.Equals("CLOSE", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
_ = SafeInvoke(PrimaryForm.Instance, () =>
|
_ = SafeInvoke(PrimaryForm.Instance, () =>
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
/*foreach (Control ctrl in PrimaryForm.Instance.Controls)
|
foreach (Control ctrl in PrimaryForm.Instance.Controls)
|
||||||
{
|
{
|
||||||
ctrl.Enabled = false;
|
ctrl.Enabled = false;
|
||||||
}*/
|
}
|
||||||
PrimaryForm.Instance.ShowSendOffScreen();
|
PrimaryForm.Instance.ShowSendOffScreen();
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
Console.WriteLine($"顯示送客畫面時發生錯誤: {ex.Message}");
|
Console.WriteLine($"顯示送客畫面時發生錯誤: {ex.Message}");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
} */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
@ -152,12 +154,13 @@ namespace DualScreenDemo
|
|||||||
PrimaryForm.Instance.ShowSendOffScreen();
|
PrimaryForm.Instance.ShowSendOffScreen();
|
||||||
Console.WriteLine("開始設置新的播放列表");
|
Console.WriteLine("開始設置新的播放列表");
|
||||||
|
|
||||||
|
|
||||||
string closePath = @"D:\video\CLOSE.MPG";
|
string closePath = @"D:\video\CLOSE.MPG";
|
||||||
if (File.Exists(closePath))
|
if (File.Exists(closePath))
|
||||||
{
|
{
|
||||||
SongData closeSong = new SongData(
|
SongData closeSong = new SongData(
|
||||||
"0", "結束播放", "", "", "",
|
"0", "結束播放", "", "", "",
|
||||||
closePath, "", "", "", "",
|
closePath, "", "", "", "",
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
VideoPlayerForm.publicPlaylist = new List<SongData>();
|
VideoPlayerForm.publicPlaylist = new List<SongData>();
|
||||||
@ -167,7 +170,7 @@ namespace DualScreenDemo
|
|||||||
{
|
{
|
||||||
VideoPlayerForm.playingSongList.Add(VideoPlayerForm.Instance.currentPlayingSong);
|
VideoPlayerForm.playingSongList.Add(VideoPlayerForm.Instance.currentPlayingSong);
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoPlayerForm.playingSongList.Add(closeSong);
|
VideoPlayerForm.playingSongList.Add(closeSong);
|
||||||
VideoPlayerForm.publicPlaylist.Add(closeSong);
|
VideoPlayerForm.publicPlaylist.Add(closeSong);
|
||||||
|
|
||||||
@ -208,14 +211,16 @@ namespace DualScreenDemo
|
|||||||
if (command.Trim().Equals("O", StringComparison.OrdinalIgnoreCase))
|
if (command.Trim().Equals("O", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
// 開台時跳至首頁
|
// 開台時跳至首頁
|
||||||
|
|
||||||
VideoPlayerForm.publicPlaylist = new List<SongData>();
|
VideoPlayerForm.publicPlaylist = new List<SongData>();
|
||||||
VideoPlayerForm.playingSongList = new List<SongData>();
|
VideoPlayerForm.playingSongList = new List<SongData>();
|
||||||
VideoPlayerForm.Instance.PlayPublicPlaylist();
|
VideoPlayerForm.Instance.PlayPublicPlaylist();
|
||||||
PrimaryForm.currentSongIndexInHistory = -1;
|
PrimaryForm.currentSongIndexInHistory = -1;
|
||||||
PrimaryForm.Instance.HotPlayButton_Click(null, EventArgs.Empty);
|
PrimaryForm.Instance.HotPlayButton_Click(null, EventArgs.Empty);
|
||||||
UpdateStateFile(stateFilePath, "OPEN");
|
UpdateStateFile(stateFilePath, "OPEN");
|
||||||
|
PrimaryForm.Instance.HideSendOffScreen();
|
||||||
|
|
||||||
|
|
||||||
byte[] okResponse = Encoding.UTF8.GetBytes("OK\n");
|
byte[] okResponse = Encoding.UTF8.GetBytes("OK\n");
|
||||||
stream.Write(okResponse, 0, okResponse.Length);
|
stream.Write(okResponse, 0, okResponse.Length);
|
||||||
continue;
|
continue;
|
||||||
@ -237,8 +242,8 @@ namespace DualScreenDemo
|
|||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsFormReady(OverlayForm.MainForm))
|
if (IsFormReady(OverlayForm.MainForm))
|
||||||
|
@ -254,7 +254,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>歌名</th>
|
<th>歌名</th>
|
||||||
<th>歌手</th>
|
<th>歌手</th>
|
||||||
<th>語別</th>
|
<!-- <th>語別</th> -->
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -270,7 +270,7 @@
|
|||||||
<p>歌名:<span id="detail-song-name"></span></p>
|
<p>歌名:<span id="detail-song-name"></span></p>
|
||||||
<p>編號:<span id="detail-song-number"></span></p>
|
<p>編號:<span id="detail-song-number"></span></p>
|
||||||
<p>歌手:<span id="detail-singer"></span></p>
|
<p>歌手:<span id="detail-singer"></span></p>
|
||||||
<p>語別:<span id="detail-language"></span></p>
|
<!-- <p>語別:<span id="detail-language"></span></p> -->
|
||||||
<button id="order-song-button">包廂點歌</button>
|
<button id="order-song-button">包廂點歌</button>
|
||||||
<button id="insert-song-button">插播歌曲</button>
|
<button id="insert-song-button">插播歌曲</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -80,14 +80,20 @@
|
|||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
|
grid-template-columns: repeat(3, 1fr); /* 固定3欄 */
|
||||||
gap: 5px;
|
gap: 5px; /* 移除格子之間的空隙 */
|
||||||
|
margin: 0; /* 沒有外邊距 */
|
||||||
|
padding: 0; /* 沒有內邊距 */
|
||||||
|
width: 36.5vw; /* 滿版寬度 */
|
||||||
}
|
}
|
||||||
@media (max-width: 600px) {
|
@media (max-width: 600px) {
|
||||||
.content {
|
.content {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
|
grid-template-columns: repeat(3, 1fr); /* 固定3欄 */
|
||||||
gap: 10px;
|
gap: 5px; /* 移除格子之間的空隙 */
|
||||||
|
margin: 0; /* 沒有外邊距 */
|
||||||
|
padding: 0; /* 沒有內邊距 */
|
||||||
|
width: 78vw; /* 滿版寬度 */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.card {
|
.card {
|
||||||
|
@ -259,7 +259,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>歌名</th>
|
<th>歌名</th>
|
||||||
<th>歌手</th>
|
<th>歌手</th>
|
||||||
<th>語別</th>
|
<!--<th>語別</th>-->
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -275,7 +275,7 @@
|
|||||||
<p>歌名:<span id="detail-song-name"></span></p>
|
<p>歌名:<span id="detail-song-name"></span></p>
|
||||||
<p>編號:<span id="detail-song-number"></span></p>
|
<p>編號:<span id="detail-song-number"></span></p>
|
||||||
<p>歌手:<span id="detail-singer"></span></p>
|
<p>歌手:<span id="detail-singer"></span></p>
|
||||||
<p>語別:<span id="detail-language"></span></p>
|
<!---<p>語別:<span id="detail-language"></span></p>-->
|
||||||
<button id="order-song-button">包廂點歌</button>
|
<button id="order-song-button">包廂點歌</button>
|
||||||
<button id="insert-song-button">插播歌曲</button>
|
<button id="insert-song-button">插播歌曲</button>
|
||||||
</div>
|
</div>
|
||||||
@ -348,6 +348,7 @@
|
|||||||
})
|
})
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
console.log('回傳資料',data);
|
||||||
const tableBody = document.querySelector('#results-table tbody');
|
const tableBody = document.querySelector('#results-table tbody');
|
||||||
tableBody.innerHTML = '';
|
tableBody.innerHTML = '';
|
||||||
|
|
||||||
@ -355,15 +356,15 @@
|
|||||||
const row = document.createElement('tr');
|
const row = document.createElement('tr');
|
||||||
const songNameCell = document.createElement('td');
|
const songNameCell = document.createElement('td');
|
||||||
const singerCell = document.createElement('td');
|
const singerCell = document.createElement('td');
|
||||||
const languageCell = document.createElement('td');
|
// const languageCell = document.createElement('td');
|
||||||
|
|
||||||
songNameCell.textContent = song.Song;
|
songNameCell.textContent = song.Song;
|
||||||
singerCell.textContent = song.ArtistA;
|
singerCell.textContent = song.ArtistA;
|
||||||
languageCell.textContent = song.Category;
|
//languageCell.textContent = song.Category;
|
||||||
|
|
||||||
row.appendChild(songNameCell);
|
row.appendChild(songNameCell);
|
||||||
row.appendChild(singerCell);
|
row.appendChild(singerCell);
|
||||||
row.appendChild(languageCell);
|
//row.appendChild(languageCell);
|
||||||
|
|
||||||
row.addEventListener('click', (e) => {
|
row.addEventListener('click', (e) => {
|
||||||
e.preventDefault(); // 阻止默認行為
|
e.preventDefault(); // 阻止默認行為
|
||||||
@ -376,7 +377,7 @@
|
|||||||
document.getElementById('detail-song-name').textContent = song.Song;
|
document.getElementById('detail-song-name').textContent = song.Song;
|
||||||
document.getElementById('detail-song-number').textContent = song.SongNumber;
|
document.getElementById('detail-song-number').textContent = song.SongNumber;
|
||||||
document.getElementById('detail-singer').textContent = song.ArtistA;
|
document.getElementById('detail-singer').textContent = song.ArtistA;
|
||||||
document.getElementById('detail-language').textContent = song.Category;
|
//document.getElementById('detail-language').textContent = song.Category;
|
||||||
|
|
||||||
// 顯示詳情視窗和遮罩
|
// 顯示詳情視窗和遮罩
|
||||||
document.getElementById('song-details').style.display = 'block';
|
document.getElementById('song-details').style.display = 'block';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user