Compare commits
10 Commits
33b6883df2
...
a1d7ce97a2
Author | SHA1 | Date | |
---|---|---|---|
a1d7ce97a2 | |||
1cca77f505 | |||
a58601e1fb | |||
c623bbe26d | |||
4d02d56152 | |||
af1a18550b | |||
4466c457fd | |||
2502ac41c5 | |||
eb1db3c8c8 | |||
c4b8b82b64 |
@ -3,6 +3,7 @@ using System.Text.RegularExpressions;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using DBObj;
|
using DBObj;
|
||||||
using OverlayFormObj;
|
using OverlayFormObj;
|
||||||
|
using NAudio.Wave;
|
||||||
namespace DualScreenDemo
|
namespace DualScreenDemo
|
||||||
{
|
{
|
||||||
public class CommandHandler
|
public class CommandHandler
|
||||||
@ -10,7 +11,7 @@ namespace DualScreenDemo
|
|||||||
public static bool readyForSongListInput = false;
|
public static bool readyForSongListInput = false;
|
||||||
/* 關機 queue */
|
/* 關機 queue */
|
||||||
private readonly int _maxHistoryLength = 6; // 最多保留 6 筆
|
private readonly int _maxHistoryLength = 6; // 最多保留 6 筆
|
||||||
private readonly Queue<string> _indataHistory = new Queue<string>();
|
public static readonly Queue<string> _indataHistory = new Queue<string>();
|
||||||
/* 顯示按鈕設定 */
|
/* 顯示按鈕設定 */
|
||||||
private int _wrongInputCountfor62 = 0; // 錯誤輸入計數器
|
private int _wrongInputCountfor62 = 0; // 錯誤輸入計數器
|
||||||
private int _wrongInputCountfor61 = 0; // 錯誤輸入計數器
|
private int _wrongInputCountfor61 = 0; // 錯誤輸入計數器
|
||||||
@ -28,7 +29,7 @@ namespace DualScreenDemo
|
|||||||
{
|
{
|
||||||
AddToHistory(indata);
|
AddToHistory(indata);
|
||||||
// 遙控器測試
|
// 遙控器測試
|
||||||
Console.WriteLine("遙控器:" + indata);
|
Console.WriteLine("遙控器: " + indata);
|
||||||
switch (indata)
|
switch (indata)
|
||||||
{
|
{
|
||||||
case "A261A4": // 輸入
|
case "A261A4": // 輸入
|
||||||
@ -83,6 +84,7 @@ namespace DualScreenDemo
|
|||||||
ToggleMute();
|
ToggleMute();
|
||||||
break;
|
break;
|
||||||
case "A274A4":
|
case "A274A4":
|
||||||
|
OverlayForm.MainForm.currentPage = 1;
|
||||||
HandleArtistAnnouncements();
|
HandleArtistAnnouncements();
|
||||||
break;
|
break;
|
||||||
case "A2B3A4":
|
case "A2B3A4":
|
||||||
@ -301,8 +303,9 @@ namespace DualScreenDemo
|
|||||||
OverlayForm.displayTimer.Stop();
|
OverlayForm.displayTimer.Stop();
|
||||||
string input = "a";
|
string input = "a";
|
||||||
|
|
||||||
|
// 輸入歌曲
|
||||||
string songNumber = OverlayForm.ReadSongNumber();
|
string songNumber = OverlayForm.ReadSongNumber();
|
||||||
|
//Console.WriteLine("輸入A " + songNumber + " readyForSongListInput : " + readyForSongListInput);
|
||||||
var song = songListManager.SearchSongByNumber(songNumber);
|
var song = songListManager.SearchSongByNumber(songNumber);
|
||||||
|
|
||||||
|
|
||||||
@ -314,11 +317,13 @@ namespace DualScreenDemo
|
|||||||
{
|
{
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("F sign for input :" + input);
|
||||||
OverlayForm.MainForm.OnUserInput(input);
|
OverlayForm.MainForm.OnUserInput(input);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("A sign for input :" + input);
|
||||||
OverlayForm.MainForm.OnUserInput(input);
|
OverlayForm.MainForm.OnUserInput(input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -418,11 +423,13 @@ namespace DualScreenDemo
|
|||||||
{
|
{
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("B sign for input :" + input);
|
||||||
OverlayForm.MainForm.OnUserInput(input);
|
OverlayForm.MainForm.OnUserInput(input);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("C sign for input :" + input);
|
||||||
OverlayForm.MainForm.OnUserInput(input);
|
OverlayForm.MainForm.OnUserInput(input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -558,7 +565,8 @@ namespace DualScreenDemo
|
|||||||
Console.WriteLine("ClearDisplay called.");
|
Console.WriteLine("ClearDisplay called.");
|
||||||
|
|
||||||
// 重設狀態標記與 UI 狀態
|
// 重設狀態標記與 UI 狀態
|
||||||
readyForSongListInput = false;
|
// 嘗試 true
|
||||||
|
readyForSongListInput = true;
|
||||||
OverlayForm.SetUIState(OverlayForm.UIState.Initial);
|
OverlayForm.SetUIState(OverlayForm.UIState.Initial);
|
||||||
Console.WriteLine("Display cleared.");
|
Console.WriteLine("Display cleared.");
|
||||||
}
|
}
|
||||||
@ -588,13 +596,41 @@ namespace DualScreenDemo
|
|||||||
// 準備要傳給 UpdateHistoryLabel 的兩個清單:歌曲資料與播放狀態
|
// 準備要傳給 UpdateHistoryLabel 的兩個清單:歌曲資料與播放狀態
|
||||||
List<SongData> historySongs = new List<SongData>();
|
List<SongData> historySongs = new List<SongData>();
|
||||||
List<PlayState> playStates = new List<PlayState>();
|
List<PlayState> playStates = new List<PlayState>();
|
||||||
|
// 錨點 遙控器
|
||||||
// 從播放紀錄中取出當前頁面應顯示的歌曲與狀態
|
// 從播放紀錄中取出當前頁面應顯示的歌曲與狀態
|
||||||
for (int i = startIndex; i < endIndex; i++)
|
int completedCount = PrimaryForm.currentSongIndexInHistory;
|
||||||
|
// 判斷是否正在播放公播歌單 (若用戶點播歌單為空,則播放公播歌單)
|
||||||
|
bool isPlayingPublicList = PrimaryForm.userRequestedSongs.Count == 0 ||
|
||||||
|
(PrimaryForm.currentSongIndexInHistory >= PrimaryForm.userRequestedSongs.Count - 1 && PrimaryForm.Instance.videoPlayerForm.IsPlayingPublicSong);
|
||||||
|
if (isPlayingPublicList)
|
||||||
{
|
{
|
||||||
historySongs.Add(PrimaryForm.playedSongsHistory[i]); // 加入歌曲
|
for (int i = startIndex; i < endIndex; i++)
|
||||||
playStates.Add(PrimaryForm.playStates[i]); // 加入狀態 (已播、播放中、未播)
|
{
|
||||||
|
historySongs.Add(PrimaryForm.playedSongsHistory[i]); // 加入歌曲
|
||||||
|
playStates.Add(PlayState.Played);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int i = startIndex; i < endIndex; i++)
|
||||||
|
{
|
||||||
|
|
||||||
|
historySongs.Add(PrimaryForm.playedSongsHistory[i]); // 加入歌曲
|
||||||
|
if (i < completedCount)
|
||||||
|
{
|
||||||
|
playStates.Add(PlayState.Played);
|
||||||
|
}
|
||||||
|
else if (i == completedCount)
|
||||||
|
{
|
||||||
|
playStates.Add(PlayState.Playing);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
playStates.Add(PlayState.NotPlayed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -935,11 +971,13 @@ namespace DualScreenDemo
|
|||||||
{
|
{
|
||||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("D sign for number :" + number);
|
||||||
OverlayForm.MainForm.OnUserInput(number);
|
OverlayForm.MainForm.OnUserInput(number);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("E sign for number :" + number);
|
||||||
OverlayForm.MainForm.OnUserInput(number);
|
OverlayForm.MainForm.OnUserInput(number);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,14 +17,14 @@ namespace DBObj
|
|||||||
{
|
{
|
||||||
if (category == "全部")
|
if (category == "全部")
|
||||||
{
|
{
|
||||||
string query = $"SELECT * FROM ArtistLibrary WHERE 歌手筆畫 >= {minStrokes} AND 歌手筆畫 <={maxStrokes}";
|
string query = $"SELECT * FROM artists WHERE strokes_abbr >= {minStrokes} AND strokes_abbr <={maxStrokes};";
|
||||||
var searchResults = PrimaryForm.SearchSingers_Mysql(query);
|
var searchResults = PrimaryForm.SearchSingers_Mysql(query);
|
||||||
return searchResults;
|
return searchResults;
|
||||||
//return AllArtists.Where(artist => artist.Strokes >= minStrokes && artist.Strokes <= maxStrokes).ToList();
|
//return AllArtists.Where(artist => artist.Strokes >= minStrokes && artist.Strokes <= maxStrokes).ToList();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string query = $"SELECT * FROM ArtistLibrary WHERE 歌手分類 = '{category}' AND 歌手筆畫 >= {minStrokes} AND 歌手筆畫 <={maxStrokes}";
|
string query = $"SELECT * FROM artists WHERE category = '{category}' AND strokes_abbr >= {minStrokes} AND strokes_abbr <={maxStrokes};";
|
||||||
var searchResults = PrimaryForm.SearchSingers_Mysql(query);
|
var searchResults = PrimaryForm.SearchSingers_Mysql(query);
|
||||||
return searchResults;
|
return searchResults;
|
||||||
//return AllArtists.Where(artist => artist.Category == category && artist.Strokes >= minStrokes && artist.Strokes <= maxStrokes).ToList();
|
//return AllArtists.Where(artist => artist.Category == category && artist.Strokes >= minStrokes && artist.Strokes <= maxStrokes).ToList();
|
||||||
|
@ -51,28 +51,28 @@ namespace DBObj
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
public List<SongData> SearchNewSongs(){
|
public List<SongData> SearchNewSongs(){
|
||||||
string query= $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY add_date DESC LIMIT {PrimaryForm.ReadNewSongLimit()}";
|
string query= $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY add_date DESC LIMIT {PrimaryForm.ReadNewSongLimit()};";
|
||||||
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 add_date DESC LIMIT {PrimaryForm.ReadHotSongLimit()}";
|
string query= $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY song_conts 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)
|
||||||
{
|
{
|
||||||
Console.WriteLine("keyword : " + keyword);
|
Console.WriteLine("keyword : " + keyword);
|
||||||
var keywordLower = keyword.ToLower();
|
var keywordLower = keyword.ToLower();
|
||||||
string query = $"SELECT * FROM song_library_cache WHERE artistA LIKE '%{keywordLower}%' OR artistB LIKE'%{keywordLower}%'";
|
string query = $"SELECT * FROM song_library_cache WHERE artistA LIKE '%{keywordLower}%' OR artistB LIKE'%{keywordLower}%'ORDER BY song_counts DESC;";
|
||||||
return PrimaryForm.Instance.SearchSongs_Mysql(query);
|
return PrimaryForm.Instance.SearchSongs_Mysql(query);
|
||||||
}
|
}
|
||||||
public List<SongData> SearchSongsByName(string keyword)
|
public List<SongData> SearchSongsByName(string keyword)
|
||||||
{
|
{
|
||||||
string query = $"SELECT * FROM song_library_cache WHERE LOWER(song_name) LIKE CONCAT('%', LOWER('{keyword}'), '%')";
|
string query = $"SELECT * FROM song_library_cache WHERE LOWER(song_name) LIKE CONCAT('%', LOWER('{keyword}'), '%');";
|
||||||
return PrimaryForm.Instance.SearchSongs_Mysql(query);
|
return PrimaryForm.Instance.SearchSongs_Mysql(query);
|
||||||
}
|
}
|
||||||
public SongData SearchSongByNumber(string songNumber)
|
public SongData SearchSongByNumber(string songNumber)
|
||||||
{
|
{
|
||||||
string query = $"SELECT * FROM song_library_cache WHERE song_id = {songNumber}";
|
string query = $"SELECT * FROM song_library_cache WHERE song_id = '{songNumber}';";
|
||||||
var searchResults =PrimaryForm.Instance.SearchSongs_Mysql(query);
|
var searchResults =PrimaryForm.Instance.SearchSongs_Mysql(query);
|
||||||
return searchResults.FirstOrDefault();
|
return searchResults.FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
@ -1,39 +1,146 @@
|
|||||||
|
using System.Net.Http;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.Json; // 適用於 .NET Core 3.0+ / .NET 5/6/7/8
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Text;
|
using System.Diagnostics;
|
||||||
using System.Timers;
|
using System.IO;
|
||||||
namespace HeartbeatSender{
|
using Microsoft.VisualBasic.Devices;
|
||||||
|
|
||||||
|
namespace HeartbeatSender
|
||||||
|
{
|
||||||
|
|
||||||
public class heartbeatSender
|
public class heartbeatSender
|
||||||
{
|
{
|
||||||
private readonly UdpClient udpClient;
|
private readonly HttpClient httpClient = new HttpClient();
|
||||||
private readonly IPEndPoint remoteEndPoint;
|
private string token;
|
||||||
private readonly System.Timers.Timer heartbeatTimer;
|
private string heartbeatUrl;
|
||||||
public IPEndPoint RemoteEndPoint => remoteEndPoint;
|
|
||||||
public heartbeatSender(string targetIp, int targetPort, int intervalMilliseconds = 3000)
|
public heartbeatSender(string heartbeatUrl)
|
||||||
{
|
{
|
||||||
udpClient = new UdpClient();
|
this.heartbeatUrl = heartbeatUrl;
|
||||||
// 設置 IP 和 PORT
|
|
||||||
remoteEndPoint = new IPEndPoint(IPAddress.Parse(targetIp), targetPort);
|
|
||||||
// 每3秒發送一次
|
|
||||||
heartbeatTimer = new System.Timers.Timer(intervalMilliseconds);
|
|
||||||
heartbeatTimer.Elapsed += SendHeartbeat;
|
|
||||||
heartbeatTimer.AutoReset = true;
|
|
||||||
}
|
}
|
||||||
private void SendHeartbeat(object sender, ElapsedEventArgs e)
|
public static string GetLocalIPv4()
|
||||||
{
|
{
|
||||||
|
foreach (var ip in Dns.GetHostEntry(Dns.GetHostName()).AddressList)
|
||||||
|
{
|
||||||
|
if (ip.AddressFamily == AddressFamily.InterNetwork && !IPAddress.IsLoopback(ip))
|
||||||
|
{
|
||||||
|
return ip.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "127.0.0.1"; // fallback
|
||||||
|
}
|
||||||
|
public async Task<bool> LoginAndGetTokenAsync()
|
||||||
|
{
|
||||||
|
var loginUrl = "http://zqd.superstar.dnsnet.cc/api/room/receiveRegister";
|
||||||
|
string hostName = System.Net.Dns.GetHostName();
|
||||||
|
|
||||||
|
var loginPayload = new
|
||||||
|
{
|
||||||
|
branch_name = "測試",
|
||||||
|
room_name = "PC" + hostName.Substring(Math.Max(0, hostName.Length - 3)),
|
||||||
|
room_ip = GetLocalIPv4(),
|
||||||
|
email = "MachineKTV@gmail.com",
|
||||||
|
password = "aa147258-"
|
||||||
|
};
|
||||||
|
|
||||||
|
var json = JsonSerializer.Serialize(loginPayload);
|
||||||
|
var content = new StringContent(json, Encoding.UTF8, "application/json");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string heartbeatMessage = "HEARTBEAT";
|
var response = await httpClient.PostAsync(loginUrl, content);
|
||||||
byte[] data = Encoding.UTF8.GetBytes(heartbeatMessage);
|
response.EnsureSuccessStatusCode();
|
||||||
udpClient.Send(data, data.Length, remoteEndPoint);
|
|
||||||
Console.WriteLine($"Heartbeat sent to {remoteEndPoint.Address}:{remoteEndPoint.Port}");
|
var responseJson = await response.Content.ReadAsStringAsync();
|
||||||
|
// Console.WriteLine("API 回傳內容:" + responseJson);
|
||||||
|
|
||||||
|
using var doc = JsonDocument.Parse(responseJson);
|
||||||
|
if (doc.RootElement.TryGetProperty("data", out JsonElement dataElement) &&
|
||||||
|
dataElement.ValueKind == JsonValueKind.Object)
|
||||||
|
{
|
||||||
|
if (dataElement.TryGetProperty("token", out JsonElement tokenElement))
|
||||||
|
{
|
||||||
|
token = tokenElement.GetString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Console.WriteLine("登入成功,取得 token:" + token);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Error sending heartbeat: {ex.Message}");
|
Console.WriteLine($"登入失敗:{ex.Message}");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void Start() => heartbeatTimer.Start();
|
|
||||||
public void Stop() => heartbeatTimer.Stop();
|
public async Task SendHeartbeatAsync()
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(token))
|
||||||
|
{
|
||||||
|
Console.WriteLine("請先登入取得 token");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//Console.WriteLine(GetLocalIPv4());
|
||||||
|
string hostName = System.Net.Dns.GetHostName();
|
||||||
|
|
||||||
|
var heartbeatData = new
|
||||||
|
{
|
||||||
|
branch_name = "測試",
|
||||||
|
hostname = "PC" + hostName.Substring(Math.Max(0, hostName.Length - 3)),
|
||||||
|
ip = GetLocalIPv4(),
|
||||||
|
cpu = GetCpuUsage(),
|
||||||
|
memory = GetTotalMemoryInMB(),
|
||||||
|
disk = GetDiskTotalSizeInGB()
|
||||||
|
};
|
||||||
|
|
||||||
|
var json = JsonSerializer.Serialize(heartbeatData);
|
||||||
|
var content = new StringContent(json, Encoding.UTF8, "application/json");
|
||||||
|
heartbeatUrl = "http://zqd.superstar.dnsnet.cc/api/room/heartbeat";
|
||||||
|
var request = new HttpRequestMessage(HttpMethod.Post, heartbeatUrl);
|
||||||
|
request.Content = content;
|
||||||
|
request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token);
|
||||||
|
// Console.WriteLine("送出的 JSON:");
|
||||||
|
// Console.WriteLine(json);
|
||||||
|
var response = await httpClient.SendAsync(request);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
// Console.WriteLine($"心跳送出狀態:{response.StatusCode}");
|
||||||
|
|
||||||
|
response.EnsureSuccessStatusCode();
|
||||||
|
|
||||||
|
var responseJson = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
|
using var doc = JsonDocument.Parse(responseJson);
|
||||||
|
// Console.WriteLine("API 回傳內容:" + responseJson);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
var errorContent = await response.Content.ReadAsStringAsync();
|
||||||
|
Console.WriteLine($"送出心跳錯誤:{ex.Message}");
|
||||||
|
Console.WriteLine($"後端回應內容:{errorContent}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private float GetCpuUsage()
|
||||||
|
{
|
||||||
|
using var cpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");
|
||||||
|
cpuCounter.NextValue(); // 需要呼叫兩次
|
||||||
|
System.Threading.Thread.Sleep(100);
|
||||||
|
return cpuCounter.NextValue(); // 回傳的是百分比,例如 25.3
|
||||||
|
}
|
||||||
|
private float GetTotalMemoryInMB()
|
||||||
|
{
|
||||||
|
var computerInfo = new ComputerInfo();
|
||||||
|
return computerInfo.TotalPhysicalMemory / (1024f * 1024f); // 轉 MB
|
||||||
|
}
|
||||||
|
private float GetDiskTotalSizeInGB(string driveLetter = "C")
|
||||||
|
{
|
||||||
|
var drive = new DriveInfo(driveLetter);
|
||||||
|
return drive.TotalSize / (1024f * 1024f * 1024f); // 轉 GB
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ namespace DualScreenDemo
|
|||||||
string externalQrContent = !string.IsNullOrEmpty(externalAddress) ?
|
string externalQrContent = !string.IsNullOrEmpty(externalAddress) ?
|
||||||
String.Format("http://{0}:{1}/{2}/windows.html", externalAddress, externalPort, randomFolderName) :
|
String.Format("http://{0}:{1}/{2}/windows.html", externalAddress, externalPort, randomFolderName) :
|
||||||
localQrContent;
|
localQrContent;
|
||||||
|
|
||||||
GenerateQRCode(externalQrContent, Path.Combine(baseDirectory, randomFolderName, "qrcode.png"));
|
GenerateQRCode(externalQrContent, Path.Combine(baseDirectory, randomFolderName, "qrcode.png"));
|
||||||
|
|
||||||
_qrReadyTcs?.TrySetResult(randomFolderName); // safe call,null-safe
|
_qrReadyTcs?.TrySetResult(randomFolderName); // safe call,null-safe
|
||||||
|
@ -474,56 +474,48 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
|||||||
|
|
||||||
|
|
||||||
private readonly object _lockObject = new object();
|
private readonly object _lockObject = new object();
|
||||||
|
private bool _handlingTimeout = false;
|
||||||
private async void UnifiedTimer_Elapsed(object sender, EventArgs e)
|
private async void UnifiedTimer_Elapsed(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
// Console.WriteLine("UnifiedTimer_Elapsed called");
|
if (_handlingTimeout) return;
|
||||||
|
_handlingTimeout = true;
|
||||||
|
|
||||||
if (MainForm.InvokeRequired)
|
try
|
||||||
{
|
|
||||||
MainForm.Invoke(new System.Action<object, EventArgs>(UnifiedTimer_Elapsed), new object[] { sender, e });
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
displayLabel.Text = "";
|
|
||||||
|
|
||||||
switch (CurrentUIState)
|
|
||||||
{
|
{
|
||||||
case UIState.SelectingLanguage:
|
if (MainForm.InvokeRequired)
|
||||||
|
{
|
||||||
SetUIState(UIState.Initial);
|
MainForm.BeginInvoke((Action)(() => UnifiedTimer_Elapsed(sender, e)));
|
||||||
await HandleTimeout("");
|
return;
|
||||||
break;
|
}
|
||||||
case UIState.SelectingArtistCategory:
|
|
||||||
SetUIState(UIState.Initial);
|
displayLabel.Text = "";
|
||||||
await HandleTimeout("");
|
|
||||||
break;
|
switch (CurrentUIState)
|
||||||
case UIState.SelectingAction:
|
{
|
||||||
SetUIState(UIState.Initial);
|
case UIState.SelectingLanguage:
|
||||||
await HandleTimeout("");
|
case UIState.SelectingArtistCategory:
|
||||||
break;
|
case UIState.SelectingAction:
|
||||||
case UIState.SelectingSong:
|
case UIState.SelectingSong:
|
||||||
|
case UIState.SelectingArtist:
|
||||||
SetUIState(UIState.Initial);
|
case UIState.PlayHistory:
|
||||||
await HandleTimeout("");
|
SetUIState(UIState.Initial);
|
||||||
break;
|
await HandleTimeout("");
|
||||||
case UIState.SelectingArtist:
|
break;
|
||||||
SetUIState(UIState.Initial);
|
}
|
||||||
await HandleTimeout("");
|
}
|
||||||
break;
|
finally
|
||||||
case UIState.PlayHistory:
|
{
|
||||||
SetUIState(UIState.Initial);
|
_handlingTimeout = false;
|
||||||
await HandleTimeout("");
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task HandleTimeout(string message)
|
private async Task HandleTimeout(string message)
|
||||||
{
|
{
|
||||||
Console.WriteLine("HandleTimeout called with message: " + message);
|
Console.WriteLine("HandleTimeout called with message: " + message);
|
||||||
|
unifiedTimer.Stop();
|
||||||
SetUIState(UIState.Initial);
|
SetUIState(UIState.Initial);
|
||||||
DisplayMessage(message, 2000);
|
//DisplayMessage(message, 2000);
|
||||||
|
CommandHandler._indataHistory.Clear(); // 清空歷史紀錄
|
||||||
await Task.Delay(2000);
|
await Task.Delay(2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -807,7 +799,6 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
|||||||
|
|
||||||
public static string ReadSongNumber()
|
public static string ReadSongNumber()
|
||||||
{
|
{
|
||||||
|
|
||||||
string songNumber = MainForm.displayLabel.Text;
|
string songNumber = MainForm.displayLabel.Text;
|
||||||
MainForm.nextSongLabel.Visible = false;
|
MainForm.nextSongLabel.Visible = false;
|
||||||
return songNumber;
|
return songNumber;
|
||||||
@ -880,10 +871,11 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
|||||||
control != MainForm.dynamicLabel &&
|
control != MainForm.dynamicLabel &&
|
||||||
control != MainForm.tintLabel &&
|
control != MainForm.tintLabel &&
|
||||||
control != MainForm.blackBackgroundPanel &&
|
control != MainForm.blackBackgroundPanel &&
|
||||||
control != MainForm.nextSongLabel)
|
control != MainForm.nextSongLabel)
|
||||||
{
|
{
|
||||||
MainForm.Controls.Remove(control);
|
MainForm.Controls.Remove(control);
|
||||||
control.Dispose();
|
// control.Dispose();
|
||||||
|
control.Visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1012,7 +1004,7 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
|||||||
if (songIndex >= 0 && songIndex < totalSongs)
|
if (songIndex >= 0 && songIndex < totalSongs)
|
||||||
{
|
{
|
||||||
selectedSong = LanguageSongList[songIndex];
|
selectedSong = LanguageSongList[songIndex];
|
||||||
Console.WriteLine("Adding song to playlist: " + LanguageSongList[songIndex].Song);
|
Console.WriteLine("Adding song to playlist: " + LanguageSongList[songIndex].Song + " " + selectedSong.SongFilePathHost1);
|
||||||
|
|
||||||
|
|
||||||
// DisplayActionWithSong(currentPage, songIndex, "點播");
|
// DisplayActionWithSong(currentPage, songIndex, "點播");
|
||||||
@ -1044,7 +1036,7 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
|||||||
if (songIndex < totalSongs)
|
if (songIndex < totalSongs)
|
||||||
{
|
{
|
||||||
selectedSong = LanguageSongList[songIndex];
|
selectedSong = LanguageSongList[songIndex];
|
||||||
Console.WriteLine("Adding song to playlist: " + LanguageSongList[songIndex].Song);
|
Console.WriteLine("Adding song to playlist: " + LanguageSongList[songIndex].Song + " " + selectedSong.SongFilePathHost1 );
|
||||||
|
|
||||||
|
|
||||||
// DisplayActionWithSong(currentPage, songIndex, "插播");
|
// DisplayActionWithSong(currentPage, songIndex, "插播");
|
||||||
@ -1105,7 +1097,7 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
|||||||
selectedArtist = currentArtistList[artistIndex];
|
selectedArtist = currentArtistList[artistIndex];
|
||||||
currentLanguage = selectedArtist.Name;
|
currentLanguage = selectedArtist.Name;
|
||||||
SetUIState(UIState.SelectingSong);
|
SetUIState(UIState.SelectingSong);
|
||||||
string query = $"SELECT * FROM song_library_cache WHERE artistA ='{selectedArtist.Name}' OR artistB='{selectedArtist.Name}' ";
|
string query = $"SELECT * FROM song_library_cache WHERE artistA ='{selectedArtist.Name}' OR artistB='{selectedArtist.Name}' ORDER BY song_counts DESC;";
|
||||||
LanguageSongList = PrimaryForm.Instance.SearchSongs_Mysql(query);
|
LanguageSongList = PrimaryForm.Instance.SearchSongs_Mysql(query);
|
||||||
//LanguageSongList = SongListManager.Instance.GetSongsByArtist(selectedArtist.Name);
|
//LanguageSongList = SongListManager.Instance.GetSongsByArtist(selectedArtist.Name);
|
||||||
currentPage = 1;
|
currentPage = 1;
|
||||||
@ -1127,11 +1119,12 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
|||||||
|
|
||||||
if (songIndex < totalSongs)
|
if (songIndex < totalSongs)
|
||||||
{
|
{
|
||||||
selectedSong = LanguageSongList[songIndex];
|
selectedSong = LanguageSongList[songIndex];
|
||||||
Console.WriteLine("Adding song to playlist: " + LanguageSongList[songIndex].Song);
|
Console.WriteLine("Adding song to playlist C: " + LanguageSongList[songIndex].Song + " " + selectedSong.SongFilePathHost1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DisplaySongsWithArrows(currentPage, songIndex);
|
DisplaySongsWithArrows(currentPage, songIndex);
|
||||||
|
//AddSongToPlaylist(selectedSong);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1280,7 +1273,9 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 計算目前這首歌的 Y 座標位置
|
// 計算目前這首歌的 Y 座標位置
|
||||||
int y = startY + i * (songBitmap.Height + verticalSpacing);
|
int fixedRowHeight = 80;
|
||||||
|
int y = startY + i * (fixedRowHeight + verticalSpacing);
|
||||||
|
//int y = startY + i * (songBitmap.Height + verticalSpacing);
|
||||||
|
|
||||||
// 加入歌名圖片到畫面左側
|
// 加入歌名圖片到畫面左側
|
||||||
AddPicture(songBitmap, leftMargin, y);
|
AddPicture(songBitmap, leftMargin, y);
|
||||||
@ -1295,47 +1290,65 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
|||||||
}
|
}
|
||||||
public void UpdateDisplayLabels(string[] messages)//新歌歌星排行首頁
|
public void UpdateDisplayLabels(string[] messages)//新歌歌星排行首頁
|
||||||
{
|
{
|
||||||
// 清除舊的圖片控件
|
// 移除畫面上現有的所有 PictureBox(舊的文字圖片)
|
||||||
this.Controls.OfType<PictureBox>().ToList().ForEach(p => this.Controls.Remove(p));
|
this.Controls.OfType<PictureBox>().ToList().ForEach(p => this.Controls.Remove(p));
|
||||||
|
|
||||||
|
// 如果沒有訊息內容,直接跳出,不進行後續繪製
|
||||||
if (messages.Length == 0) return;
|
if (messages.Length == 0) return;
|
||||||
|
|
||||||
int mainTitleFontSize = 60;
|
// 設定主標題字體大小
|
||||||
int optionFontSize = 50;
|
int mainTitleFontSize = 60;
|
||||||
int lineSpacing = 15;
|
// 設定選項字體大小
|
||||||
//int columnSpacing = 400;
|
int optionFontSize = 50;
|
||||||
|
// 每行之間的垂直間距(像素)
|
||||||
|
int lineSpacing = 15;
|
||||||
|
|
||||||
// 主標題
|
// 取得主標題文字(第一行)
|
||||||
string mainTitle = messages[0];
|
string mainTitle = messages[0];
|
||||||
|
// 建立主標題用的字型:微軟正黑體、粗體
|
||||||
Font mainTitleFont = new Font("Microsoft JhengHei", mainTitleFontSize, FontStyle.Bold);
|
Font mainTitleFont = new Font("Microsoft JhengHei", mainTitleFontSize, FontStyle.Bold);
|
||||||
|
// 使用自定義方法產生主標題的文字圖像(白色字+透明底)
|
||||||
Bitmap mainTitleBitmap = GenerateTextImage(mainTitle, mainTitleFont, Color.White, Color.Transparent);
|
Bitmap mainTitleBitmap = GenerateTextImage(mainTitle, mainTitleFont, Color.White, Color.Transparent);
|
||||||
|
// 主標題起始的 Y 座標
|
||||||
int startY = 130;
|
int startY = 130;
|
||||||
|
// 將主標題圖片水平置中並加入畫面
|
||||||
AddCenteredPicture(mainTitleBitmap, startY);
|
AddCenteredPicture(mainTitleBitmap, startY);
|
||||||
|
// 更新 Y 座標位置,準備繪製下一區塊(選項),加上主標題高度與間距
|
||||||
startY += mainTitleBitmap.Height + lineSpacing;
|
startY += mainTitleBitmap.Height + lineSpacing;
|
||||||
|
|
||||||
// 選項
|
// 取得剩下的訊息文字(第二行起):當作選項
|
||||||
string[] options = messages.Skip(1).ToArray();
|
string[] options = messages.Skip(1).ToArray();
|
||||||
|
// 選項的起始 Y 座標
|
||||||
int optionsStartY = startY;
|
int optionsStartY = startY;
|
||||||
|
// 每欄最多可放幾個項目(以兩欄平均分配)
|
||||||
int maxItemsPerColumn = (int)Math.Ceiling(options.Length / 2.0);
|
int maxItemsPerColumn = (int)Math.Ceiling(options.Length / 2.0);
|
||||||
|
|
||||||
int leftColumnX = 200;
|
// 設定左右欄的 X 座標(用於放置圖片)
|
||||||
|
int leftColumnX = 200;
|
||||||
int rightColumnX = this.Width / 2 + 150;
|
int rightColumnX = this.Width / 2 + 150;
|
||||||
|
|
||||||
|
// 開始逐一處理每個選項
|
||||||
for (int i = 0; i < options.Length; i++)
|
for (int i = 0; i < options.Length; i++)
|
||||||
{
|
{
|
||||||
|
// 設定每個選項的字型
|
||||||
Font optionFont = new Font("Microsoft JhengHei", optionFontSize, FontStyle.Bold);
|
Font optionFont = new Font("Microsoft JhengHei", optionFontSize, FontStyle.Bold);
|
||||||
|
// 建立文字對應的圖像(白色字+透明底)
|
||||||
Bitmap optionBitmap = GenerateTextImage(options[i], optionFont, Color.White, Color.Transparent);
|
Bitmap optionBitmap = GenerateTextImage(options[i], optionFont, Color.White, Color.Transparent);
|
||||||
|
|
||||||
|
// 根據目前索引,決定放在左欄還是右欄
|
||||||
int x = (i < maxItemsPerColumn) ? leftColumnX : rightColumnX;
|
int x = (i < maxItemsPerColumn) ? leftColumnX : rightColumnX;
|
||||||
|
// 決定目前這張圖的 Y 座標位置(依序向下排列)
|
||||||
int currentY = optionsStartY + ((i % maxItemsPerColumn) * (optionBitmap.Height + lineSpacing));
|
int currentY = optionsStartY + ((i % maxItemsPerColumn) * (optionBitmap.Height + lineSpacing));
|
||||||
|
|
||||||
|
// 加入圖片到畫面上
|
||||||
AddPicture(optionBitmap, x, currentY);
|
AddPicture(optionBitmap, x, currentY);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private string strokeRange;
|
private string strokeRange;
|
||||||
private int totalArtists = 0;
|
private int totalArtists = 0;
|
||||||
private const int artistsPerPage = 10;
|
private const int artistsPerPage = 8;
|
||||||
private List<Artist> currentArtistList = new List<Artist>();
|
private List<Artist> currentArtistList = new List<Artist>();
|
||||||
|
|
||||||
private void ProcessStrokeCountSelection(int number)
|
private void ProcessStrokeCountSelection(int number)
|
||||||
@ -1393,7 +1406,7 @@ private void DisplayArtists(List<Artist> artists, int page)//歌星點進去後
|
|||||||
|
|
||||||
this.Controls.OfType<PictureBox>().ToList().ForEach(p => this.Controls.Remove(p));
|
this.Controls.OfType<PictureBox>().ToList().ForEach(p => this.Controls.Remove(p));
|
||||||
|
|
||||||
int artistsPerColumn = 5;
|
int artistsPerColumn = 4;
|
||||||
int startIndex = (page - 1) * artistsPerPage;
|
int startIndex = (page - 1) * artistsPerPage;
|
||||||
int endIndex = Math.Min(startIndex + artistsPerPage, artists.Count);
|
int endIndex = Math.Min(startIndex + artistsPerPage, artists.Count);
|
||||||
|
|
||||||
@ -1482,11 +1495,11 @@ private void DisplayArtists(List<Artist> artists, int page)//歌星點進去後
|
|||||||
|
|
||||||
if (category == Category.NewSongs)
|
if (category == Category.NewSongs)
|
||||||
{
|
{
|
||||||
sqlQuery = $"SELECT * FROM song_library_cache WHERE language_name = '{language}' ORDER BY add_date DESC LIMIT {PrimaryForm.ReadNewSongLimit()}";
|
sqlQuery = $"SELECT * FROM song_library_cache WHERE language_name = '{language}' ORDER BY add_date DESC LIMIT {PrimaryForm.ReadNewSongLimit()};";
|
||||||
}
|
}
|
||||||
else if (category == Category.HotSongs)
|
else if (category == Category.HotSongs)
|
||||||
{
|
{
|
||||||
sqlQuery = $"SELECT * FROM song_library_cache WHERE language_name = '{language}' ORDER BY add_date DESC LIMIT {PrimaryForm.ReadHotSongLimit()}";
|
sqlQuery = $"SELECT * FROM song_library_cache WHERE language_name = '{language}' ORDER BY song_counts DESC LIMIT {PrimaryForm.ReadHotSongLimit()};";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1643,7 +1656,7 @@ private void DisplayArtists(List<Artist> artists, int page)//歌星點進去後
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 測試
|
||||||
public int currentPage = 1;
|
public int currentPage = 1;
|
||||||
public int songsPerPage = 5;
|
public int songsPerPage = 5;
|
||||||
public int totalSongs = 0;
|
public int totalSongs = 0;
|
||||||
|
@ -254,7 +254,7 @@ namespace DualScreenDemo
|
|||||||
}
|
}
|
||||||
|
|
||||||
private string SetQueryforSQL(string contains){
|
private string SetQueryforSQL(string contains){
|
||||||
string query = $"SELECT * FROM song_library_cache WHERE situations LIKE '%{contains}%' ORDER BY `song_id` DESC";
|
string query = $"SELECT * FROM song_library_cache WHERE song_category LIKE '%{contains}%' ORDER BY `song_id` DESC;";
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ namespace DualScreenDemo
|
|||||||
/*guoYuSongs = allSongs.Where(song => song.Category == "國語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
|
/*guoYuSongs = allSongs.Where(song => song.Category == "國語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
|
||||||
.OrderByDescending(song => song.Plays)
|
.OrderByDescending(song => song.Plays)
|
||||||
.ToList();*/
|
.ToList();*/
|
||||||
string query = "SELECT * FROM song_library_cache WHERE language_name = '國語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_id DESC";
|
string query = "SELECT * FROM song_library_cache WHERE language_name = '國語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_id DESC;";
|
||||||
var guoYuSongs = SearchSongs_Mysql(query);
|
var guoYuSongs = SearchSongs_Mysql(query);
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
currentSongList = guoYuSongs;
|
currentSongList = guoYuSongs;
|
||||||
|
@ -14,7 +14,7 @@ namespace DualScreenDemo
|
|||||||
/*hanYuSongs = allSongs.Where(song => song.Category == "韓語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
|
/*hanYuSongs = allSongs.Where(song => song.Category == "韓語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
|
||||||
.OrderByDescending(song => song.Plays)
|
.OrderByDescending(song => song.Plays)
|
||||||
.ToList();*/
|
.ToList();*/
|
||||||
string query = "SELECT * FROM song_library_cache WHERE language_name = '韓語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_id DESC";
|
string query = "SELECT * FROM song_library_cache WHERE language_name = '韓語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_id DESC;";
|
||||||
var hanYuSongs = SearchSongs_Mysql(query);
|
var hanYuSongs = SearchSongs_Mysql(query);
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
currentSongList = hanYuSongs;
|
currentSongList = hanYuSongs;
|
||||||
|
@ -15,7 +15,7 @@ namespace DualScreenDemo
|
|||||||
.OrderByDescending(song => song.Plays)
|
.OrderByDescending(song => song.Plays)
|
||||||
.ToList();*/
|
.ToList();*/
|
||||||
|
|
||||||
string query = "SELECT * FROM song_library_cache WHERE language_name = '日語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_id DESC";
|
string query = "SELECT * FROM song_library_cache WHERE language_name = '日語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_id DESC;";
|
||||||
var riYuSongs = SearchSongs_Mysql(query);
|
var riYuSongs = SearchSongs_Mysql(query);
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
currentSongList = riYuSongs;
|
currentSongList = riYuSongs;
|
||||||
|
@ -14,7 +14,7 @@ namespace DualScreenDemo
|
|||||||
/*taiYuSongs = allSongs.Where(song => song.Category == "台語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
|
/*taiYuSongs = allSongs.Where(song => song.Category == "台語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
|
||||||
.OrderByDescending(song => song.Plays)
|
.OrderByDescending(song => song.Plays)
|
||||||
.ToList();*/
|
.ToList();*/
|
||||||
string query = "SELECT * FROM song_library_cache WHERE language_name = '台語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_id DESC";
|
string query = "SELECT * FROM song_library_cache WHERE language_name = '台語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_id DESC;";
|
||||||
var taiYuSongs = SearchSongs_Mysql(query);
|
var taiYuSongs = SearchSongs_Mysql(query);
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
currentSongList = taiYuSongs;
|
currentSongList = taiYuSongs;
|
||||||
|
@ -14,7 +14,7 @@ namespace DualScreenDemo
|
|||||||
/*yingWenSongs = allSongs.Where(song => song.Category == "英語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
|
/*yingWenSongs = allSongs.Where(song => song.Category == "英語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
|
||||||
.OrderByDescending(song => song.Plays)
|
.OrderByDescending(song => song.Plays)
|
||||||
.ToList();*/
|
.ToList();*/
|
||||||
string query = "SELECT * FROM song_library_cache WHERE language_name = '英語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_id DESC";
|
string query = "SELECT * FROM song_library_cache WHERE language_name = '英語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_id DESC;";
|
||||||
var yingWenSongs = SearchSongs_Mysql(query);
|
var yingWenSongs = SearchSongs_Mysql(query);
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
currentSongList = yingWenSongs;
|
currentSongList = yingWenSongs;
|
||||||
|
@ -15,7 +15,7 @@ namespace DualScreenDemo
|
|||||||
.OrderByDescending(song => song.Plays)
|
.OrderByDescending(song => song.Plays)
|
||||||
.ToList();*/
|
.ToList();*/
|
||||||
|
|
||||||
string query = "SELECT * FROM song_library_cache WHERE language_name = '粵語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_id DESC";
|
string query = "SELECT * FROM song_library_cache WHERE language_name = '粵語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_id DESC;";
|
||||||
var yueYuSongs = SearchSongs_Mysql(query);
|
var yueYuSongs = SearchSongs_Mysql(query);
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
currentSongList = yueYuSongs;
|
currentSongList = yueYuSongs;
|
||||||
|
@ -133,7 +133,7 @@ namespace DualScreenDemo
|
|||||||
.ToList();*/
|
.ToList();*/
|
||||||
/* 清空搜尋欄 */
|
/* 清空搜尋欄 */
|
||||||
ResetinputBox();
|
ResetinputBox();
|
||||||
string query = "SELECT * FROM song_library_cache WHERE language_name = '國語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_id DESC";
|
string query = "SELECT * FROM song_library_cache WHERE language_name = '國語' AND (`artistA_category` = '團' OR `artistB_category` = '團') ORDER BY song_id DESC;";
|
||||||
var guoYuSongs = SearchSongs_Mysql(query);
|
var guoYuSongs = SearchSongs_Mysql(query);
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
currentSongList = guoYuSongs;
|
currentSongList = guoYuSongs;
|
||||||
|
@ -63,12 +63,12 @@ namespace DualScreenDemo
|
|||||||
/* 清空搜尋欄 */
|
/* 清空搜尋欄 */
|
||||||
ResetinputBox();
|
ResetinputBox();
|
||||||
int songLimit = ReadHotSongLimit();
|
int songLimit = ReadHotSongLimit();
|
||||||
string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY `song_counts` DESC LIMIT {songLimit}";
|
string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY `song_counts` DESC LIMIT {songLimit};";
|
||||||
var guoYuSongs = SearchSongs_Mysql(query);
|
var guoYuSongs = SearchSongs_Mysql(query);
|
||||||
UpdateSongList(guoYuSongs);
|
UpdateSongList(guoYuSongs);
|
||||||
|
|
||||||
SetButtonsVisibility();
|
SetButtonsVisibility();
|
||||||
HideQRCode();
|
//HideQRCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateButtonBackgrounds(Button activeButton, Image activeBackground)
|
private void UpdateButtonBackgrounds(Button activeButton, Image activeBackground)
|
||||||
@ -92,7 +92,7 @@ namespace DualScreenDemo
|
|||||||
UpdateHotSongButtons(activeButton, activeBackground);
|
UpdateHotSongButtons(activeButton, activeBackground);
|
||||||
|
|
||||||
int songLimit = ReadHotSongLimit();
|
int songLimit = ReadHotSongLimit();
|
||||||
string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY `song_counts` DESC LIMIT {songLimit}";
|
string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY `song_counts` DESC LIMIT {songLimit};";
|
||||||
var selectedSongs = SearchSongs_Mysql(query);
|
var selectedSongs = SearchSongs_Mysql(query);
|
||||||
|
|
||||||
UpdateSongList(selectedSongs);
|
UpdateSongList(selectedSongs);
|
||||||
|
@ -8,7 +8,7 @@ namespace DualScreenDemo
|
|||||||
UpdateHotSongButtons(guoYuNewSongButtonHotSong, guoYuNewSongHotSongActiveBackground);
|
UpdateHotSongButtons(guoYuNewSongButtonHotSong, guoYuNewSongHotSongActiveBackground);
|
||||||
|
|
||||||
int songLimit = ReadHotSongLimit();
|
int songLimit = ReadHotSongLimit();
|
||||||
string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY `add_date` DESC, `song_counts` DESC LIMIT {songLimit}";
|
string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' ORDER BY `add_date` DESC, `song_counts` DESC LIMIT {songLimit};";
|
||||||
var selectedSongs = PrimaryForm.Instance.SearchSongs_Mysql(query);
|
var selectedSongs = PrimaryForm.Instance.SearchSongs_Mysql(query);
|
||||||
|
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
|
@ -9,7 +9,7 @@ namespace DualScreenDemo
|
|||||||
|
|
||||||
int songLimit = ReadHotSongLimit();
|
int songLimit = ReadHotSongLimit();
|
||||||
|
|
||||||
string query = $"SELECT * FROM song_library_cache WHERE language_name = '台語' ORDER BY `add_date` DESC, `song_counts` DESC LIMIT {songLimit}";
|
string query = $"SELECT * FROM song_library_cache WHERE language_name = '台語' ORDER BY `add_date` DESC, `song_counts` DESC LIMIT {songLimit};";
|
||||||
var selectedSongs = SearchSongs_Mysql(query);
|
var selectedSongs = SearchSongs_Mysql(query);
|
||||||
|
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
|
@ -252,7 +252,7 @@ namespace DualScreenDemo
|
|||||||
return 100;
|
return 100;
|
||||||
}
|
}
|
||||||
private string setQueryforNewSong(string category){
|
private string setQueryforNewSong(string category){
|
||||||
string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY add_date DESC LIMIT {ReadNewSongLimit()}";
|
string query = $"SELECT * FROM song_library_cache WHERE language_name = '{category}' ORDER BY add_date DESC LIMIT {ReadNewSongLimit()};";
|
||||||
|
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
@ -239,8 +239,8 @@ namespace DualScreenDemo
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
showError = true;
|
showError = true;
|
||||||
isPhoneNumberValid = true;
|
isPhoneNumberValid = false;
|
||||||
FavoritePictureBox.Invalidate();
|
FavoritePictureBox.Invalidate();
|
||||||
FavoritePictureBox.Refresh();
|
FavoritePictureBox.Refresh();
|
||||||
}
|
}
|
||||||
@ -254,7 +254,7 @@ namespace DualScreenDemo
|
|||||||
if (checkPhoneNumberExist(mobileNumber))
|
if (checkPhoneNumberExist(mobileNumber))
|
||||||
{
|
{
|
||||||
isPhoneNumberValid = true;
|
isPhoneNumberValid = true;
|
||||||
var searchResults = SearchSongs_Mysql(SearchFavoriteSongs_Mysql());
|
var searchResults = SearchSongs_Mysql(SearchFavoriteSongs_Mysql());
|
||||||
// 重置分頁
|
// 重置分頁
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
currentSongList = searchResults;
|
currentSongList = searchResults;
|
||||||
@ -267,22 +267,35 @@ namespace DualScreenDemo
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*isPhoneNumberValid = true;
|
isPhoneNumberValid = true;
|
||||||
SongListManager.Instance.AddNewUser(mobileNumber);
|
InsertNewFavoriteUser(mobileNumber);
|
||||||
SongListManager.Instance.UserLogin(mobileNumber);
|
if (checkPhoneNumberExist(mobileNumber))
|
||||||
|
{
|
||||||
|
var searchResults = SearchSongs_Mysql(SearchFavoriteSongs_Mysql());
|
||||||
|
// 重置分頁
|
||||||
|
currentPage = 0;
|
||||||
|
currentSongList = searchResults;
|
||||||
|
totalPages = (int)Math.Ceiling((double)searchResults.Count / itemsPerPage);
|
||||||
|
// 更新多頁面面板的內容
|
||||||
|
multiPagePanel.currentPageIndex = 0;
|
||||||
|
multiPagePanel.LoadSongs(currentSongList);
|
||||||
|
|
||||||
|
ToggleFavoritePictureBoxButtonsVisibility();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
showError = true;
|
||||||
|
isPhoneNumberValid = false;
|
||||||
|
FavoritePictureBox.Invalidate();
|
||||||
|
FavoritePictureBox.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
List<SongData> emptySongList = new List<SongData> { new SongData("", "", "歡迎光臨 " + "(" + mobileNumber + ")", 0, "", "", "", "", DateTime.Now, "", "", "", "", "", "", "", "", "", "", "", "", 1) };
|
|
||||||
|
|
||||||
multiPagePanel.currentPageIndex = 0;
|
|
||||||
multiPagePanel.LoadSongs(emptySongList);*/
|
|
||||||
ToggleFavoritePictureBoxButtonsVisibility();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
showError = true;
|
showError = true;
|
||||||
isPhoneNumberValid = true;
|
isPhoneNumberValid = false;
|
||||||
FavoritePictureBox.Invalidate();
|
FavoritePictureBox.Invalidate();
|
||||||
FavoritePictureBox.Refresh();
|
FavoritePictureBox.Refresh();
|
||||||
}
|
}
|
||||||
|
@ -6,14 +6,50 @@ using System.Diagnostics;
|
|||||||
namespace DualScreenDemo{
|
namespace DualScreenDemo{
|
||||||
public partial class PrimaryForm
|
public partial class PrimaryForm
|
||||||
{
|
{
|
||||||
|
private static string connectionStringfortest = "";
|
||||||
|
public static void LoadConnectionStringFromFile(string filePath)
|
||||||
|
{
|
||||||
|
filePath = Path.Combine(Application.StartupPath, "txt", filePath);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (File.Exists(filePath))
|
||||||
|
{
|
||||||
|
string fileContent = File.ReadAllText(filePath).Trim();
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(fileContent))
|
||||||
|
{
|
||||||
|
connectionStringfortest = fileContent;
|
||||||
|
Console.WriteLine("連線字串載入成功。");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("檔案內容為空。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("找不到指定的檔案:" + filePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine("讀取檔案時發生錯誤:" + ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string GetConnectionString()
|
||||||
|
{
|
||||||
|
return connectionStringfortest;
|
||||||
|
}
|
||||||
|
|
||||||
public bool isLoggedIn = false;
|
public bool isLoggedIn = false;
|
||||||
public string userPhone = string.Empty;
|
public string userPhone = string.Empty;
|
||||||
public List<SongData> SearchSongs_Mysql(string query)
|
public List<SongData> SearchSongs_Mysql(string query)
|
||||||
{
|
{
|
||||||
List<SongData> searchResults = new List<SongData>();
|
List<SongData> searchResults = new List<SongData>();
|
||||||
Console.WriteLine(query);
|
Console.WriteLine(query);
|
||||||
string connectionString = "Server=192.168.11.4;Port=3306;Database=Karaoke-Kingpin;User=Karaoke-Kingpin;Password=ESM7yTPMnavFmbBH;";
|
//string connectionString = "Server=192.168.11.4;Port=3306;Database=Karaoke-Kingpin;User=Karaoke-Kingpin;Password=ESM7yTPMnavFmbBH;";
|
||||||
|
string connectionString = GetConnectionString();
|
||||||
using (var connection = new MySqlConnection(connectionString))
|
using (var connection = new MySqlConnection(connectionString))
|
||||||
{
|
{
|
||||||
Stopwatch stopwatch = new Stopwatch();
|
Stopwatch stopwatch = new Stopwatch();
|
||||||
@ -65,8 +101,8 @@ namespace DualScreenDemo{
|
|||||||
public static List<Artist> SearchSingers_Mysql(string query){
|
public static List<Artist> SearchSingers_Mysql(string query){
|
||||||
List<Artist> searchResults = new List<Artist>();
|
List<Artist> searchResults = new List<Artist>();
|
||||||
Console.WriteLine(query);
|
Console.WriteLine(query);
|
||||||
string connectionString = "Server=192.168.11.4;Port=3306;Database=Karaoke-Kingpin;User=Karaoke-Kingpin;Password=ESM7yTPMnavFmbBH;";
|
//string connectionString = "Server=192.168.11.4;Port=3306;Database=Karaoke-Kingpin;User=Karaoke-Kingpin;Password=ESM7yTPMnavFmbBH;";
|
||||||
|
string connectionString = GetConnectionString();
|
||||||
using (var connection = new MySqlConnection(connectionString))
|
using (var connection = new MySqlConnection(connectionString))
|
||||||
{
|
{
|
||||||
Stopwatch stopwatch = new Stopwatch();
|
Stopwatch stopwatch = new Stopwatch();
|
||||||
@ -100,8 +136,8 @@ namespace DualScreenDemo{
|
|||||||
|
|
||||||
string query = $"INSERT INTO FavoriteSongs (userPhone,songNumber) VALUES ('{userPhone}','{songNumber}');";
|
string query = $"INSERT INTO FavoriteSongs (userPhone,songNumber) VALUES ('{userPhone}','{songNumber}');";
|
||||||
Console.WriteLine(query);
|
Console.WriteLine(query);
|
||||||
string connectionString = "Server=192.168.11.4;Port=3306;Database=Karaoke-Kingpin;User=Karaoke-Kingpin;Password=ESM7yTPMnavFmbBH;";
|
//string connectionString = "Server=192.168.11.4;Port=3306;Database=Karaoke-Kingpin;User=Karaoke-Kingpin;Password=ESM7yTPMnavFmbBH;";
|
||||||
|
string connectionString = GetConnectionString();
|
||||||
using (var connection = new MySqlConnection(connectionString))
|
using (var connection = new MySqlConnection(connectionString))
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -124,9 +160,38 @@ namespace DualScreenDemo{
|
|||||||
Console.WriteLine("MyDB 連線已關閉!");
|
Console.WriteLine("MyDB 連線已關閉!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string SearchFavoriteSongs_Mysql(){
|
public void InsertNewFavoriteUser(string phonenumber){
|
||||||
|
string songlist = phonenumber + "的歌單";
|
||||||
|
string query = $"INSERT INTO FavoriteSongs (userPhone,songNumber) VALUES ('{phonenumber}','{songlist}');";
|
||||||
|
Console.WriteLine(query);
|
||||||
|
//string connectionString = "Server=192.168.11.4;Port=3306;Database=Karaoke-Kingpin;User=Karaoke-Kingpin;Password=ESM7yTPMnavFmbBH;";
|
||||||
|
string connectionString = GetConnectionString();
|
||||||
|
using (var connection = new MySqlConnection(connectionString))
|
||||||
|
{
|
||||||
|
|
||||||
|
connection.Open();
|
||||||
|
Console.WriteLine("MyDB 連線成功!");
|
||||||
|
|
||||||
|
using (var command = new MySqlCommand(query, connection))
|
||||||
|
{
|
||||||
|
int rowsAffected = command.ExecuteNonQuery();
|
||||||
|
if (rowsAffected > 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine("插入成功!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("插入失敗(沒有資料被新增)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
connection.Close();
|
||||||
|
Console.WriteLine("MyDB 連線已關閉!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string SearchFavoriteSongs_Mysql()
|
||||||
|
{
|
||||||
string query = $"SELECT " +
|
string query = $"SELECT " +
|
||||||
"sl.*"+
|
"sl.*" +
|
||||||
"FROM FavoriteSongs fs " +
|
"FROM FavoriteSongs fs " +
|
||||||
"JOIN song_library_cache sl ON fs.songNumber = sl.song_id " +
|
"JOIN song_library_cache sl ON fs.songNumber = sl.song_id " +
|
||||||
$"WHERE fs.userPhone = '{userPhone}';";
|
$"WHERE fs.userPhone = '{userPhone}';";
|
||||||
@ -134,32 +199,36 @@ namespace DualScreenDemo{
|
|||||||
|
|
||||||
}
|
}
|
||||||
public bool checkPhoneNumberExist(string phonenumber){
|
public bool checkPhoneNumberExist(string phonenumber){
|
||||||
string connectionString = "Server=192.168.11.4;Port=3306;Database=Karaoke-Kingpin;User=Karaoke-Kingpin;Password=ESM7yTPMnavFmbBH;";
|
//string connectionString = "Server=192.168.11.4;Port=3306;Database=Karaoke-Kingpin;User=Karaoke-Kingpin;Password=ESM7yTPMnavFmbBH;";
|
||||||
|
string connectionString = GetConnectionString();
|
||||||
bool exists = false;
|
bool exists = false;
|
||||||
using (var connection = new MySqlConnection(connectionString))
|
using (var connection = new MySqlConnection(connectionString))
|
||||||
{
|
{
|
||||||
connection.Open();
|
connection.Open();
|
||||||
Console.WriteLine("MyDB 連線成功!");
|
Console.WriteLine("MyDB 連線成功!");
|
||||||
string query = $"SELECT COUNT(*) FROM FavoriteSongs WHERE userPhone = '{phonenumber}'";
|
string query = $"SELECT COUNT(*) FROM FavoriteSongs WHERE userPhone = '{phonenumber}';";
|
||||||
using (var command = new MySqlCommand(query, connection)){
|
using (var command = new MySqlCommand(query, connection))
|
||||||
int count = Convert.ToInt32(command.ExecuteScalar());
|
{
|
||||||
if (count > 0)
|
int count = Convert.ToInt32(command.ExecuteScalar());
|
||||||
{
|
if (count > 0)
|
||||||
exists = true; // 存在
|
{
|
||||||
userPhone= phonenumber;
|
exists = true; // 存在
|
||||||
isLoggedIn = true;
|
userPhone = phonenumber;
|
||||||
//點歌我的最愛按鈕,調整按鈕狀態
|
isLoggedIn = true;
|
||||||
favoriteButton.Enabled = true;
|
//點歌我的最愛按鈕,調整按鈕狀態
|
||||||
favoriteButton.BackColor = Color.Transparent;
|
favoriteButton.Enabled = true;
|
||||||
disabledPanel.Visible = false;
|
favoriteButton.BackColor = Color.Transparent;
|
||||||
}
|
disabledPanel.Visible = false;
|
||||||
else
|
this.Invalidate();
|
||||||
{
|
}
|
||||||
exists = false; // 不存在
|
else
|
||||||
}
|
{
|
||||||
|
exists = false; // 不存在
|
||||||
|
}
|
||||||
}
|
}
|
||||||
connection.Close();
|
connection.Close();
|
||||||
Console.WriteLine("MyDB 連線關閉!");
|
Console.WriteLine("MyDB 連線關閉!");
|
||||||
|
|
||||||
}
|
}
|
||||||
return exists;
|
return exists;
|
||||||
}
|
}
|
||||||
@ -178,10 +247,10 @@ namespace DualScreenDemo{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void AddSongCount(string id){
|
public void AddSongCount(string id){
|
||||||
string query = $"UPDATE songs SET song_counts = song_counts+1 WHERE id = '{id}';";
|
string query = $"UPDATE song_library_cache SET song_counts = song_counts+1 WHERE song_id = '{id}';";
|
||||||
Console.WriteLine(query);
|
Console.WriteLine(query);
|
||||||
string connectionString = "Server=192.168.11.4;Port=3306;Database=Karaoke-Kingpin;User=Karaoke-Kingpin;Password=ESM7yTPMnavFmbBH;";
|
//string connectionString = "Server=192.168.11.4;Port=3306;Database=Karaoke-Kingpin;User=Karaoke-Kingpin;Password=ESM7yTPMnavFmbBH;";
|
||||||
|
string connectionString = GetConnectionString();
|
||||||
using (var connection = new MySqlConnection(connectionString))
|
using (var connection = new MySqlConnection(connectionString))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ namespace DualScreenDemo
|
|||||||
private void AlbumButton_Click(object sender, EventArgs e)
|
private void AlbumButton_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string name = currentSelectedSong.ArtistA;
|
string name = currentSelectedSong.ArtistA;
|
||||||
string query = $"SELECT * FROM song_library_cache WHERE artistA = '{name}' ORDER BY add_date DESC";
|
string query = $"SELECT * FROM song_library_cache WHERE artistA = '{name}' ORDER BY add_date DESC;";
|
||||||
var selectedSongs = SearchSongs_Mysql(query);
|
var selectedSongs = SearchSongs_Mysql(query);
|
||||||
/*var selectedSongs = allSongs.Where(song => song.ArtistA == currentSelectedSong.ArtistA)
|
/*var selectedSongs = allSongs.Where(song => song.ArtistA == currentSelectedSong.ArtistA)
|
||||||
.OrderByDescending(song => song.AddedTime)
|
.OrderByDescending(song => song.AddedTime)
|
||||||
|
@ -184,31 +184,31 @@ namespace DualScreenDemo
|
|||||||
public PrimaryForm()
|
public PrimaryForm()
|
||||||
{
|
{
|
||||||
Instance = this;
|
Instance = this;
|
||||||
|
|
||||||
// 添加 DPI 感知支持
|
// 添加 DPI 感知支持
|
||||||
if (Environment.OSVersion.Version.Major >= 6)
|
if (Environment.OSVersion.Version.Major >= 6)
|
||||||
{
|
{
|
||||||
SetProcessDPIAware();
|
SetProcessDPIAware();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.DoubleBuffered = true;
|
this.DoubleBuffered = true;
|
||||||
|
|
||||||
InitializeProgressBar();
|
InitializeProgressBar();
|
||||||
|
|
||||||
// 初始化自动刷新Timer
|
// 初始化自动刷新Timer
|
||||||
autoRefreshTimer = new Timer();
|
autoRefreshTimer = new Timer();
|
||||||
autoRefreshTimer.Interval = 1000; // 1秒
|
autoRefreshTimer.Interval = 1000; // 1秒
|
||||||
autoRefreshTimer.Tick += AutoRefreshTimer_Tick;
|
autoRefreshTimer.Tick += AutoRefreshTimer_Tick;
|
||||||
|
|
||||||
// 設置窗體屬性
|
// 設置窗體屬性
|
||||||
this.WindowState = FormWindowState.Maximized;
|
this.WindowState = FormWindowState.Maximized;
|
||||||
this.FormBorderStyle = FormBorderStyle.None;
|
this.FormBorderStyle = FormBorderStyle.None;
|
||||||
|
|
||||||
lightControlTimer = new Timer();
|
lightControlTimer = new Timer();
|
||||||
lightControlTimer.Interval = 5;
|
lightControlTimer.Interval = 5;
|
||||||
lightControlTimer.Tick += LightControlTimer_Tick;
|
lightControlTimer.Tick += LightControlTimer_Tick;
|
||||||
volumeUpTimer = new Timer();
|
volumeUpTimer = new Timer();
|
||||||
volumeUpTimer.Interval = 100;
|
volumeUpTimer.Interval = 100;
|
||||||
volumeUpTimer.Tick += VolumeUpTimer_Tick;
|
volumeUpTimer.Tick += VolumeUpTimer_Tick;
|
||||||
volumeDownTimer = new Timer();
|
volumeDownTimer = new Timer();
|
||||||
volumeDownTimer.Interval = 100;
|
volumeDownTimer.Interval = 100;
|
||||||
@ -216,12 +216,12 @@ namespace DualScreenDemo
|
|||||||
micControlTimer = new Timer();
|
micControlTimer = new Timer();
|
||||||
micControlTimer.Interval = 100;
|
micControlTimer.Interval = 100;
|
||||||
micControlTimer.Tick += MicControlTimer_Tick;
|
micControlTimer.Tick += MicControlTimer_Tick;
|
||||||
|
|
||||||
InitializeRecording();
|
InitializeRecording();
|
||||||
InitializeMediaPlayer();
|
InitializeMediaPlayer();
|
||||||
LoadSongData();
|
LoadSongData();
|
||||||
LoadImages();
|
LoadImages();
|
||||||
InitializeFormAndControls();
|
InitializeFormAndControls();
|
||||||
InitializeMultiPagePanel();
|
InitializeMultiPagePanel();
|
||||||
OverlayQRCodeOnImage(HttpServer.randomFolderPath);
|
OverlayQRCodeOnImage(HttpServer.randomFolderPath);
|
||||||
|
|
||||||
@ -229,15 +229,17 @@ namespace DualScreenDemo
|
|||||||
InitializeHandWritingForSongs();
|
InitializeHandWritingForSongs();
|
||||||
|
|
||||||
InitializeSendOffPanel();
|
InitializeSendOffPanel();
|
||||||
|
|
||||||
InitializePromotionsAndMenuPanel();
|
InitializePromotionsAndMenuPanel();
|
||||||
SaveInitialControlStates(this);
|
SaveInitialControlStates(this);
|
||||||
// 包廂 + port 名稱
|
// 包廂 + port 名稱
|
||||||
this.Paint += PrimaryForm_Paint;
|
this.Paint += PrimaryForm_Paint;
|
||||||
|
this.Paint += User_Paint;
|
||||||
// 註冊多頁面面板的頁碼改變事件處理
|
// 註冊多頁面面板的頁碼改變事件處理
|
||||||
multiPagePanel.PageIndexChanged += HandlePageChanged;
|
multiPagePanel.PageIndexChanged += HandlePageChanged;
|
||||||
// 添加 Load 事件處理
|
// 添加 Load 事件處理
|
||||||
this.Load += PrimaryForm_Load;
|
this.Load += PrimaryForm_Load;
|
||||||
|
LoadConnectionStringFromFile("test.env");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,7 +304,36 @@ namespace DualScreenDemo
|
|||||||
e.Graphics.DrawString(displayName, font, brush, point_PCName);
|
e.Graphics.DrawString(displayName, font, brush, point_PCName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
private void User_Paint(object sender, PaintEventArgs e)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrWhiteSpace(userPhone) && isLoggedIn)
|
||||||
|
{
|
||||||
|
string displayName = "歡迎貴賓 :" + userPhone;
|
||||||
|
float baseWidth = 1920f;
|
||||||
|
float baseHeight = 1080f;
|
||||||
|
|
||||||
|
// 實際螢幕解析度
|
||||||
|
float actualWidth = Screen.PrimaryScreen.Bounds.Width;
|
||||||
|
float actualHeight = Screen.PrimaryScreen.Bounds.Height;
|
||||||
|
|
||||||
|
// 計算縮放比例
|
||||||
|
float scaleX = actualWidth / baseWidth;
|
||||||
|
float scaleY = actualHeight / baseHeight;
|
||||||
|
|
||||||
|
|
||||||
|
// 設定字型:
|
||||||
|
// "微軟正黑體",大小 20,粗體 (Bold)
|
||||||
|
float fontSize = 18 * scaleY;
|
||||||
|
Font font = new Font("微軟正黑體", fontSize, FontStyle.Bold);
|
||||||
|
// 設定畫刷 (Brush):
|
||||||
|
// 使用紅色 (Red) 來繪製文字
|
||||||
|
Brush brush = new SolidBrush(Color.Red);
|
||||||
|
|
||||||
|
// 設定繪製文字的位置 (X=800, Y=30)
|
||||||
|
PointF point_user = new PointF(800 * scaleX, 30 * scaleY);
|
||||||
|
e.Graphics.DrawString(displayName, font, brush, point_user);
|
||||||
|
}
|
||||||
|
}
|
||||||
private void buttonMiddle_Click(object sender, EventArgs e)
|
private void buttonMiddle_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
sequenceManager.ProcessClick("巨");
|
sequenceManager.ProcessClick("巨");
|
||||||
|
@ -177,7 +177,7 @@ namespace DualScreenDemo
|
|||||||
// 例如:根據輸入框的內容搜尋歌曲
|
// 例如:根據輸入框的內容搜尋歌曲
|
||||||
string query = string.IsNullOrWhiteSpace(searchText)
|
string query = string.IsNullOrWhiteSpace(searchText)
|
||||||
? "SELECT * FROM artists; LIMIT 50"
|
? "SELECT * FROM artists; LIMIT 50"
|
||||||
: $"SELECT * FROM artists WHERE `pinyin_abbr` LIKE '{searchText}%' ";
|
: $"SELECT * FROM artists WHERE `pinyin_abbr` LIKE '{searchText}%';";
|
||||||
//string query = $"SELECT * FROM SongLibrary WHERE `歌星A拼音` LIKE '{searchText}%' OR `歌星B拼音` LIKE '{searchText}%' ";
|
//string query = $"SELECT * FROM SongLibrary WHERE `歌星A拼音` LIKE '{searchText}%' OR `歌星B拼音` LIKE '{searchText}%' ";
|
||||||
|
|
||||||
var searchResults = SearchSingers_Mysql(query);
|
var searchResults = SearchSingers_Mysql(query);
|
||||||
|
@ -541,7 +541,7 @@ namespace DualScreenDemo
|
|||||||
if (int.TryParse(searchText, out int length))
|
if (int.TryParse(searchText, out int length))
|
||||||
{
|
{
|
||||||
//var searchResults = allArtists.Where(artist => artist.Name.Length == length).ToList();
|
//var searchResults = allArtists.Where(artist => artist.Name.Length == length).ToList();
|
||||||
string query = $"SELECT * FROM artists WHERE CHAR_LENGTH(name) = {length} ";
|
string query = $"SELECT * FROM artists WHERE CHAR_LENGTH(name) = {length} ;";
|
||||||
var searchResults = SearchSingers_Mysql(query);
|
var searchResults = SearchSingers_Mysql(query);
|
||||||
// 設定當前頁數為 0,並加載搜索結果
|
// 設定當前頁數為 0,並加載搜索結果
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
|
@ -37,7 +37,7 @@ namespace DualScreenDemo
|
|||||||
isOnOrderedSongsPage = false;
|
isOnOrderedSongsPage = false;
|
||||||
/* 清空搜尋欄 */
|
/* 清空搜尋欄 */
|
||||||
ResetinputBox();
|
ResetinputBox();
|
||||||
string query = $"SELECT * FROM artists WHERE category = '男' LIMIT 100";
|
string query = $"SELECT * FROM artists WHERE category = '男' LIMIT 100 ;";
|
||||||
var searchResult = SearchSingers_Mysql(query);
|
var searchResult = SearchSingers_Mysql(query);
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
currentArtistList = searchResult;
|
currentArtistList = searchResult;
|
||||||
|
@ -550,7 +550,7 @@ namespace DualScreenDemo
|
|||||||
// 如果輸入框為空,則不進行搜尋
|
// 如果輸入框為空,則不進行搜尋
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
string query = $"SELECT * FROM song_library_cache WHERE `song_id` = '{searchText}' ";
|
string query = $"SELECT * FROM song_library_cache WHERE `song_id` = '{searchText}';";
|
||||||
|
|
||||||
var searchResults = SearchSongs_Mysql(query);
|
var searchResults = SearchSongs_Mysql(query);
|
||||||
// 重置分頁
|
// 重置分頁
|
||||||
|
@ -477,7 +477,7 @@ namespace DualScreenDemo
|
|||||||
string query;
|
string query;
|
||||||
if (int.TryParse(searchText, out int length))
|
if (int.TryParse(searchText, out int length))
|
||||||
{
|
{
|
||||||
query = $"SELECT * FROM song_library_cache WHERE CHAR_LENGTH(song_name) = {length} ";
|
query = $"SELECT * FROM song_library_cache WHERE CHAR_LENGTH(song_name) = {length} ;";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -49,7 +49,7 @@ namespace DualScreenDemo
|
|||||||
isOnOrderedSongsPage = false;
|
isOnOrderedSongsPage = false;
|
||||||
|
|
||||||
ResetinputBox();
|
ResetinputBox();
|
||||||
string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' LIMIT 100";
|
string query = $"SELECT * FROM song_library_cache WHERE language_name = '國語' LIMIT 100;";
|
||||||
var searchResult = SearchSongs_Mysql(query);
|
var searchResult = SearchSongs_Mysql(query);
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
currentSongList = searchResult;
|
currentSongList = searchResult;
|
||||||
|
157
Program.cs
157
Program.cs
@ -2,6 +2,7 @@ using System.IO;
|
|||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using DBObj;
|
using DBObj;
|
||||||
|
using HeartbeatSender;
|
||||||
|
|
||||||
namespace DualScreenDemo
|
namespace DualScreenDemo
|
||||||
{
|
{
|
||||||
@ -14,76 +15,102 @@ namespace DualScreenDemo
|
|||||||
private static PrimaryForm primaryForm; // 儲存實例的參考
|
private static PrimaryForm primaryForm; // 儲存實例的參考
|
||||||
|
|
||||||
[STAThread]
|
[STAThread]
|
||||||
static void Main()
|
static void Main()
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// COM 初始化
|
|
||||||
int hr = ComInterop.CoInitializeEx(IntPtr.Zero, ComInterop.COINIT_APARTMENTTHREADED);
|
|
||||||
if (hr < 0)
|
|
||||||
{
|
{
|
||||||
Console.WriteLine("Failed to initialize COM library.");
|
Console.WriteLine("正在與中控取得聯繫");
|
||||||
return;
|
var sender = new HeartbeatSender.heartbeatSender("http://zqd.superstar.dnsnet.cc/api/room/receiveRegister");
|
||||||
}
|
|
||||||
// 初始化管理器
|
|
||||||
|
|
||||||
songListManager = new SongListManager(); // 使用单例
|
// 同步呼叫非同步登入取得 token
|
||||||
//artistManager = new ArtistManager();
|
bool loginSuccess = sender.LoginAndGetTokenAsync().GetAwaiter().GetResult();
|
||||||
|
|
||||||
var commandHandler = new CommandHandler(songListManager);
|
if (loginSuccess)
|
||||||
serialPortManager = new SerialPortManager(commandHandler);
|
|
||||||
serialPortManager.InitializeSerialPort();
|
|
||||||
|
|
||||||
// 輸出屏幕信息
|
|
||||||
Console.WriteLine($"Virtual Screen: {SystemInformation.VirtualScreen}");
|
|
||||||
foreach (var screen in Screen.AllScreens)
|
|
||||||
{
|
|
||||||
Console.WriteLine($"Screen: {screen.DeviceName} Resolution: {screen.Bounds.Width}x{screen.Bounds.Height}");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 啟動服務器
|
|
||||||
Task.Run(() => HttpServerManager.StartServer());
|
|
||||||
Task.Run(() => TCPServerManager.StartServer());
|
|
||||||
|
|
||||||
// 註冊事件
|
|
||||||
Application.ApplicationExit += (sender, e) => SerialPortManager.CloseSerialPortSafely();
|
|
||||||
SystemEvents.DisplaySettingsChanged += OnDisplaySettingsChanged;
|
|
||||||
|
|
||||||
// 創建主窗體
|
|
||||||
primaryForm = new PrimaryForm();
|
|
||||||
//primaryForm.allSongs = songListManager.AllSongs;
|
|
||||||
//primaryForm.allArtists = artistManager.AllArtists;
|
|
||||||
primaryForm.StartPosition = FormStartPosition.Manual;
|
|
||||||
primaryForm.Location = new Point(0, 0);
|
|
||||||
primaryForm.Size = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
|
|
||||||
|
|
||||||
// 在完整初始化後檢查狀態
|
|
||||||
string stateFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"txt","states.txt");
|
|
||||||
bool isClosedState = File.Exists(stateFilePath) &&
|
|
||||||
File.ReadAllText(stateFilePath).Trim().Equals("CLOSE", StringComparison.OrdinalIgnoreCase);
|
|
||||||
|
|
||||||
InitializeSecondaryScreen();
|
|
||||||
|
|
||||||
// 使用 Shown 事件來確保窗體完全加載後再顯示送客畫面
|
|
||||||
if (isClosedState)
|
|
||||||
{
|
|
||||||
primaryForm.Shown += (s, e) =>
|
|
||||||
{
|
{
|
||||||
primaryForm.ShowSendOffScreen();
|
// 先送一次心跳 (同步呼叫)
|
||||||
};
|
sender.SendHeartbeatAsync().GetAwaiter().GetResult();
|
||||||
}
|
|
||||||
|
|
||||||
primaryForm.Show();
|
// 背景持續每3秒送心跳
|
||||||
Application.Run(primaryForm);
|
_ = Task.Run(async () =>
|
||||||
}
|
{
|
||||||
catch (Exception ex)
|
while (true)
|
||||||
{
|
{
|
||||||
WriteLog(ex.ToString());
|
await sender.SendHeartbeatAsync();
|
||||||
}
|
await Task.Delay(300000); // 每3秒送一次
|
||||||
finally
|
}
|
||||||
{
|
});
|
||||||
SystemEvents.DisplaySettingsChanged -= OnDisplaySettingsChanged;
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("登入失敗,無法送出心跳");
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// COM 初始化
|
||||||
|
int hr = ComInterop.CoInitializeEx(IntPtr.Zero, ComInterop.COINIT_APARTMENTTHREADED);
|
||||||
|
if (hr < 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Failed to initialize COM library.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 初始化管理器
|
||||||
|
|
||||||
|
songListManager = new SongListManager(); // 使用单例
|
||||||
|
//artistManager = new ArtistManager();
|
||||||
|
|
||||||
|
var commandHandler = new CommandHandler(songListManager);
|
||||||
|
serialPortManager = new SerialPortManager(commandHandler);
|
||||||
|
serialPortManager.InitializeSerialPort();
|
||||||
|
|
||||||
|
// 輸出屏幕信息
|
||||||
|
Console.WriteLine($"Virtual Screen: {SystemInformation.VirtualScreen}");
|
||||||
|
foreach (var screen in Screen.AllScreens)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Screen: {screen.DeviceName} Resolution: {screen.Bounds.Width}x{screen.Bounds.Height}");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 啟動服務器
|
||||||
|
Task.Run(() => HttpServerManager.StartServer());
|
||||||
|
Task.Run(() => TCPServerManager.StartServer());
|
||||||
|
|
||||||
|
// 註冊事件
|
||||||
|
Application.ApplicationExit += (sender, e) => SerialPortManager.CloseSerialPortSafely();
|
||||||
|
SystemEvents.DisplaySettingsChanged += OnDisplaySettingsChanged;
|
||||||
|
|
||||||
|
// 創建主窗體
|
||||||
|
primaryForm = new PrimaryForm();
|
||||||
|
//primaryForm.allSongs = songListManager.AllSongs;
|
||||||
|
//primaryForm.allArtists = artistManager.AllArtists;
|
||||||
|
primaryForm.StartPosition = FormStartPosition.Manual;
|
||||||
|
primaryForm.Location = new Point(0, 0);
|
||||||
|
primaryForm.Size = new Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
|
||||||
|
|
||||||
|
// 在完整初始化後檢查狀態
|
||||||
|
string stateFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "txt", "states.txt");
|
||||||
|
bool isClosedState = File.Exists(stateFilePath) &&
|
||||||
|
File.ReadAllText(stateFilePath).Trim().Equals("CLOSE", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
InitializeSecondaryScreen();
|
||||||
|
|
||||||
|
// 使用 Shown 事件來確保窗體完全加載後再顯示送客畫面
|
||||||
|
if (isClosedState)
|
||||||
|
{
|
||||||
|
primaryForm.Shown += (s, e) =>
|
||||||
|
{
|
||||||
|
primaryForm.ShowSendOffScreen();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
primaryForm.Show();
|
||||||
|
Application.Run(primaryForm);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
WriteLog(ex.ToString());
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
SystemEvents.DisplaySettingsChanged -= OnDisplaySettingsChanged;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
10
TCPServer.cs
10
TCPServer.cs
@ -150,7 +150,11 @@ namespace DualScreenDemo
|
|||||||
await SafeInvoke(PrimaryForm.Instance, async () =>
|
await SafeInvoke(PrimaryForm.Instance, async () =>
|
||||||
{
|
{
|
||||||
PrimaryForm.Instance.ShowSendOffScreen();
|
PrimaryForm.Instance.ShowSendOffScreen();
|
||||||
|
_ = SafeInvoke(PrimaryForm.Instance, () =>
|
||||||
|
{
|
||||||
|
string marqueeMessage= "歡迎使用超級巨星歡唱網路版系統,與你共度美好時光。";
|
||||||
|
OverlayForm.MainForm.UpdateMarqueeText(marqueeMessage, OverlayForm.MarqueeStartPosition.Middle, Color.White);
|
||||||
|
});
|
||||||
Console.WriteLine("開始設置新的播放列表");
|
Console.WriteLine("開始設置新的播放列表");
|
||||||
|
|
||||||
string closePath = @"C:\video\CLOSE.MPG";
|
string closePath = @"C:\video\CLOSE.MPG";
|
||||||
@ -215,10 +219,12 @@ namespace DualScreenDemo
|
|||||||
OverlayForm.MainForm.UpdateMarqueeText(marqueeMessage, OverlayForm.MarqueeStartPosition.Middle, Color.White);
|
OverlayForm.MainForm.UpdateMarqueeText(marqueeMessage, OverlayForm.MarqueeStartPosition.Middle, Color.White);
|
||||||
});
|
});
|
||||||
// 開台時跳至首頁
|
// 開台時跳至首頁
|
||||||
PrimaryForm.Instance.HotPlayButton_Click(null, EventArgs.Empty);
|
|
||||||
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.Instance.HotPlayButton_Click(null, EventArgs.Empty);
|
||||||
UpdateStateFile(stateFilePath, "OPEN");
|
UpdateStateFile(stateFilePath, "OPEN");
|
||||||
|
|
||||||
byte[] okResponse = Encoding.UTF8.GetBytes("OK\n");
|
byte[] okResponse = Encoding.UTF8.GetBytes("OK\n");
|
||||||
|
@ -760,7 +760,10 @@ namespace DualScreenDemo
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 可以取得 燈控/聲控 的位置
|
||||||
var songToPlay = currentPlaylist[currentSongIndex];
|
var songToPlay = currentPlaylist[currentSongIndex];
|
||||||
|
|
||||||
|
// pathToPlay 需要調整
|
||||||
var pathToPlay = File.Exists(songToPlay.SongFilePathHost1) ? songToPlay.SongFilePathHost1 : songToPlay.SongFilePathHost2;
|
var pathToPlay = File.Exists(songToPlay.SongFilePathHost1) ? songToPlay.SongFilePathHost1 : songToPlay.SongFilePathHost2;
|
||||||
|
|
||||||
// 若兩個 host 上都找不到檔案就直接結束
|
// 若兩個 host 上都找不到檔案就直接結束
|
||||||
|
189
config.ini
189
config.ini
@ -51,46 +51,46 @@ Height = 394
|
|||||||
Symbols=ㄅ,ㄉ,ㄍ,ㄐ,ㄓ,ㄗ,ㄛ,ㄡ,ㄤ,ㄧ,ㄆ,ㄊ,ㄎ,ㄑ,ㄔ,ㄘ,ㄜ,ㄢ,ㄦ,ㄨ,ㄇ,ㄋ,ㄏ,ㄒ,ㄕ,ㄙ,ㄞ,ㄣ,ㄩ,ㄈ,ㄌ, ,ㄖ,ㄚ,ㄠ
|
Symbols=ㄅ,ㄉ,ㄍ,ㄐ,ㄓ,ㄗ,ㄛ,ㄡ,ㄤ,ㄧ,ㄆ,ㄊ,ㄎ,ㄑ,ㄔ,ㄘ,ㄜ,ㄢ,ㄦ,ㄨ,ㄇ,ㄋ,ㄏ,ㄒ,ㄕ,ㄙ,ㄞ,ㄣ,ㄩ,ㄈ,ㄌ, ,ㄖ,ㄚ,ㄠ
|
||||||
|
|
||||||
[PhoneticButtonCoordinates]
|
[PhoneticButtonCoordinates]
|
||||||
button1 = 150,342,93,86
|
button1 = 150,338,93,86
|
||||||
button2 = 255,342,93,86
|
button2 = 255,338,93,86
|
||||||
button3 = 359,342,93,86
|
button3 = 359,338,93,86
|
||||||
button4 = 463,342,93,86
|
button4 = 463,338,93,86
|
||||||
button5 = 567,341,93,87
|
button5 = 567,338,93,87
|
||||||
button6 = 671,341,93,86
|
button6 = 671,338,93,86
|
||||||
button7 = 775,341,93,86
|
button7 = 775,338,93,86
|
||||||
button8 = 879,340,93,86
|
button8 = 879,338,93,86
|
||||||
button9 = 984,340,93,86
|
button9 = 984,338,93,86
|
||||||
button10 = 1088,340,93,86
|
button10 = 1088,338,93,86
|
||||||
button11 = 151,436,93,86
|
button11 = 151,434,93,86
|
||||||
button12 = 255,436,93,86
|
button12 = 255,434,93,86
|
||||||
button13 = 359,436,93,86
|
button13 = 359,434,93,86
|
||||||
button14 = 463,436,93,86
|
button14 = 463,434,93,86
|
||||||
button15 = 567,435,93,86
|
button15 = 567,434,93,86
|
||||||
button16 = 671,436,93,86
|
button16 = 671,434,93,86
|
||||||
button17 = 775,436,93,86
|
button17 = 775,434,93,86
|
||||||
button18 = 879,436,93,86
|
button18 = 879,434,93,86
|
||||||
button19 = 984,436,93,86
|
button19 = 984,434,93,86
|
||||||
button20 = 1088,436,93,86
|
button20 = 1088,434,93,86
|
||||||
button21 = 203,532,93,86
|
button21 = 203,530,93,86
|
||||||
button22 = 307,532,93,86
|
button22 = 307,530,93,86
|
||||||
button23 = 411,532,93,86
|
button23 = 411,530,93,86
|
||||||
button24 = 515,532,93,86
|
button24 = 515,530,93,86
|
||||||
button25 = 619,531,93,86
|
button25 = 619,530,93,86
|
||||||
button26 = 723,532,93,86
|
button26 = 723,530,93,86
|
||||||
button27 = 827,532,93,86
|
button27 = 827,530,93,86
|
||||||
button28 = 931,532,93,86
|
button28 = 931,530,93,86
|
||||||
button29 = 1035,532,93,86
|
button29 = 1035,530,93,86
|
||||||
button30 = 255,628,93,86
|
button30 = 255,624,93,86
|
||||||
button31 = 359,628,93,86
|
button31 = 359,624,93,86
|
||||||
button32 = 463,628,202,86
|
button32 = 463,624,202,86
|
||||||
button33 = 676,628,93,86
|
button33 = 676,624,93,86
|
||||||
button34 = 780,628,93,86
|
button34 = 780,624,93,86
|
||||||
button35 = 884,628,93,86
|
button35 = 884,624,93,86
|
||||||
|
|
||||||
[SpecialButtonCoordinates]
|
[SpecialButtonCoordinates]
|
||||||
modifyButtonZhuYinSingers = 989,627,94,87
|
modifyButtonZhuYinSingers = 989,624,94,87
|
||||||
clearButtonZhuYinSingers = 151,627,93,87
|
clearButtonZhuYinSingers = 151,624,93,87
|
||||||
closeButtonZhuYinSingers = 1093,627,94,87
|
closeButtonZhuYinSingers = 1093,624,94,87
|
||||||
modifyButtonEnglishSingers = 1032,633,70,66
|
modifyButtonEnglishSingers = 1032,633,70,66
|
||||||
clearButtonEnglishSingers = 408,633,70,66
|
clearButtonEnglishSingers = 408,633,70,66
|
||||||
closeButtonEnglishSingers = 1110,633,70,66
|
closeButtonEnglishSingers = 1110,633,70,66
|
||||||
@ -100,12 +100,12 @@ closeButtonPinYinSingers = 1091,642,94,87
|
|||||||
refillButtonHandWritingSingers = 918,372,70,65
|
refillButtonHandWritingSingers = 918,372,70,65
|
||||||
clearButtonHandWritingSingers = 996,372,70,65
|
clearButtonHandWritingSingers = 996,372,70,65
|
||||||
closeButtonForSingers = 1074,372,70,65
|
closeButtonForSingers = 1074,372,70,65
|
||||||
modifyButtonZhuYinSongs = 989,627,94,87
|
modifyButtonZhuYinSongs = 989,624,94,87
|
||||||
clearButtonZhuYinSongs = 151,627,93,87
|
clearButtonZhuYinSongs = 151,624,93,87
|
||||||
closeButtonZhuYinSongs = 1093,627,94,87
|
closeButtonZhuYinSongs = 1093,624,94,87
|
||||||
modifyButtonEnglishSongs = 1032,633,70,66
|
modifyButtonEnglishSongs = 1032,631,70,66
|
||||||
clearButtonEnglishSongs = 408,633,70,66
|
clearButtonEnglishSongs = 408,631,70,66
|
||||||
closeButtonEnglishSongs = 1110,633,70,66
|
closeButtonEnglishSongs = 1110,631,70,66
|
||||||
modifyButtonPinYinSongs = 987,642,94,87
|
modifyButtonPinYinSongs = 987,642,94,87
|
||||||
clearButtonPinYinSongs = 154,642,94,87
|
clearButtonPinYinSongs = 154,642,94,87
|
||||||
closeButtonPinYinSongs = 1091,642,94,87
|
closeButtonPinYinSongs = 1091,642,94,87
|
||||||
@ -118,9 +118,9 @@ closeButtonWordCountSongs = 1088,624,72,67
|
|||||||
modifyButtonWordCountSingers = 926,624,72,67
|
modifyButtonWordCountSingers = 926,624,72,67
|
||||||
clearButtonWordCountSingers = 845,624,72,67
|
clearButtonWordCountSingers = 845,624,72,67
|
||||||
closeButtonWordCountSingers = 1088,624,72,67
|
closeButtonWordCountSingers = 1088,624,72,67
|
||||||
modifyButtonSongIDSearch = 811,643,94,87
|
modifyButtonSongIDSearch = 829,643,94,87
|
||||||
clearButtonSongIDSearch = 692,643,93,87
|
clearButtonSongIDSearch = 722,643,93,87
|
||||||
closeButtonSongIDSearch = 1051,643,94,87
|
closeButtonSongIDSearch = 1043,643,94,87
|
||||||
|
|
||||||
|
|
||||||
[ModifyButtonImagesZhuYin]
|
[ModifyButtonImagesZhuYin]
|
||||||
@ -141,7 +141,7 @@ mouseDown = themes\superstar\歌星\注音\VOD_歌星查詢_注音查詢(按鍵)
|
|||||||
[InputBoxZhuYinSingers]
|
[InputBoxZhuYinSingers]
|
||||||
X=150
|
X=150
|
||||||
Y=264
|
Y=264
|
||||||
Width=596
|
Width=605
|
||||||
Height=63
|
Height=63
|
||||||
FontName=微軟正黑體
|
FontName=微軟正黑體
|
||||||
FontSize=26
|
FontSize=26
|
||||||
@ -300,32 +300,32 @@ button9_mouseDown = themes\superstar\歌星\英文\VOD_歌星查詢_英文查詢
|
|||||||
button9_mouseOver = themes\superstar\歌星\英文\VOD_歌星查詢_英文查詢(按鍵)-12.png
|
button9_mouseOver = themes\superstar\歌星\英文\VOD_歌星查詢_英文查詢(按鍵)-12.png
|
||||||
|
|
||||||
[EnglishLetterButtonCoordinates]
|
[EnglishLetterButtonCoordinates]
|
||||||
button0 = 408,490,70,66
|
button0 = 408,489,70,66
|
||||||
button1 = 486,490,70,66
|
button1 = 486,489,70,66
|
||||||
button2 = 564,490,70,66
|
button2 = 564,489,70,66
|
||||||
button3 = 642,490,70,66
|
button3 = 642,489,70,66
|
||||||
button4 = 720,489,70,66
|
button4 = 720,489,70,66
|
||||||
button5 = 798,490,70,66
|
button5 = 798,489,70,66
|
||||||
button6 = 876,490,70,66
|
button6 = 876,489,70,66
|
||||||
button7 = 954,490,70,66
|
button7 = 953,489,70,66
|
||||||
button8 = 1033,490,70,66
|
button8 = 1032,489,70,66
|
||||||
button9 = 1111,490,70,66
|
button9 = 1110,489,70,66
|
||||||
button10 = 449,561,70,66
|
button10 = 449,560,70,66
|
||||||
button11 = 527,561,70,66
|
button11 = 527,560,70,66
|
||||||
button12 = 605,561,70,66
|
button12 = 605,560,70,66
|
||||||
button13 = 683,561,70,66
|
button13 = 683,560,70,66
|
||||||
button14 = 761,561,70,66
|
button14 = 761,560,70,66
|
||||||
button15 = 839,561,70,66
|
button15 = 838,560,70,66
|
||||||
button16 = 917,561,70,66
|
button16 = 916,560,70,66
|
||||||
button17 = 995,561,70,66
|
button17 = 994,560,70,66
|
||||||
button18 = 1073,561,70,66
|
button18 = 1072,560,70,66
|
||||||
button19 = 486,633,70,66
|
button19 = 486,631,70,66
|
||||||
button20 = 564,633,70,66
|
button20 = 564,631,70,66
|
||||||
button21 = 642,633,70,66
|
button21 = 642,631,70,66
|
||||||
button22 = 720,634,70,66
|
button22 = 720,631,70,66
|
||||||
button23 = 798,633,70,66
|
button23 = 798,631,70,66
|
||||||
button24 = 876,633,70,66
|
button24 = 876,631,70,66
|
||||||
button25 = 954,633,70,66
|
button25 = 954,631,70,66
|
||||||
|
|
||||||
[EnglishLetterButtonImages]
|
[EnglishLetterButtonImages]
|
||||||
button0_normal = themes\superstar\歌星\英文\VOD_歌星查詢_英文查詢(按鍵)-13.png
|
button0_normal = themes\superstar\歌星\英文\VOD_歌星查詢_英文查詢(按鍵)-13.png
|
||||||
@ -423,9 +423,9 @@ mouseOver = themes\superstar\歌星\英文\VOD_歌星查詢_英文查詢(按鍵)
|
|||||||
mouseDown = themes\superstar\歌星\英文\VOD_歌星查詢_英文查詢(按鍵)-80.png
|
mouseDown = themes\superstar\歌星\英文\VOD_歌星查詢_英文查詢(按鍵)-80.png
|
||||||
|
|
||||||
[InputBoxEnglishSingers]
|
[InputBoxEnglishSingers]
|
||||||
X = 408
|
X = 409
|
||||||
Y = 361
|
Y = 360
|
||||||
Width = 444
|
Width = 478
|
||||||
Height = 47
|
Height = 47
|
||||||
FontName = Times New Roman
|
FontName = Times New Roman
|
||||||
FontSize = 26
|
FontSize = 26
|
||||||
@ -460,6 +460,7 @@ button23 = 674,642,94,87
|
|||||||
button24 = 778,642,94,87
|
button24 = 778,642,94,87
|
||||||
button25 = 882,642,94,87
|
button25 = 882,642,94,87
|
||||||
|
|
||||||
|
|
||||||
[PinYinLetterButtonImages]
|
[PinYinLetterButtonImages]
|
||||||
button0_normal = themes\superstar\歌星\拼音\VOD_歌星查詢_拼音查詢(按鍵)-03.png
|
button0_normal = themes\superstar\歌星\拼音\VOD_歌星查詢_拼音查詢(按鍵)-03.png
|
||||||
button0_mouseDown = themes\superstar\歌星\拼音\VOD_歌星查詢_拼音查詢(按鍵)-32.png
|
button0_mouseDown = themes\superstar\歌星\拼音\VOD_歌星查詢_拼音查詢(按鍵)-32.png
|
||||||
@ -556,9 +557,9 @@ mouseOver = themes\superstar\歌星\拼音\VOD_歌星查詢_拼音查詢(按鍵)
|
|||||||
mouseDown = themes\superstar\歌星\拼音\VOD_歌星查詢_拼音查詢(按鍵)-60.png
|
mouseDown = themes\superstar\歌星\拼音\VOD_歌星查詢_拼音查詢(按鍵)-60.png
|
||||||
|
|
||||||
[InputBoxPinYinSingers]
|
[InputBoxPinYinSingers]
|
||||||
X = 154
|
X = 156
|
||||||
Y = 370
|
Y = 370
|
||||||
Width = 593
|
Width = 628
|
||||||
Height = 63
|
Height = 63
|
||||||
FontName = Times New Roman
|
FontName = Times New Roman
|
||||||
FontSize = 26
|
FontSize = 26
|
||||||
@ -591,9 +592,9 @@ FontStyle=Bold
|
|||||||
ForeColor=Black
|
ForeColor=Black
|
||||||
|
|
||||||
[InputBoxEnglishSongs]
|
[InputBoxEnglishSongs]
|
||||||
X = 408
|
X = 409
|
||||||
Y = 361
|
Y = 360
|
||||||
Width = 444
|
Width = 478
|
||||||
Height = 47
|
Height = 47
|
||||||
FontName = Times New Roman
|
FontName = Times New Roman
|
||||||
FontSize = 26
|
FontSize = 26
|
||||||
@ -601,9 +602,9 @@ FontStyle = Regular
|
|||||||
ForeColor = Black
|
ForeColor = Black
|
||||||
|
|
||||||
[InputBoxPinYinSongs]
|
[InputBoxPinYinSongs]
|
||||||
X = 154
|
X = 156
|
||||||
Y = 370
|
Y = 370
|
||||||
Width = 593
|
Width = 628
|
||||||
Height = 63
|
Height = 63
|
||||||
FontName = Times New Roman
|
FontName = Times New Roman
|
||||||
FontSize = 26
|
FontSize = 26
|
||||||
@ -697,7 +698,7 @@ Height = 442
|
|||||||
|
|
||||||
[InputBoxSongIDSearch]
|
[InputBoxSongIDSearch]
|
||||||
X = 660
|
X = 660
|
||||||
Y = 370
|
Y = 380
|
||||||
Width = 530
|
Width = 530
|
||||||
Height = 63
|
Height = 63
|
||||||
FontName = Times New Roman
|
FontName = Times New Roman
|
||||||
@ -710,16 +711,16 @@ Symbols=1,2,3,4,5,6,7,8,9,0
|
|||||||
|
|
||||||
[NumberSongIDButtonCoordinates]
|
[NumberSongIDButtonCoordinates]
|
||||||
button0 = 650,300,94,87
|
button0 = 650,300,94,87
|
||||||
button1 = 662,445,94,87
|
button1 = 668,453,94,87
|
||||||
button2 = 770,445,94,87
|
button2 = 775,453,94,87
|
||||||
button3 = 880,445,94,87
|
button3 = 882,453,94,87
|
||||||
button4 = 989,445,94,87
|
button4 = 989,453,94,87
|
||||||
button5 = 1098,445,94,87
|
button5 = 1097,453,94,87
|
||||||
button6 = 662,545,94,87
|
button6 = 668,547,94,87
|
||||||
button7 = 770,545,94,87
|
button7 = 775,547,94,87
|
||||||
button8 = 880,545,94,87
|
button8 = 882,547,94,87
|
||||||
button9 = 989,545,94,87
|
button9 = 989,547,94,87
|
||||||
button10 = 1098,545,94,87
|
button10 = 1097,547,94,87
|
||||||
|
|
||||||
[NumberSongIDButtonImages]
|
[NumberSongIDButtonImages]
|
||||||
button0_normal = themes\superstar\歌名\編號\VOD_歌名查詢_編號查詢(按鍵)-02.png
|
button0_normal = themes\superstar\歌名\編號\VOD_歌名查詢_編號查詢(按鍵)-02.png
|
||||||
|
@ -176,9 +176,6 @@
|
|||||||
<Compile Update="PrimaryFormParts\SingerSearch\PrimaryForm.SingerSearch.PinyinSearch.cs">
|
<Compile Update="PrimaryFormParts\SingerSearch\PrimaryForm.SingerSearch.PinyinSearch.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Update="PrimaryFormParts\SingerSearch\PrimaryForm.SingerSearch.StrokeCountSearch.cs">
|
|
||||||
<SubType>Form</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Update="PrimaryFormParts\SingerSearch\PrimaryForm.SingerSearch.WordCountSearch.cs">
|
<Compile Update="PrimaryFormParts\SingerSearch\PrimaryForm.SingerSearch.WordCountSearch.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user