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 DBObj;
|
||||
using OverlayFormObj;
|
||||
using NAudio.Wave;
|
||||
namespace DualScreenDemo
|
||||
{
|
||||
public class CommandHandler
|
||||
@ -10,7 +11,7 @@ namespace DualScreenDemo
|
||||
public static bool readyForSongListInput = false;
|
||||
/* 關機 queue */
|
||||
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 _wrongInputCountfor61 = 0; // 錯誤輸入計數器
|
||||
@ -28,7 +29,7 @@ namespace DualScreenDemo
|
||||
{
|
||||
AddToHistory(indata);
|
||||
// 遙控器測試
|
||||
Console.WriteLine("遙控器:" + indata);
|
||||
Console.WriteLine("遙控器: " + indata);
|
||||
switch (indata)
|
||||
{
|
||||
case "A261A4": // 輸入
|
||||
@ -83,6 +84,7 @@ namespace DualScreenDemo
|
||||
ToggleMute();
|
||||
break;
|
||||
case "A274A4":
|
||||
OverlayForm.MainForm.currentPage = 1;
|
||||
HandleArtistAnnouncements();
|
||||
break;
|
||||
case "A2B3A4":
|
||||
@ -301,8 +303,9 @@ namespace DualScreenDemo
|
||||
OverlayForm.displayTimer.Stop();
|
||||
string input = "a";
|
||||
|
||||
|
||||
// 輸入歌曲
|
||||
string songNumber = OverlayForm.ReadSongNumber();
|
||||
//Console.WriteLine("輸入A " + songNumber + " readyForSongListInput : " + readyForSongListInput);
|
||||
var song = songListManager.SearchSongByNumber(songNumber);
|
||||
|
||||
|
||||
@ -314,11 +317,13 @@ namespace DualScreenDemo
|
||||
{
|
||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
||||
{
|
||||
Console.WriteLine("F sign for input :" + input);
|
||||
OverlayForm.MainForm.OnUserInput(input);
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("A sign for input :" + input);
|
||||
OverlayForm.MainForm.OnUserInput(input);
|
||||
}
|
||||
}
|
||||
@ -418,11 +423,13 @@ namespace DualScreenDemo
|
||||
{
|
||||
OverlayForm.MainForm.Invoke(new System.Action(() =>
|
||||
{
|
||||
Console.WriteLine("B sign for input :" + input);
|
||||
OverlayForm.MainForm.OnUserInput(input);
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("C sign for input :" + input);
|
||||
OverlayForm.MainForm.OnUserInput(input);
|
||||
}
|
||||
}
|
||||
@ -558,7 +565,8 @@ namespace DualScreenDemo
|
||||
Console.WriteLine("ClearDisplay called.");
|
||||
|
||||
// 重設狀態標記與 UI 狀態
|
||||
readyForSongListInput = false;
|
||||
// 嘗試 true
|
||||
readyForSongListInput = true;
|
||||
OverlayForm.SetUIState(OverlayForm.UIState.Initial);
|
||||
Console.WriteLine("Display cleared.");
|
||||
}
|
||||
@ -588,13 +596,41 @@ namespace DualScreenDemo
|
||||
// 準備要傳給 UpdateHistoryLabel 的兩個清單:歌曲資料與播放狀態
|
||||
List<SongData> historySongs = new List<SongData>();
|
||||
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]); // 加入歌曲
|
||||
playStates.Add(PrimaryForm.playStates[i]); // 加入狀態 (已播、播放中、未播)
|
||||
for (int i = startIndex; i < endIndex; 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(() =>
|
||||
{
|
||||
Console.WriteLine("D sign for number :" + number);
|
||||
OverlayForm.MainForm.OnUserInput(number);
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("E sign for number :" + number);
|
||||
OverlayForm.MainForm.OnUserInput(number);
|
||||
}
|
||||
|
||||
|
@ -17,14 +17,14 @@ namespace DBObj
|
||||
{
|
||||
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);
|
||||
return searchResults;
|
||||
//return AllArtists.Where(artist => artist.Strokes >= minStrokes && artist.Strokes <= maxStrokes).ToList();
|
||||
}
|
||||
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);
|
||||
return searchResults;
|
||||
//return AllArtists.Where(artist => artist.Category == category && artist.Strokes >= minStrokes && artist.Strokes <= maxStrokes).ToList();
|
||||
|
@ -51,28 +51,28 @@ namespace DBObj
|
||||
}
|
||||
*/
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
public List<SongData> SearchSongsBySinger(string keyword)
|
||||
{
|
||||
Console.WriteLine("keyword : " + keyword);
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
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);
|
||||
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.Sockets;
|
||||
using System.Text;
|
||||
using System.Timers;
|
||||
namespace HeartbeatSender{
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using Microsoft.VisualBasic.Devices;
|
||||
|
||||
namespace HeartbeatSender
|
||||
{
|
||||
|
||||
public class heartbeatSender
|
||||
{
|
||||
private readonly UdpClient udpClient;
|
||||
private readonly IPEndPoint remoteEndPoint;
|
||||
private readonly System.Timers.Timer heartbeatTimer;
|
||||
public IPEndPoint RemoteEndPoint => remoteEndPoint;
|
||||
public heartbeatSender(string targetIp, int targetPort, int intervalMilliseconds = 3000)
|
||||
private readonly HttpClient httpClient = new HttpClient();
|
||||
private string token;
|
||||
private string heartbeatUrl;
|
||||
|
||||
public heartbeatSender(string heartbeatUrl)
|
||||
{
|
||||
udpClient = new UdpClient();
|
||||
// 設置 IP 和 PORT
|
||||
remoteEndPoint = new IPEndPoint(IPAddress.Parse(targetIp), targetPort);
|
||||
// 每3秒發送一次
|
||||
heartbeatTimer = new System.Timers.Timer(intervalMilliseconds);
|
||||
heartbeatTimer.Elapsed += SendHeartbeat;
|
||||
heartbeatTimer.AutoReset = true;
|
||||
this.heartbeatUrl = heartbeatUrl;
|
||||
}
|
||||
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
|
||||
{
|
||||
string heartbeatMessage = "HEARTBEAT";
|
||||
byte[] data = Encoding.UTF8.GetBytes(heartbeatMessage);
|
||||
udpClient.Send(data, data.Length, remoteEndPoint);
|
||||
Console.WriteLine($"Heartbeat sent to {remoteEndPoint.Address}:{remoteEndPoint.Port}");
|
||||
var response = await httpClient.PostAsync(loginUrl, content);
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
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)
|
||||
{
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
@ -474,56 +474,48 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
||||
|
||||
|
||||
private readonly object _lockObject = new object();
|
||||
|
||||
private bool _handlingTimeout = false;
|
||||
private async void UnifiedTimer_Elapsed(object sender, EventArgs e)
|
||||
{
|
||||
// Console.WriteLine("UnifiedTimer_Elapsed called");
|
||||
if (_handlingTimeout) return;
|
||||
_handlingTimeout = true;
|
||||
|
||||
if (MainForm.InvokeRequired)
|
||||
{
|
||||
MainForm.Invoke(new System.Action<object, EventArgs>(UnifiedTimer_Elapsed), new object[] { sender, e });
|
||||
}
|
||||
else
|
||||
{
|
||||
displayLabel.Text = "";
|
||||
|
||||
switch (CurrentUIState)
|
||||
try
|
||||
{
|
||||
case UIState.SelectingLanguage:
|
||||
if (MainForm.InvokeRequired)
|
||||
{
|
||||
MainForm.BeginInvoke((Action)(() => UnifiedTimer_Elapsed(sender, e)));
|
||||
return;
|
||||
}
|
||||
|
||||
SetUIState(UIState.Initial);
|
||||
await HandleTimeout("");
|
||||
break;
|
||||
case UIState.SelectingArtistCategory:
|
||||
SetUIState(UIState.Initial);
|
||||
await HandleTimeout("");
|
||||
break;
|
||||
case UIState.SelectingAction:
|
||||
SetUIState(UIState.Initial);
|
||||
await HandleTimeout("");
|
||||
break;
|
||||
case UIState.SelectingSong:
|
||||
displayLabel.Text = "";
|
||||
|
||||
SetUIState(UIState.Initial);
|
||||
await HandleTimeout("");
|
||||
break;
|
||||
case UIState.SelectingArtist:
|
||||
SetUIState(UIState.Initial);
|
||||
await HandleTimeout("");
|
||||
break;
|
||||
case UIState.PlayHistory:
|
||||
SetUIState(UIState.Initial);
|
||||
await HandleTimeout("");
|
||||
break;
|
||||
switch (CurrentUIState)
|
||||
{
|
||||
case UIState.SelectingLanguage:
|
||||
case UIState.SelectingArtistCategory:
|
||||
case UIState.SelectingAction:
|
||||
case UIState.SelectingSong:
|
||||
case UIState.SelectingArtist:
|
||||
case UIState.PlayHistory:
|
||||
SetUIState(UIState.Initial);
|
||||
await HandleTimeout("");
|
||||
break;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_handlingTimeout = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task HandleTimeout(string message)
|
||||
{
|
||||
Console.WriteLine("HandleTimeout called with message: " + message);
|
||||
unifiedTimer.Stop();
|
||||
SetUIState(UIState.Initial);
|
||||
DisplayMessage(message, 2000);
|
||||
//DisplayMessage(message, 2000);
|
||||
CommandHandler._indataHistory.Clear(); // 清空歷史紀錄
|
||||
await Task.Delay(2000);
|
||||
}
|
||||
|
||||
@ -807,7 +799,6 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
||||
|
||||
public static string ReadSongNumber()
|
||||
{
|
||||
|
||||
string songNumber = MainForm.displayLabel.Text;
|
||||
MainForm.nextSongLabel.Visible = false;
|
||||
return songNumber;
|
||||
@ -883,7 +874,8 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
||||
control != MainForm.nextSongLabel)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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, "點播");
|
||||
@ -1044,7 +1036,7 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
||||
if (songIndex < totalSongs)
|
||||
{
|
||||
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, "插播");
|
||||
@ -1105,7 +1097,7 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
||||
selectedArtist = currentArtistList[artistIndex];
|
||||
currentLanguage = selectedArtist.Name;
|
||||
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 = SongListManager.Instance.GetSongsByArtist(selectedArtist.Name);
|
||||
currentPage = 1;
|
||||
@ -1128,10 +1120,11 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
||||
if (songIndex < totalSongs)
|
||||
{
|
||||
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);
|
||||
//AddSongToPlaylist(selectedSong);
|
||||
|
||||
|
||||
}
|
||||
@ -1280,7 +1273,9 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
||||
}
|
||||
|
||||
// 計算目前這首歌的 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);
|
||||
@ -1295,47 +1290,65 @@ private static void SongDisplayTimer_Elapsed(object sender, EventArgs e)
|
||||
}
|
||||
public void UpdateDisplayLabels(string[] messages)//新歌歌星排行首頁
|
||||
{
|
||||
// 清除舊的圖片控件
|
||||
// 移除畫面上現有的所有 PictureBox(舊的文字圖片)
|
||||
this.Controls.OfType<PictureBox>().ToList().ForEach(p => this.Controls.Remove(p));
|
||||
|
||||
// 如果沒有訊息內容,直接跳出,不進行後續繪製
|
||||
if (messages.Length == 0) return;
|
||||
|
||||
// 設定主標題字體大小
|
||||
int mainTitleFontSize = 60;
|
||||
// 設定選項字體大小
|
||||
int optionFontSize = 50;
|
||||
// 每行之間的垂直間距(像素)
|
||||
int lineSpacing = 15;
|
||||
//int columnSpacing = 400;
|
||||
|
||||
// 主標題
|
||||
// 取得主標題文字(第一行)
|
||||
string mainTitle = messages[0];
|
||||
// 建立主標題用的字型:微軟正黑體、粗體
|
||||
Font mainTitleFont = new Font("Microsoft JhengHei", mainTitleFontSize, FontStyle.Bold);
|
||||
// 使用自定義方法產生主標題的文字圖像(白色字+透明底)
|
||||
Bitmap mainTitleBitmap = GenerateTextImage(mainTitle, mainTitleFont, Color.White, Color.Transparent);
|
||||
// 主標題起始的 Y 座標
|
||||
int startY = 130;
|
||||
// 將主標題圖片水平置中並加入畫面
|
||||
AddCenteredPicture(mainTitleBitmap, startY);
|
||||
// 更新 Y 座標位置,準備繪製下一區塊(選項),加上主標題高度與間距
|
||||
startY += mainTitleBitmap.Height + lineSpacing;
|
||||
|
||||
// 選項
|
||||
// 取得剩下的訊息文字(第二行起):當作選項
|
||||
string[] options = messages.Skip(1).ToArray();
|
||||
// 選項的起始 Y 座標
|
||||
int optionsStartY = startY;
|
||||
// 每欄最多可放幾個項目(以兩欄平均分配)
|
||||
int maxItemsPerColumn = (int)Math.Ceiling(options.Length / 2.0);
|
||||
|
||||
// 設定左右欄的 X 座標(用於放置圖片)
|
||||
int leftColumnX = 200;
|
||||
int rightColumnX = this.Width / 2 + 150;
|
||||
|
||||
// 開始逐一處理每個選項
|
||||
for (int i = 0; i < options.Length; i++)
|
||||
{
|
||||
// 設定每個選項的字型
|
||||
Font optionFont = new Font("Microsoft JhengHei", optionFontSize, FontStyle.Bold);
|
||||
// 建立文字對應的圖像(白色字+透明底)
|
||||
Bitmap optionBitmap = GenerateTextImage(options[i], optionFont, Color.White, Color.Transparent);
|
||||
|
||||
// 根據目前索引,決定放在左欄還是右欄
|
||||
int x = (i < maxItemsPerColumn) ? leftColumnX : rightColumnX;
|
||||
// 決定目前這張圖的 Y 座標位置(依序向下排列)
|
||||
int currentY = optionsStartY + ((i % maxItemsPerColumn) * (optionBitmap.Height + lineSpacing));
|
||||
|
||||
// 加入圖片到畫面上
|
||||
AddPicture(optionBitmap, x, currentY);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private string strokeRange;
|
||||
private int totalArtists = 0;
|
||||
private const int artistsPerPage = 10;
|
||||
private const int artistsPerPage = 8;
|
||||
private List<Artist> currentArtistList = new List<Artist>();
|
||||
|
||||
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));
|
||||
|
||||
int artistsPerColumn = 5;
|
||||
int artistsPerColumn = 4;
|
||||
int startIndex = (page - 1) * artistsPerPage;
|
||||
int endIndex = Math.Min(startIndex + artistsPerPage, artists.Count);
|
||||
|
||||
@ -1482,11 +1495,11 @@ private void DisplayArtists(List<Artist> artists, int page)//歌星點進去後
|
||||
|
||||
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)
|
||||
{
|
||||
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
|
||||
{
|
||||
@ -1643,7 +1656,7 @@ private void DisplayArtists(List<Artist> artists, int page)//歌星點進去後
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 測試
|
||||
public int currentPage = 1;
|
||||
public int songsPerPage = 5;
|
||||
public int totalSongs = 0;
|
||||
|
@ -254,7 +254,7 @@ namespace DualScreenDemo
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ namespace DualScreenDemo
|
||||
/*guoYuSongs = allSongs.Where(song => song.Category == "國語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
|
||||
.OrderByDescending(song => song.Plays)
|
||||
.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);
|
||||
currentPage = 0;
|
||||
currentSongList = guoYuSongs;
|
||||
|
@ -14,7 +14,7 @@ namespace DualScreenDemo
|
||||
/*hanYuSongs = allSongs.Where(song => song.Category == "韓語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
|
||||
.OrderByDescending(song => song.Plays)
|
||||
.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);
|
||||
currentPage = 0;
|
||||
currentSongList = hanYuSongs;
|
||||
|
@ -15,7 +15,7 @@ namespace DualScreenDemo
|
||||
.OrderByDescending(song => song.Plays)
|
||||
.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);
|
||||
currentPage = 0;
|
||||
currentSongList = riYuSongs;
|
||||
|
@ -14,7 +14,7 @@ namespace DualScreenDemo
|
||||
/*taiYuSongs = allSongs.Where(song => song.Category == "台語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
|
||||
.OrderByDescending(song => song.Plays)
|
||||
.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);
|
||||
currentPage = 0;
|
||||
currentSongList = taiYuSongs;
|
||||
|
@ -14,7 +14,7 @@ namespace DualScreenDemo
|
||||
/*yingWenSongs = allSongs.Where(song => song.Category == "英語" && (song.ArtistACategory == "團" || song.ArtistBCategory == "團"))
|
||||
.OrderByDescending(song => song.Plays)
|
||||
.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);
|
||||
currentPage = 0;
|
||||
currentSongList = yingWenSongs;
|
||||
|
@ -15,7 +15,7 @@ namespace DualScreenDemo
|
||||
.OrderByDescending(song => song.Plays)
|
||||
.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);
|
||||
currentPage = 0;
|
||||
currentSongList = yueYuSongs;
|
||||
|
@ -133,7 +133,7 @@ namespace DualScreenDemo
|
||||
.ToList();*/
|
||||
/* 清空搜尋欄 */
|
||||
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);
|
||||
currentPage = 0;
|
||||
currentSongList = guoYuSongs;
|
||||
|
@ -63,12 +63,12 @@ namespace DualScreenDemo
|
||||
/* 清空搜尋欄 */
|
||||
ResetinputBox();
|
||||
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);
|
||||
UpdateSongList(guoYuSongs);
|
||||
|
||||
SetButtonsVisibility();
|
||||
HideQRCode();
|
||||
//HideQRCode();
|
||||
}
|
||||
|
||||
private void UpdateButtonBackgrounds(Button activeButton, Image activeBackground)
|
||||
@ -92,7 +92,7 @@ namespace DualScreenDemo
|
||||
UpdateHotSongButtons(activeButton, activeBackground);
|
||||
|
||||
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);
|
||||
|
||||
UpdateSongList(selectedSongs);
|
||||
|
@ -8,7 +8,7 @@ namespace DualScreenDemo
|
||||
UpdateHotSongButtons(guoYuNewSongButtonHotSong, guoYuNewSongHotSongActiveBackground);
|
||||
|
||||
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);
|
||||
|
||||
currentPage = 0;
|
||||
|
@ -9,7 +9,7 @@ namespace DualScreenDemo
|
||||
|
||||
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);
|
||||
|
||||
currentPage = 0;
|
||||
|
@ -252,7 +252,7 @@ namespace DualScreenDemo
|
||||
return 100;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ namespace DualScreenDemo
|
||||
else
|
||||
{
|
||||
showError = true;
|
||||
isPhoneNumberValid = true;
|
||||
isPhoneNumberValid = false;
|
||||
FavoritePictureBox.Invalidate();
|
||||
FavoritePictureBox.Refresh();
|
||||
}
|
||||
@ -254,7 +254,7 @@ namespace DualScreenDemo
|
||||
if (checkPhoneNumberExist(mobileNumber))
|
||||
{
|
||||
isPhoneNumberValid = true;
|
||||
var searchResults = SearchSongs_Mysql(SearchFavoriteSongs_Mysql());
|
||||
var searchResults = SearchSongs_Mysql(SearchFavoriteSongs_Mysql());
|
||||
// 重置分頁
|
||||
currentPage = 0;
|
||||
currentSongList = searchResults;
|
||||
@ -267,22 +267,35 @@ namespace DualScreenDemo
|
||||
}
|
||||
else
|
||||
{
|
||||
/*isPhoneNumberValid = true;
|
||||
SongListManager.Instance.AddNewUser(mobileNumber);
|
||||
SongListManager.Instance.UserLogin(mobileNumber);
|
||||
isPhoneNumberValid = true;
|
||||
InsertNewFavoriteUser(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
|
||||
{
|
||||
showError = true;
|
||||
isPhoneNumberValid = true;
|
||||
isPhoneNumberValid = false;
|
||||
FavoritePictureBox.Invalidate();
|
||||
FavoritePictureBox.Refresh();
|
||||
}
|
||||
|
@ -6,14 +6,50 @@ using System.Diagnostics;
|
||||
namespace DualScreenDemo{
|
||||
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 string userPhone = string.Empty;
|
||||
public List<SongData> SearchSongs_Mysql(string query)
|
||||
{
|
||||
List<SongData> searchResults = new List<SongData>();
|
||||
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))
|
||||
{
|
||||
Stopwatch stopwatch = new Stopwatch();
|
||||
@ -65,8 +101,8 @@ namespace DualScreenDemo{
|
||||
public static List<Artist> SearchSingers_Mysql(string query){
|
||||
List<Artist> searchResults = new List<Artist>();
|
||||
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))
|
||||
{
|
||||
Stopwatch stopwatch = new Stopwatch();
|
||||
@ -100,8 +136,8 @@ namespace DualScreenDemo{
|
||||
|
||||
string query = $"INSERT INTO FavoriteSongs (userPhone,songNumber) VALUES ('{userPhone}','{songNumber}');";
|
||||
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))
|
||||
{
|
||||
|
||||
@ -124,9 +160,38 @@ namespace DualScreenDemo{
|
||||
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 " +
|
||||
"sl.*"+
|
||||
"sl.*" +
|
||||
"FROM FavoriteSongs fs " +
|
||||
"JOIN song_library_cache sl ON fs.songNumber = sl.song_id " +
|
||||
$"WHERE fs.userPhone = '{userPhone}';";
|
||||
@ -134,32 +199,36 @@ namespace DualScreenDemo{
|
||||
|
||||
}
|
||||
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;
|
||||
using (var connection = new MySqlConnection(connectionString))
|
||||
{
|
||||
connection.Open();
|
||||
Console.WriteLine("MyDB 連線成功!");
|
||||
string query = $"SELECT COUNT(*) FROM FavoriteSongs WHERE userPhone = '{phonenumber}'";
|
||||
using (var command = new MySqlCommand(query, connection)){
|
||||
int count = Convert.ToInt32(command.ExecuteScalar());
|
||||
if (count > 0)
|
||||
{
|
||||
exists = true; // 存在
|
||||
userPhone= phonenumber;
|
||||
isLoggedIn = true;
|
||||
//點歌我的最愛按鈕,調整按鈕狀態
|
||||
favoriteButton.Enabled = true;
|
||||
favoriteButton.BackColor = Color.Transparent;
|
||||
disabledPanel.Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
exists = false; // 不存在
|
||||
}
|
||||
string query = $"SELECT COUNT(*) FROM FavoriteSongs WHERE userPhone = '{phonenumber}';";
|
||||
using (var command = new MySqlCommand(query, connection))
|
||||
{
|
||||
int count = Convert.ToInt32(command.ExecuteScalar());
|
||||
if (count > 0)
|
||||
{
|
||||
exists = true; // 存在
|
||||
userPhone = phonenumber;
|
||||
isLoggedIn = true;
|
||||
//點歌我的最愛按鈕,調整按鈕狀態
|
||||
favoriteButton.Enabled = true;
|
||||
favoriteButton.BackColor = Color.Transparent;
|
||||
disabledPanel.Visible = false;
|
||||
this.Invalidate();
|
||||
}
|
||||
else
|
||||
{
|
||||
exists = false; // 不存在
|
||||
}
|
||||
}
|
||||
connection.Close();
|
||||
Console.WriteLine("MyDB 連線關閉!");
|
||||
|
||||
}
|
||||
return exists;
|
||||
}
|
||||
@ -178,10 +247,10 @@ namespace DualScreenDemo{
|
||||
}
|
||||
|
||||
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);
|
||||
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))
|
||||
{
|
||||
|
||||
|
@ -133,7 +133,7 @@ namespace DualScreenDemo
|
||||
private void AlbumButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
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 = allSongs.Where(song => song.ArtistA == currentSelectedSong.ArtistA)
|
||||
.OrderByDescending(song => song.AddedTime)
|
||||
|
@ -234,10 +234,12 @@ namespace DualScreenDemo
|
||||
SaveInitialControlStates(this);
|
||||
// 包廂 + port 名稱
|
||||
this.Paint += PrimaryForm_Paint;
|
||||
this.Paint += User_Paint;
|
||||
// 註冊多頁面面板的頁碼改變事件處理
|
||||
multiPagePanel.PageIndexChanged += HandlePageChanged;
|
||||
// 添加 Load 事件處理
|
||||
this.Load += PrimaryForm_Load;
|
||||
LoadConnectionStringFromFile("test.env");
|
||||
|
||||
}
|
||||
|
||||
@ -302,7 +304,36 @@ namespace DualScreenDemo
|
||||
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)
|
||||
{
|
||||
sequenceManager.ProcessClick("巨");
|
||||
|
@ -177,7 +177,7 @@ namespace DualScreenDemo
|
||||
// 例如:根據輸入框的內容搜尋歌曲
|
||||
string query = string.IsNullOrWhiteSpace(searchText)
|
||||
? "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}%' ";
|
||||
|
||||
var searchResults = SearchSingers_Mysql(query);
|
||||
|
@ -541,7 +541,7 @@ namespace DualScreenDemo
|
||||
if (int.TryParse(searchText, out int length))
|
||||
{
|
||||
//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);
|
||||
// 設定當前頁數為 0,並加載搜索結果
|
||||
currentPage = 0;
|
||||
|
@ -37,7 +37,7 @@ namespace DualScreenDemo
|
||||
isOnOrderedSongsPage = false;
|
||||
/* 清空搜尋欄 */
|
||||
ResetinputBox();
|
||||
string query = $"SELECT * FROM artists WHERE category = '男' LIMIT 100";
|
||||
string query = $"SELECT * FROM artists WHERE category = '男' LIMIT 100 ;";
|
||||
var searchResult = SearchSingers_Mysql(query);
|
||||
currentPage = 0;
|
||||
currentArtistList = searchResult;
|
||||
|
@ -550,7 +550,7 @@ namespace DualScreenDemo
|
||||
// 如果輸入框為空,則不進行搜尋
|
||||
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);
|
||||
// 重置分頁
|
||||
|
@ -477,7 +477,7 @@ namespace DualScreenDemo
|
||||
string query;
|
||||
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
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ namespace DualScreenDemo
|
||||
isOnOrderedSongsPage = false;
|
||||
|
||||
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);
|
||||
currentPage = 0;
|
||||
currentSongList = searchResult;
|
||||
|
157
Program.cs
157
Program.cs
@ -2,6 +2,7 @@ using System.IO;
|
||||
using Microsoft.Win32;
|
||||
using System.Diagnostics;
|
||||
using DBObj;
|
||||
using HeartbeatSender;
|
||||
|
||||
namespace DualScreenDemo
|
||||
{
|
||||
@ -14,76 +15,102 @@ namespace DualScreenDemo
|
||||
private static PrimaryForm primaryForm; // 儲存實例的參考
|
||||
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
try
|
||||
{
|
||||
// COM 初始化
|
||||
int hr = ComInterop.CoInitializeEx(IntPtr.Zero, ComInterop.COINIT_APARTMENTTHREADED);
|
||||
if (hr < 0)
|
||||
static void Main()
|
||||
{
|
||||
Console.WriteLine("Failed to initialize COM library.");
|
||||
return;
|
||||
}
|
||||
// 初始化管理器
|
||||
Console.WriteLine("正在與中控取得聯繫");
|
||||
var sender = new HeartbeatSender.heartbeatSender("http://zqd.superstar.dnsnet.cc/api/room/receiveRegister");
|
||||
|
||||
songListManager = new SongListManager(); // 使用单例
|
||||
//artistManager = new ArtistManager();
|
||||
// 同步呼叫非同步登入取得 token
|
||||
bool loginSuccess = sender.LoginAndGetTokenAsync().GetAwaiter().GetResult();
|
||||
|
||||
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) =>
|
||||
if (loginSuccess)
|
||||
{
|
||||
primaryForm.ShowSendOffScreen();
|
||||
};
|
||||
}
|
||||
// 先送一次心跳 (同步呼叫)
|
||||
sender.SendHeartbeatAsync().GetAwaiter().GetResult();
|
||||
|
||||
primaryForm.Show();
|
||||
Application.Run(primaryForm);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
WriteLog(ex.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
SystemEvents.DisplaySettingsChanged -= OnDisplaySettingsChanged;
|
||||
}
|
||||
// 背景持續每3秒送心跳
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
await sender.SendHeartbeatAsync();
|
||||
await Task.Delay(300000); // 每3秒送一次
|
||||
}
|
||||
});
|
||||
}
|
||||
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 () =>
|
||||
{
|
||||
PrimaryForm.Instance.ShowSendOffScreen();
|
||||
|
||||
_ = SafeInvoke(PrimaryForm.Instance, () =>
|
||||
{
|
||||
string marqueeMessage= "歡迎使用超級巨星歡唱網路版系統,與你共度美好時光。";
|
||||
OverlayForm.MainForm.UpdateMarqueeText(marqueeMessage, OverlayForm.MarqueeStartPosition.Middle, Color.White);
|
||||
});
|
||||
Console.WriteLine("開始設置新的播放列表");
|
||||
|
||||
string closePath = @"C:\video\CLOSE.MPG";
|
||||
@ -215,10 +219,12 @@ namespace DualScreenDemo
|
||||
OverlayForm.MainForm.UpdateMarqueeText(marqueeMessage, OverlayForm.MarqueeStartPosition.Middle, Color.White);
|
||||
});
|
||||
// 開台時跳至首頁
|
||||
PrimaryForm.Instance.HotPlayButton_Click(null, EventArgs.Empty);
|
||||
|
||||
VideoPlayerForm.publicPlaylist = new List<SongData>();
|
||||
VideoPlayerForm.playingSongList = new List<SongData>();
|
||||
VideoPlayerForm.Instance.PlayPublicPlaylist();
|
||||
PrimaryForm.currentSongIndexInHistory = -1;
|
||||
PrimaryForm.Instance.HotPlayButton_Click(null, EventArgs.Empty);
|
||||
UpdateStateFile(stateFilePath, "OPEN");
|
||||
|
||||
byte[] okResponse = Encoding.UTF8.GetBytes("OK\n");
|
||||
|
@ -760,7 +760,10 @@ namespace DualScreenDemo
|
||||
}
|
||||
|
||||
|
||||
// 可以取得 燈控/聲控 的位置
|
||||
var songToPlay = currentPlaylist[currentSongIndex];
|
||||
|
||||
// pathToPlay 需要調整
|
||||
var pathToPlay = File.Exists(songToPlay.SongFilePathHost1) ? songToPlay.SongFilePathHost1 : songToPlay.SongFilePathHost2;
|
||||
|
||||
// 若兩個 host 上都找不到檔案就直接結束
|
||||
|
189
config.ini
189
config.ini
@ -51,46 +51,46 @@ Height = 394
|
||||
Symbols=ㄅ,ㄉ,ㄍ,ㄐ,ㄓ,ㄗ,ㄛ,ㄡ,ㄤ,ㄧ,ㄆ,ㄊ,ㄎ,ㄑ,ㄔ,ㄘ,ㄜ,ㄢ,ㄦ,ㄨ,ㄇ,ㄋ,ㄏ,ㄒ,ㄕ,ㄙ,ㄞ,ㄣ,ㄩ,ㄈ,ㄌ, ,ㄖ,ㄚ,ㄠ
|
||||
|
||||
[PhoneticButtonCoordinates]
|
||||
button1 = 150,342,93,86
|
||||
button2 = 255,342,93,86
|
||||
button3 = 359,342,93,86
|
||||
button4 = 463,342,93,86
|
||||
button5 = 567,341,93,87
|
||||
button6 = 671,341,93,86
|
||||
button7 = 775,341,93,86
|
||||
button8 = 879,340,93,86
|
||||
button9 = 984,340,93,86
|
||||
button10 = 1088,340,93,86
|
||||
button11 = 151,436,93,86
|
||||
button12 = 255,436,93,86
|
||||
button13 = 359,436,93,86
|
||||
button14 = 463,436,93,86
|
||||
button15 = 567,435,93,86
|
||||
button16 = 671,436,93,86
|
||||
button17 = 775,436,93,86
|
||||
button18 = 879,436,93,86
|
||||
button19 = 984,436,93,86
|
||||
button20 = 1088,436,93,86
|
||||
button21 = 203,532,93,86
|
||||
button22 = 307,532,93,86
|
||||
button23 = 411,532,93,86
|
||||
button24 = 515,532,93,86
|
||||
button25 = 619,531,93,86
|
||||
button26 = 723,532,93,86
|
||||
button27 = 827,532,93,86
|
||||
button28 = 931,532,93,86
|
||||
button29 = 1035,532,93,86
|
||||
button30 = 255,628,93,86
|
||||
button31 = 359,628,93,86
|
||||
button32 = 463,628,202,86
|
||||
button33 = 676,628,93,86
|
||||
button34 = 780,628,93,86
|
||||
button35 = 884,628,93,86
|
||||
button1 = 150,338,93,86
|
||||
button2 = 255,338,93,86
|
||||
button3 = 359,338,93,86
|
||||
button4 = 463,338,93,86
|
||||
button5 = 567,338,93,87
|
||||
button6 = 671,338,93,86
|
||||
button7 = 775,338,93,86
|
||||
button8 = 879,338,93,86
|
||||
button9 = 984,338,93,86
|
||||
button10 = 1088,338,93,86
|
||||
button11 = 151,434,93,86
|
||||
button12 = 255,434,93,86
|
||||
button13 = 359,434,93,86
|
||||
button14 = 463,434,93,86
|
||||
button15 = 567,434,93,86
|
||||
button16 = 671,434,93,86
|
||||
button17 = 775,434,93,86
|
||||
button18 = 879,434,93,86
|
||||
button19 = 984,434,93,86
|
||||
button20 = 1088,434,93,86
|
||||
button21 = 203,530,93,86
|
||||
button22 = 307,530,93,86
|
||||
button23 = 411,530,93,86
|
||||
button24 = 515,530,93,86
|
||||
button25 = 619,530,93,86
|
||||
button26 = 723,530,93,86
|
||||
button27 = 827,530,93,86
|
||||
button28 = 931,530,93,86
|
||||
button29 = 1035,530,93,86
|
||||
button30 = 255,624,93,86
|
||||
button31 = 359,624,93,86
|
||||
button32 = 463,624,202,86
|
||||
button33 = 676,624,93,86
|
||||
button34 = 780,624,93,86
|
||||
button35 = 884,624,93,86
|
||||
|
||||
[SpecialButtonCoordinates]
|
||||
modifyButtonZhuYinSingers = 989,627,94,87
|
||||
clearButtonZhuYinSingers = 151,627,93,87
|
||||
closeButtonZhuYinSingers = 1093,627,94,87
|
||||
modifyButtonZhuYinSingers = 989,624,94,87
|
||||
clearButtonZhuYinSingers = 151,624,93,87
|
||||
closeButtonZhuYinSingers = 1093,624,94,87
|
||||
modifyButtonEnglishSingers = 1032,633,70,66
|
||||
clearButtonEnglishSingers = 408,633,70,66
|
||||
closeButtonEnglishSingers = 1110,633,70,66
|
||||
@ -100,12 +100,12 @@ closeButtonPinYinSingers = 1091,642,94,87
|
||||
refillButtonHandWritingSingers = 918,372,70,65
|
||||
clearButtonHandWritingSingers = 996,372,70,65
|
||||
closeButtonForSingers = 1074,372,70,65
|
||||
modifyButtonZhuYinSongs = 989,627,94,87
|
||||
clearButtonZhuYinSongs = 151,627,93,87
|
||||
closeButtonZhuYinSongs = 1093,627,94,87
|
||||
modifyButtonEnglishSongs = 1032,633,70,66
|
||||
clearButtonEnglishSongs = 408,633,70,66
|
||||
closeButtonEnglishSongs = 1110,633,70,66
|
||||
modifyButtonZhuYinSongs = 989,624,94,87
|
||||
clearButtonZhuYinSongs = 151,624,93,87
|
||||
closeButtonZhuYinSongs = 1093,624,94,87
|
||||
modifyButtonEnglishSongs = 1032,631,70,66
|
||||
clearButtonEnglishSongs = 408,631,70,66
|
||||
closeButtonEnglishSongs = 1110,631,70,66
|
||||
modifyButtonPinYinSongs = 987,642,94,87
|
||||
clearButtonPinYinSongs = 154,642,94,87
|
||||
closeButtonPinYinSongs = 1091,642,94,87
|
||||
@ -118,9 +118,9 @@ closeButtonWordCountSongs = 1088,624,72,67
|
||||
modifyButtonWordCountSingers = 926,624,72,67
|
||||
clearButtonWordCountSingers = 845,624,72,67
|
||||
closeButtonWordCountSingers = 1088,624,72,67
|
||||
modifyButtonSongIDSearch = 811,643,94,87
|
||||
clearButtonSongIDSearch = 692,643,93,87
|
||||
closeButtonSongIDSearch = 1051,643,94,87
|
||||
modifyButtonSongIDSearch = 829,643,94,87
|
||||
clearButtonSongIDSearch = 722,643,93,87
|
||||
closeButtonSongIDSearch = 1043,643,94,87
|
||||
|
||||
|
||||
[ModifyButtonImagesZhuYin]
|
||||
@ -141,7 +141,7 @@ mouseDown = themes\superstar\歌星\注音\VOD_歌星查詢_注音查詢(按鍵)
|
||||
[InputBoxZhuYinSingers]
|
||||
X=150
|
||||
Y=264
|
||||
Width=596
|
||||
Width=605
|
||||
Height=63
|
||||
FontName=微軟正黑體
|
||||
FontSize=26
|
||||
@ -300,32 +300,32 @@ button9_mouseDown = themes\superstar\歌星\英文\VOD_歌星查詢_英文查詢
|
||||
button9_mouseOver = themes\superstar\歌星\英文\VOD_歌星查詢_英文查詢(按鍵)-12.png
|
||||
|
||||
[EnglishLetterButtonCoordinates]
|
||||
button0 = 408,490,70,66
|
||||
button1 = 486,490,70,66
|
||||
button2 = 564,490,70,66
|
||||
button3 = 642,490,70,66
|
||||
button0 = 408,489,70,66
|
||||
button1 = 486,489,70,66
|
||||
button2 = 564,489,70,66
|
||||
button3 = 642,489,70,66
|
||||
button4 = 720,489,70,66
|
||||
button5 = 798,490,70,66
|
||||
button6 = 876,490,70,66
|
||||
button7 = 954,490,70,66
|
||||
button8 = 1033,490,70,66
|
||||
button9 = 1111,490,70,66
|
||||
button10 = 449,561,70,66
|
||||
button11 = 527,561,70,66
|
||||
button12 = 605,561,70,66
|
||||
button13 = 683,561,70,66
|
||||
button14 = 761,561,70,66
|
||||
button15 = 839,561,70,66
|
||||
button16 = 917,561,70,66
|
||||
button17 = 995,561,70,66
|
||||
button18 = 1073,561,70,66
|
||||
button19 = 486,633,70,66
|
||||
button20 = 564,633,70,66
|
||||
button21 = 642,633,70,66
|
||||
button22 = 720,634,70,66
|
||||
button23 = 798,633,70,66
|
||||
button24 = 876,633,70,66
|
||||
button25 = 954,633,70,66
|
||||
button5 = 798,489,70,66
|
||||
button6 = 876,489,70,66
|
||||
button7 = 953,489,70,66
|
||||
button8 = 1032,489,70,66
|
||||
button9 = 1110,489,70,66
|
||||
button10 = 449,560,70,66
|
||||
button11 = 527,560,70,66
|
||||
button12 = 605,560,70,66
|
||||
button13 = 683,560,70,66
|
||||
button14 = 761,560,70,66
|
||||
button15 = 838,560,70,66
|
||||
button16 = 916,560,70,66
|
||||
button17 = 994,560,70,66
|
||||
button18 = 1072,560,70,66
|
||||
button19 = 486,631,70,66
|
||||
button20 = 564,631,70,66
|
||||
button21 = 642,631,70,66
|
||||
button22 = 720,631,70,66
|
||||
button23 = 798,631,70,66
|
||||
button24 = 876,631,70,66
|
||||
button25 = 954,631,70,66
|
||||
|
||||
[EnglishLetterButtonImages]
|
||||
button0_normal = themes\superstar\歌星\英文\VOD_歌星查詢_英文查詢(按鍵)-13.png
|
||||
@ -423,9 +423,9 @@ mouseOver = themes\superstar\歌星\英文\VOD_歌星查詢_英文查詢(按鍵)
|
||||
mouseDown = themes\superstar\歌星\英文\VOD_歌星查詢_英文查詢(按鍵)-80.png
|
||||
|
||||
[InputBoxEnglishSingers]
|
||||
X = 408
|
||||
Y = 361
|
||||
Width = 444
|
||||
X = 409
|
||||
Y = 360
|
||||
Width = 478
|
||||
Height = 47
|
||||
FontName = Times New Roman
|
||||
FontSize = 26
|
||||
@ -460,6 +460,7 @@ button23 = 674,642,94,87
|
||||
button24 = 778,642,94,87
|
||||
button25 = 882,642,94,87
|
||||
|
||||
|
||||
[PinYinLetterButtonImages]
|
||||
button0_normal = themes\superstar\歌星\拼音\VOD_歌星查詢_拼音查詢(按鍵)-03.png
|
||||
button0_mouseDown = themes\superstar\歌星\拼音\VOD_歌星查詢_拼音查詢(按鍵)-32.png
|
||||
@ -556,9 +557,9 @@ mouseOver = themes\superstar\歌星\拼音\VOD_歌星查詢_拼音查詢(按鍵)
|
||||
mouseDown = themes\superstar\歌星\拼音\VOD_歌星查詢_拼音查詢(按鍵)-60.png
|
||||
|
||||
[InputBoxPinYinSingers]
|
||||
X = 154
|
||||
X = 156
|
||||
Y = 370
|
||||
Width = 593
|
||||
Width = 628
|
||||
Height = 63
|
||||
FontName = Times New Roman
|
||||
FontSize = 26
|
||||
@ -591,9 +592,9 @@ FontStyle=Bold
|
||||
ForeColor=Black
|
||||
|
||||
[InputBoxEnglishSongs]
|
||||
X = 408
|
||||
Y = 361
|
||||
Width = 444
|
||||
X = 409
|
||||
Y = 360
|
||||
Width = 478
|
||||
Height = 47
|
||||
FontName = Times New Roman
|
||||
FontSize = 26
|
||||
@ -601,9 +602,9 @@ FontStyle = Regular
|
||||
ForeColor = Black
|
||||
|
||||
[InputBoxPinYinSongs]
|
||||
X = 154
|
||||
X = 156
|
||||
Y = 370
|
||||
Width = 593
|
||||
Width = 628
|
||||
Height = 63
|
||||
FontName = Times New Roman
|
||||
FontSize = 26
|
||||
@ -697,7 +698,7 @@ Height = 442
|
||||
|
||||
[InputBoxSongIDSearch]
|
||||
X = 660
|
||||
Y = 370
|
||||
Y = 380
|
||||
Width = 530
|
||||
Height = 63
|
||||
FontName = Times New Roman
|
||||
@ -710,16 +711,16 @@ Symbols=1,2,3,4,5,6,7,8,9,0
|
||||
|
||||
[NumberSongIDButtonCoordinates]
|
||||
button0 = 650,300,94,87
|
||||
button1 = 662,445,94,87
|
||||
button2 = 770,445,94,87
|
||||
button3 = 880,445,94,87
|
||||
button4 = 989,445,94,87
|
||||
button5 = 1098,445,94,87
|
||||
button6 = 662,545,94,87
|
||||
button7 = 770,545,94,87
|
||||
button8 = 880,545,94,87
|
||||
button9 = 989,545,94,87
|
||||
button10 = 1098,545,94,87
|
||||
button1 = 668,453,94,87
|
||||
button2 = 775,453,94,87
|
||||
button3 = 882,453,94,87
|
||||
button4 = 989,453,94,87
|
||||
button5 = 1097,453,94,87
|
||||
button6 = 668,547,94,87
|
||||
button7 = 775,547,94,87
|
||||
button8 = 882,547,94,87
|
||||
button9 = 989,547,94,87
|
||||
button10 = 1097,547,94,87
|
||||
|
||||
[NumberSongIDButtonImages]
|
||||
button0_normal = themes\superstar\歌名\編號\VOD_歌名查詢_編號查詢(按鍵)-02.png
|
||||
|
@ -176,9 +176,6 @@
|
||||
<Compile Update="PrimaryFormParts\SingerSearch\PrimaryForm.SingerSearch.PinyinSearch.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="PrimaryFormParts\SingerSearch\PrimaryForm.SingerSearch.StrokeCountSearch.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="PrimaryFormParts\SingerSearch\PrimaryForm.SingerSearch.WordCountSearch.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
Loading…
x
Reference in New Issue
Block a user