2509011747
This commit is contained in:
parent
9d5ab28d96
commit
5cb15a9422
@ -2,7 +2,6 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using NAudio.Wave;
|
||||
using Microsoft.Ink;
|
||||
using System.Text.RegularExpressions;
|
||||
using DBObj;
|
||||
using OverlayFormObj;
|
||||
using Timer = System.Windows.Forms.Timer;
|
||||
@ -10,10 +9,8 @@ using IniParser.Model;
|
||||
using IniParser;
|
||||
using System.Text;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using LibVLCSharp.WinForms;
|
||||
|
||||
|
||||
namespace DualScreenDemo
|
||||
{
|
||||
public partial class PrimaryForm : Form
|
||||
@ -80,88 +77,45 @@ namespace DualScreenDemo
|
||||
private Button btnSimplifiedChinese;
|
||||
private Button btnTraditionalChinese;
|
||||
private Button exitButton;
|
||||
//private static Bitmap normalStateImage;
|
||||
//private static Bitmap mouseOverImage;
|
||||
//private static Bitmap mouseDownImage;
|
||||
//private static Bitmap resizedNormalStateImage;
|
||||
//private static Bitmap resizedMouseOverImage;
|
||||
//private static Bitmap resizedMouseDownImage;
|
||||
//private static Bitmap normalStateImageNewSongAlert;
|
||||
//private static Bitmap mouseOverImageNewSongAlert;
|
||||
//private static Bitmap mouseDownImageNewSongAlert;
|
||||
//private static Bitmap resizedNormalStateImageForNewSongAlert;
|
||||
//private static Bitmap resizedMouseOverImageForNewSongAlert;
|
||||
//private static Bitmap resizedMouseDownImageForNewSongAlert;
|
||||
//private static Bitmap normalStateImageArtistQuery;
|
||||
//private static Bitmap mouseOverImageArtistQuery;
|
||||
//private static Bitmap mouseDownImageArtistQuery;
|
||||
//private static Bitmap resizedNormalStateImageForArtistQuery;
|
||||
//private static Bitmap resizedMouseOverImageForArtistQuery;
|
||||
//private static Bitmap resizedMouseDownImageForArtistQuery;
|
||||
//private static Bitmap normalStateImageSongQuery;
|
||||
//private static Bitmap mouseOverImageSongQuery;
|
||||
//private static Bitmap mouseDownImageSongQuery;
|
||||
//private static Bitmap resizedNormalStateImageForSongQuery;
|
||||
//private static Bitmap resizedMouseOverImageForSongQuery;
|
||||
//private static Bitmap resizedMouseDownImageForSongQuery;
|
||||
//private static Bitmap normalStateImageLanguageQuery;
|
||||
//private static Bitmap mouseOverImageLanguageQuery;
|
||||
//private static Bitmap mouseDownImageLanguageQuery;
|
||||
//private static Bitmap resizedNormalStateImageForLanguageQuery;
|
||||
//private static Bitmap resizedMouseOverImageForLanguageQuery;
|
||||
//private static Bitmap resizedMouseDownImageForLanguageQuery;
|
||||
//private static Bitmap normalStateImageCategoryQuery;
|
||||
//private static Bitmap mouseOverImageCategoryQuery;
|
||||
//private static Bitmap mouseDownImageCategoryQuery;
|
||||
//private static Bitmap resizedNormalStateImageForCategoryQuery;
|
||||
//private static Bitmap resizedMouseOverImageForCategoryQuery;
|
||||
//private static Bitmap resizedMouseDownImageForCategoryQuery;
|
||||
//private static Bitmap normalStateImageForPromotionsAndMenu;
|
||||
//private static Bitmap resizedNormalStateImageForPromotionsAndMenu;
|
||||
//private static Bitmap normalStateImageForSyncScreen;
|
||||
//private static Bitmap resizedNormalStateImageForSyncScreen;
|
||||
//private static Bitmap normalStateImageForSceneSoundEffects;
|
||||
//private static Bitmap resizedNormalStateImageForSceneSoundEffects;
|
||||
//private static Bitmap normalStateImageForLightControl;
|
||||
//private static Bitmap resizedNormalStateImageForLightControl;
|
||||
public VideoPlayerForm videoPlayerForm;
|
||||
public List<Artist> currentArtistList;
|
||||
public MultiPagePanel multiPagePanel;
|
||||
private List<Label> songLabels = new List<Label>();
|
||||
private int _currentPage { get; set; } = 0;
|
||||
private int _totalPages { get; set; }
|
||||
public VideoView videoView0 = new VideoView() { Dock = DockStyle.Fill};
|
||||
public VideoView videoView1 = new VideoView() { Dock = DockStyle.Fill};
|
||||
public VideoView videoView0 = new VideoView() { Dock = DockStyle.Fill };
|
||||
public VideoView videoView1 = new VideoView() { Dock = DockStyle.Fill };
|
||||
|
||||
// string serverPath = Utils.Env.GetPath("", "");
|
||||
string serverPath = Application.StartupPath;
|
||||
public List<Control> _StartupcontrolsTop= new List<Control>();
|
||||
public List<Control> _StartupcontrolsBottom= new List<Control>();
|
||||
//async Task<Bitmap> GetBitmapFromUriAsync(Uri uri)
|
||||
//{
|
||||
// using HttpClient client = new HttpClient();
|
||||
// byte[] imageBytes = await client.GetByteArrayAsync(uri);
|
||||
|
||||
//async Task<Bitmap> GetBitmapFromUriAsync(Uri uri)
|
||||
//{
|
||||
// using HttpClient client = new HttpClient();
|
||||
// byte[] imageBytes = await client.GetByteArrayAsync(uri);
|
||||
// MemoryStream ms = new MemoryStream(imageBytes);
|
||||
// Bitmap bitmap = new Bitmap(ms);
|
||||
// Bitmap clonedBitmap = new Bitmap(bitmap);
|
||||
// ms.Dispose();
|
||||
|
||||
// MemoryStream ms = new MemoryStream(imageBytes);
|
||||
// Bitmap bitmap = new Bitmap(ms);
|
||||
// Bitmap clonedBitmap = new Bitmap(bitmap);
|
||||
// ms.Dispose();
|
||||
// return clonedBitmap;
|
||||
//}
|
||||
|
||||
// return clonedBitmap;
|
||||
//}
|
||||
|
||||
|
||||
//private async void LoadBackgroundImage()
|
||||
//{
|
||||
// var data = LoadBtnConfigData();
|
||||
// var hostdata = LoadBtnConfigData();
|
||||
// string test1 = hostdata["HeartBeatUrl"] + "/" + data["PrimaryFormBtn"]["AlertNormal1"];
|
||||
// Console.WriteLine(test1);
|
||||
// Uri remoteUri = new Uri("http://zqd.superstar.dnsnet.cc/themes/superstar/button/1.主類別/主類別上方_新歌快報(未按).png");
|
||||
//private async void LoadBackgroundImage()
|
||||
//{
|
||||
// var data = LoadBtnConfigData();
|
||||
// var hostdata = LoadBtnConfigData();
|
||||
// string test1 = hostdata["HeartBeatUrl"] + "/" + data["PrimaryFormBtn"]["AlertNormal1"];
|
||||
// Console.WriteLine(test1);
|
||||
// Uri remoteUri = new Uri("http://zqd.superstar.dnsnet.cc/themes/superstar/button/1.主類別/主類別上方_新歌快報(未按).png");
|
||||
|
||||
// Bitmap bitmap = await GetBitmapFromUriAsync(remoteUri);
|
||||
// this.BackgroundImage = bitmap;
|
||||
// this.BackgroundImageLayout = ImageLayout.Stretch; // Optional
|
||||
//}
|
||||
// Bitmap bitmap = await GetBitmapFromUriAsync(remoteUri);
|
||||
// this.BackgroundImage = bitmap;
|
||||
// this.BackgroundImageLayout = ImageLayout.Stretch; // Optional
|
||||
//}
|
||||
|
||||
public int currentPage
|
||||
{
|
||||
@ -182,40 +136,27 @@ namespace DualScreenDemo
|
||||
public const int itemsPerPage = 16;
|
||||
private WaveInEvent waveIn;
|
||||
private WaveFileWriter waveWriter;
|
||||
|
||||
private const int PanelStartLeft = 25; // 修改為實際需要的左邊距
|
||||
private const int PanelStartTop = 227; // 修改為實際需要的上邊距
|
||||
private const int PanelEndLeft = 1175; // 修改為實際需要的右邊界
|
||||
private const int PanelEndTop = 739; // 修改為實際需要的下邊界
|
||||
|
||||
private Timer lightControlTimer;
|
||||
|
||||
private SequenceManager sequenceManager = new SequenceManager();
|
||||
private PictureBox buttonMiddle;
|
||||
private PictureBox buttonTopRight;
|
||||
private PictureBox buttonTopLeft;
|
||||
private PictureBox buttonThanks;
|
||||
|
||||
private Dictionary<Control, (Point Location, bool Visible)> initialControlStates = new Dictionary<Control, (Point Location, bool Visible)>();
|
||||
|
||||
private Panel sendOffPanel;
|
||||
|
||||
|
||||
//private static Bitmap normalStateImageHotSong;
|
||||
//private static Bitmap mouseDownImageHotSong;
|
||||
//private static Bitmap resizedNormalStateImageForHotSong;
|
||||
//private static Bitmap resizedMouseDownImageForHotSong;
|
||||
|
||||
private PictureBox serviceBellPictureBox; // 添加为类成员变量
|
||||
private Timer autoRefreshTimer;
|
||||
private Timer timerCountdown;
|
||||
string Rtime;
|
||||
bool test = false;
|
||||
bool Gaintest = true;
|
||||
//private Label pageNumberLabel; // 添加頁碼標籤
|
||||
public PrimaryForm()
|
||||
{
|
||||
Instance = this;
|
||||
|
||||
// 添加 DPI 感知支持
|
||||
if (Environment.OSVersion.Version.Major >= 6)
|
||||
{
|
||||
@ -241,7 +182,6 @@ namespace DualScreenDemo
|
||||
|
||||
InitializeRecording();
|
||||
InitializeMediaPlayer();
|
||||
//LoadImages();
|
||||
InitializeFormAndControls();
|
||||
InitializeMultiPagePanel();
|
||||
OverlayQRCodeOnImage(HttpServer.randomFolderPath);
|
||||
@ -340,7 +280,7 @@ namespace DualScreenDemo
|
||||
// 設定繪製文字的位置 (X=500, Y=30)
|
||||
PointF point_PCName = new PointF(450 * scaleX, 30 * scaleY);
|
||||
PointF point_PageNumber = new PointF(1390 * scaleX, 30 * scaleY);
|
||||
PointF point_verSion = new PointF(1800 * scaleX-10, 30 * scaleY);
|
||||
PointF point_verSion = new PointF(1800 * scaleX - 10, 30 * scaleY);
|
||||
// 繪製文字:
|
||||
// `DrawString(要繪製的文字, 字型, 畫刷, 位置)`
|
||||
e.Graphics.DrawString(displayName, font, brush, point_PCName);
|
||||
@ -426,7 +366,7 @@ namespace DualScreenDemo
|
||||
buttonMiddle.Visible = false;
|
||||
buttonTopRight.Visible = false;
|
||||
buttonTopLeft.Visible = false;
|
||||
buttonThanks.Visible = false;
|
||||
buttonThanks.Visible = false;
|
||||
}
|
||||
}
|
||||
// 修正螢幕初始化關鍵
|
||||
@ -591,56 +531,28 @@ namespace DualScreenDemo
|
||||
pictureBox2.BringToFront();
|
||||
pictureBox3.BringToFront();
|
||||
pictureBox4.BringToFront();
|
||||
pictureBoxQRCode.BringToFront();
|
||||
pictureBoxZhuYinSingers.BringToFront();
|
||||
pictureBoxZhuYinSongs.BringToFront();
|
||||
pictureBoxEnglishSingers.BringToFront();
|
||||
pictureBoxEnglishSongs.BringToFront();
|
||||
pictureBoxWordCountSongs.BringToFront();
|
||||
FavoritePictureBox.BringToFront();
|
||||
promotionsPictureBox.BringToFront();
|
||||
pictureBoxToggleLight.BringToFront();
|
||||
overlayPanel.BringToFront();
|
||||
VodScreenPictureBox.BringToFront();
|
||||
|
||||
newSongAlertButton.BringToFront();
|
||||
hotPlayButton.BringToFront();
|
||||
singerSearchButton.BringToFront();
|
||||
songSearchButton.BringToFront();
|
||||
languageSearchButton.BringToFront();
|
||||
groupSearchButton.BringToFront();
|
||||
categorySearchButton.BringToFront();
|
||||
serviceBellButton.BringToFront();
|
||||
orderedSongsButton.BringToFront();
|
||||
myFavoritesButton.BringToFront();
|
||||
deliciousFoodButton.BringToFront();
|
||||
promotionsButton.BringToFront();
|
||||
mobileSongRequestButton.BringToFront();
|
||||
qieGeButton.BringToFront();
|
||||
musicUpButton.BringToFront();
|
||||
musicDownButton.BringToFront();
|
||||
micUpButton.BringToFront();
|
||||
micDownButton.BringToFront();
|
||||
originalSongButton.BringToFront();
|
||||
replayButton.BringToFront();
|
||||
pauseButton.BringToFront();
|
||||
playButton.BringToFront();
|
||||
muteButton.BringToFront();
|
||||
maleKeyButton.BringToFront();
|
||||
femaleKeyButton.BringToFront();
|
||||
standardKeyButton.BringToFront();
|
||||
soundEffectButton.BringToFront();
|
||||
pitchUpButton.BringToFront();
|
||||
pitchDownButton.BringToFront();
|
||||
syncScreenButton.BringToFront();
|
||||
toggleLightButton.BringToFront();
|
||||
btnPreviousPage.BringToFront();
|
||||
btnReturn.BringToFront();
|
||||
btnNextPage.BringToFront();
|
||||
btnApplause.BringToFront();
|
||||
btnSimplifiedChinese.BringToFront();
|
||||
btnTraditionalChinese.BringToFront();
|
||||
exitButton.BringToFront();
|
||||
|
||||
|
||||
Control[] controlsTopBtns = { newSongAlertButton,hotPlayButton,singerSearchButton,songSearchButton,
|
||||
languageSearchButton,groupSearchButton,categorySearchButton,serviceBellButton,orderedSongsButton,
|
||||
myFavoritesButton,deliciousFoodButton,promotionsButton};
|
||||
|
||||
_StartupcontrolsTop.AddRange(controlsTopBtns);
|
||||
|
||||
ToFront(_StartupcontrolsTop);
|
||||
|
||||
Control[] controlsBottomBtns = {qieGeButton,musicUpButton,musicUpButton,musicDownButton,micUpButton,micDownButton,
|
||||
originalSongButton,replayButton,pauseButton,playButton,muteButton,maleKeyButton,femaleKeyButton,standardKeyButton,
|
||||
soundEffectButton,pitchUpButton,pitchDownButton,syncScreenButton,toggleLightButton,btnPreviousPage,btnReturn,btnNextPage,
|
||||
btnApplause,btnSimplifiedChinese,btnTraditionalChinese};
|
||||
|
||||
_StartupcontrolsBottom.AddRange(controlsBottomBtns);
|
||||
|
||||
ToFront(_StartupcontrolsBottom);
|
||||
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
@ -863,7 +775,6 @@ namespace DualScreenDemo
|
||||
Name = "overlayPanel",
|
||||
Dock = DockStyle.Fill,
|
||||
BackColor = Color.FromArgb(128, 0, 0, 0),
|
||||
|
||||
Visible = false
|
||||
};
|
||||
|
||||
@ -911,23 +822,6 @@ namespace DualScreenDemo
|
||||
this.Controls.Add(pictureBoxSceneSoundEffects);
|
||||
}
|
||||
|
||||
private void PhoneticButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
if (button != null && button.Tag != null)
|
||||
{
|
||||
|
||||
if (inputBoxZhuYinSingers.Visible)
|
||||
{
|
||||
inputBoxZhuYinSingers.Text += button.Tag.ToString();
|
||||
}
|
||||
else if (inputBoxZhuYinSongs.Visible)
|
||||
{
|
||||
inputBoxZhuYinSongs.Text += button.Tag.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LightControlTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (lightControlTimer.Tag != null)
|
||||
@ -1017,14 +911,8 @@ namespace DualScreenDemo
|
||||
Bitmap normalStateImage, Bitmap mouseOverImage, Bitmap mouseDownImage,
|
||||
EventHandler clickEventHandler)
|
||||
{
|
||||
|
||||
ResizeAndPositionButton(button, posX, posY, width, height);
|
||||
|
||||
|
||||
Rectangle cropArea = new Rectangle(button.Location.X, button.Location.Y, button.Size.Width, button.Size.Height);
|
||||
|
||||
|
||||
//button.BackgroundImage = normalStateImage.Clone(cropArea, normalStateImage.PixelFormat);
|
||||
button.BackgroundImage = normalStateImage;
|
||||
button.BackgroundImageLayout = ImageLayout.Stretch;
|
||||
button.FlatStyle = FlatStyle.Flat;
|
||||
@ -1032,12 +920,6 @@ namespace DualScreenDemo
|
||||
button.FlatAppearance.MouseDownBackColor = Color.Transparent;
|
||||
button.FlatAppearance.MouseOverBackColor = Color.Transparent;
|
||||
|
||||
|
||||
//button.MouseEnter += (sender, e) => button.BackgroundImage = mouseOverImage.Clone(cropArea, mouseOverImage.PixelFormat);
|
||||
//button.MouseLeave += (sender, e) => button.BackgroundImage = normalStateImage.Clone(cropArea, normalStateImage.PixelFormat);
|
||||
//button.MouseDown += (sender, e) => button.BackgroundImage = mouseDownImage.Clone(cropArea, mouseDownImage.PixelFormat);
|
||||
//button.MouseUp += (sender, e) => button.BackgroundImage = normalStateImage.Clone(cropArea, normalStateImage.PixelFormat);
|
||||
|
||||
button.MouseEnter += (sender, e) => button.BackgroundImage = mouseOverImage;
|
||||
button.MouseLeave += (sender, e) => button.BackgroundImage = normalStateImage;
|
||||
button.MouseDown += (sender, e) => button.BackgroundImage = mouseDownImage;
|
||||
@ -1135,8 +1017,8 @@ namespace DualScreenDemo
|
||||
new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MusicGainNormal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MusicGainActive"])),
|
||||
(sender, e) => { OverlayForm.MainForm.ShowTopRightLabelTime("音量 ↑", "a2 b3 a4"); });
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
musicDownButton = new Button { Text = "" };
|
||||
musicDownButton.Name = "musicDownButton";
|
||||
@ -1146,20 +1028,21 @@ namespace DualScreenDemo
|
||||
new Bitmap(Path.Combine(serverPath, data["PrimaryFormSubBtn"]["MusicLowActive"])),
|
||||
(sender, e) => { OverlayForm.MainForm.ShowTopRightLabelTime("音量 ↓", "a2 b4 a4"); });
|
||||
|
||||
if (test)
|
||||
if (Gaintest)
|
||||
{
|
||||
musicUpButton.Click -= (sender, e) => { OverlayForm.MainForm.ShowTopRightLabelTime("音量 ↑", "a2 b3 a4"); };
|
||||
musicUpButton.Click += (sender, e) =>
|
||||
{
|
||||
videoPlayerForm.SetVolume(videoPlayerForm.GetVolume() + 5);
|
||||
int vol = videoPlayerForm.GetVolume() - 100;
|
||||
OverlayForm.MainForm.ShowTopRightLabel(vol.ToString(), null);
|
||||
videoPlayerForm.SetVolume(videoPlayerForm.GetVolume() + 5);
|
||||
int vol = videoPlayerForm.GetVolume() - 100;
|
||||
OverlayForm.MainForm.ShowTopRightLabel(vol.ToString(), null);
|
||||
};
|
||||
|
||||
musicDownButton.Click -= (sender, e) => { OverlayForm.MainForm.ShowTopRightLabelTime("音量 ↓", "a2 b4 a4"); };
|
||||
musicDownButton.Click += (sender, e) =>
|
||||
{
|
||||
videoPlayerForm.SetVolume(videoPlayerForm.GetVolume() - 5);
|
||||
int vol = videoPlayerForm.GetVolume() - 100;
|
||||
OverlayForm.MainForm.ShowTopRightLabel(vol.ToString(), null);
|
||||
{
|
||||
videoPlayerForm.SetVolume(videoPlayerForm.GetVolume() - 5);
|
||||
int vol = videoPlayerForm.GetVolume() - 100;
|
||||
OverlayForm.MainForm.ShowTopRightLabel(vol.ToString(), null);
|
||||
};
|
||||
|
||||
}
|
||||
@ -1416,7 +1299,7 @@ namespace DualScreenDemo
|
||||
}
|
||||
|
||||
private SongData currentSelectedSong;
|
||||
|
||||
|
||||
//vod介面點擊事件
|
||||
public void Label_Click(object sender, EventArgs e)
|
||||
{
|
||||
@ -1453,18 +1336,6 @@ namespace DualScreenDemo
|
||||
}
|
||||
}
|
||||
|
||||
public static void WriteLog(string message)
|
||||
{
|
||||
|
||||
string logFilePath = Path.Combine(Application.StartupPath, "txt", "logfile.txt");
|
||||
|
||||
using (StreamWriter sw = new StreamWriter(logFilePath, true))
|
||||
{
|
||||
|
||||
sw.WriteLine(String.Format("{0}: {1}", DateTime.Now, message));
|
||||
}
|
||||
}
|
||||
|
||||
private void NextPageButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
multiPagePanel.LoadNextPage();
|
||||
@ -1522,126 +1393,7 @@ namespace DualScreenDemo
|
||||
return destImage;
|
||||
}
|
||||
|
||||
#region LoadImages
|
||||
//private void LoadImages()
|
||||
//{
|
||||
// var data = LoadBtnConfigData();
|
||||
|
||||
// string selectedThemePath = ReadSelectedThemePath();
|
||||
|
||||
// string basePath = Path.Combine(serverPath, selectedThemePath);
|
||||
// int targetWidth = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
|
||||
// int targetHeight = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
|
||||
|
||||
// normalStateImage = new Bitmap(Path.Combine(serverPath, data["PrimaryFormBtn"]["MainFrameWSubBtn"]));
|
||||
|
||||
// resizedNormalStateImage = ResizeImage(normalStateImage, targetWidth, targetHeight);
|
||||
|
||||
// mouseOverImage = new Bitmap(Path.Combine(serverPath, data["PrimaryFormBtn"]["MainFrameBtnPressed"]));
|
||||
|
||||
// resizedMouseOverImage = ResizeImage(mouseOverImage, targetWidth, targetHeight);
|
||||
|
||||
// mouseDownImage = new Bitmap(Path.Combine(serverPath, data["PrimaryFormBtn"]["MainFrameBtnPressed"]));
|
||||
|
||||
// resizedMouseDownImage = ResizeImage(mouseDownImage, targetWidth, targetHeight);
|
||||
|
||||
// normalStateImageNewSongAlert = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\1.新歌快報_未按.jpg"));
|
||||
|
||||
// resizedNormalStateImageForNewSongAlert = ResizeImage(normalStateImageNewSongAlert, targetWidth, targetHeight);
|
||||
|
||||
// mouseOverImageNewSongAlert = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\1.新歌快報_已按.jpg"));
|
||||
|
||||
// resizedMouseOverImageForNewSongAlert = ResizeImage(mouseOverImageNewSongAlert, targetWidth, targetHeight);
|
||||
|
||||
// mouseDownImageNewSongAlert = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\1.新歌快報_已按.jpg"));
|
||||
|
||||
// resizedMouseDownImageForNewSongAlert = ResizeImage(mouseDownImageNewSongAlert, targetWidth, targetHeight);
|
||||
|
||||
// normalStateImageArtistQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\3.歌星查詢_未按.jpg"));
|
||||
|
||||
// resizedNormalStateImageForArtistQuery = ResizeImage(normalStateImageArtistQuery, targetWidth, targetHeight);
|
||||
|
||||
// mouseOverImageArtistQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\3.歌星查詢_已按.jpg"));
|
||||
|
||||
// resizedMouseOverImageForArtistQuery = ResizeImage(mouseOverImageArtistQuery, targetWidth, targetHeight);
|
||||
|
||||
// mouseDownImageArtistQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\3.歌星查詢_已按.jpg"));
|
||||
|
||||
// resizedMouseDownImageForArtistQuery = ResizeImage(mouseDownImageArtistQuery, targetWidth, targetHeight);
|
||||
|
||||
// normalStateImageSongQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\4.歌名查詢_未按.jpg"));
|
||||
|
||||
// resizedNormalStateImageForSongQuery = ResizeImage(normalStateImageSongQuery, targetWidth, targetHeight);
|
||||
|
||||
// mouseOverImageSongQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\4.歌名查詢_已按.jpg"));
|
||||
|
||||
// resizedMouseOverImageForSongQuery = ResizeImage(mouseOverImageSongQuery, targetWidth, targetHeight);
|
||||
|
||||
// mouseDownImageSongQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\4.歌名查詢_已按.jpg"));
|
||||
|
||||
// resizedMouseDownImageForSongQuery = ResizeImage(mouseDownImageSongQuery, targetWidth, targetHeight);
|
||||
|
||||
|
||||
// normalStateImageLanguageQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\5.語別查詢_未按.jpg"));
|
||||
// resizedNormalStateImageForLanguageQuery = ResizeImage(normalStateImageLanguageQuery, targetWidth, targetHeight);
|
||||
|
||||
// mouseOverImageLanguageQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\5.語別查詢_已按.jpg"));
|
||||
// resizedMouseOverImageForLanguageQuery = ResizeImage(mouseOverImageLanguageQuery, targetWidth, targetHeight);
|
||||
|
||||
// mouseDownImageLanguageQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\5.語別查詢_已按.jpg"));
|
||||
// resizedMouseDownImageForLanguageQuery = ResizeImage(mouseDownImageLanguageQuery, targetWidth, targetHeight);
|
||||
|
||||
|
||||
// normalStateImageCategoryQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\7.類別查詢_未按.jpg"));
|
||||
// resizedNormalStateImageForCategoryQuery = ResizeImage(normalStateImageCategoryQuery, targetWidth, targetHeight);
|
||||
|
||||
// mouseOverImageCategoryQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\7.類別查詢_已按.jpg"));
|
||||
// resizedMouseOverImageForCategoryQuery = ResizeImage(mouseOverImageCategoryQuery, targetWidth, targetHeight);
|
||||
|
||||
// mouseDownImageCategoryQuery = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\7.類別查詢_已按.jpg"));
|
||||
// resizedMouseDownImageForCategoryQuery = ResizeImage(mouseDownImageCategoryQuery, targetWidth, targetHeight);
|
||||
|
||||
|
||||
// normalStateImageForPromotionsAndMenu = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\555021.jpg"));
|
||||
// resizedNormalStateImageForPromotionsAndMenu = ResizeImage(normalStateImageForPromotionsAndMenu, targetWidth, targetHeight);
|
||||
|
||||
// try
|
||||
// {
|
||||
// string imagePath = Path.Combine(serverPath, "themes\\superstar\\主畫面\\選單內介面_同步畫面.jpg");
|
||||
|
||||
// if (File.Exists(imagePath))
|
||||
// {
|
||||
// normalStateImageForSyncScreen = new Bitmap(imagePath);
|
||||
// resizedNormalStateImageForSyncScreen = ResizeImage(normalStateImageForSyncScreen, targetWidth, targetHeight);
|
||||
// Console.WriteLine("Image loaded successfully.");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Console.WriteLine("Image file does not exist: " + imagePath);
|
||||
|
||||
// }
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// Console.WriteLine("Failed to load image: " + ex.Message);
|
||||
|
||||
// }
|
||||
|
||||
// normalStateImageForSceneSoundEffects = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\555022.jpg"));
|
||||
// resizedNormalStateImageForSceneSoundEffects = ResizeImage(normalStateImageForSceneSoundEffects, targetWidth, targetHeight);
|
||||
|
||||
|
||||
// normalStateImageHotSong = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\2.熱門排行_未按.jpg"));
|
||||
// resizedNormalStateImageForHotSong = ResizeImage(normalStateImageHotSong, targetWidth, targetHeight);
|
||||
|
||||
// mouseDownImageHotSong = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\2.熱門排行_已按.jpg"));
|
||||
// resizedMouseDownImageForHotSong = ResizeImage(mouseDownImageHotSong, targetWidth, targetHeight);
|
||||
|
||||
// normalStateImageForLightControl = new Bitmap(Path.Combine(serverPath, "themes\\superstar\\主畫面\\選單內介面_燈光控制.jpg"));
|
||||
// resizedNormalStateImageForLightControl = ResizeImage(normalStateImageForLightControl, targetWidth, targetHeight);
|
||||
//}
|
||||
#endregion
|
||||
|
||||
//複製生成選取區域圖形
|
||||
private Bitmap CropImage(Bitmap source, Rectangle section)
|
||||
{
|
||||
|
||||
@ -2302,9 +2054,9 @@ namespace DualScreenDemo
|
||||
// 已點歌曲錨點
|
||||
var List = SongList.GetHistory();
|
||||
int index = List.FindIndex(song => song.GetState() == PlayState.Playing);
|
||||
int remainder=List.Count-index;
|
||||
int remainder = List.Count - index;
|
||||
int pivot2 = index % multiPagePanel.itemsPerPage;
|
||||
int pivot = (List.Count -remainder)%multiPagePanel.itemsPerPage;
|
||||
int pivot = (List.Count - remainder) % multiPagePanel.itemsPerPage;
|
||||
if (index != -1)
|
||||
{
|
||||
if (remainder != 0 && index != 0)
|
||||
@ -2321,7 +2073,7 @@ namespace DualScreenDemo
|
||||
}
|
||||
else if (pivot != 0)
|
||||
{
|
||||
int itemsToInsert = multiPagePanel.itemsPerPage - pivot2 ;
|
||||
int itemsToInsert = multiPagePanel.itemsPerPage - pivot2;
|
||||
|
||||
for (int i = 0; i < itemsToInsert; i++)
|
||||
{
|
||||
@ -2335,7 +2087,7 @@ namespace DualScreenDemo
|
||||
totalPages = (int)Math.Ceiling((double)List.Count / multiPagePanel.itemsPerPage);
|
||||
index = List.FindIndex(song => song.GetState() == PlayState.Playing);
|
||||
int page = 0;
|
||||
if ((index+1) > multiPagePanel.itemsPerPage) page = Math.Abs((index+1) / multiPagePanel.itemsPerPage);
|
||||
if ((index + 1) > multiPagePanel.itemsPerPage) page = Math.Abs((index + 1) / multiPagePanel.itemsPerPage);
|
||||
|
||||
SetHotSongButtonsVisibility(false);
|
||||
SetNewSongButtonsVisibility(false);
|
||||
@ -2359,7 +2111,7 @@ namespace DualScreenDemo
|
||||
closeQRCodeButton.Visible = false;
|
||||
}
|
||||
|
||||
multiPagePanel.LoadPlayedSongs(List,page);
|
||||
multiPagePanel.LoadPlayedSongs(List, page);
|
||||
}
|
||||
|
||||
#region 控制項Visible屬性設定
|
||||
@ -2435,12 +2187,20 @@ namespace DualScreenDemo
|
||||
activeButton.BackgroundImage = activeBackground;
|
||||
}
|
||||
|
||||
private async void HttpDownload(string fileUrl,string LocalLoc)
|
||||
public void ToFront(List<Control> controlList)
|
||||
{
|
||||
foreach (var control in controlList)
|
||||
{
|
||||
control.BringToFront();
|
||||
}
|
||||
}
|
||||
|
||||
private async void HttpDownload(string fileUrl, string LocalLoc)
|
||||
{
|
||||
using HttpClient client = new HttpClient();
|
||||
try
|
||||
{
|
||||
var response= await client.GetAsync(fileUrl, HttpCompletionOption.ResponseHeadersRead);
|
||||
var response = await client.GetAsync(fileUrl, HttpCompletionOption.ResponseHeadersRead);
|
||||
|
||||
var totalBytes = response.Content.Headers.ContentLength ?? -1L;
|
||||
using var contentStream = await response.Content.ReadAsStreamAsync();
|
||||
@ -2465,7 +2225,7 @@ namespace DualScreenDemo
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Download Failed:"+ex.Message);
|
||||
Console.WriteLine("Download Failed:" + ex.Message);
|
||||
Program.WriteLog("Download Failed:" + ex.Message);
|
||||
}
|
||||
}
|
||||
|
@ -245,6 +245,22 @@ namespace DualScreenDemo
|
||||
// 顯示「注音歌手搜尋」的圖片框
|
||||
pictureBoxZhuYinSingers.Visible = true;
|
||||
}
|
||||
private void PhoneticButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
if (button != null && button.Tag != null)
|
||||
{
|
||||
|
||||
if (inputBoxZhuYinSingers.Visible)
|
||||
{
|
||||
inputBoxZhuYinSingers.Text += button.Tag.ToString();
|
||||
}
|
||||
else if (inputBoxZhuYinSongs.Visible)
|
||||
{
|
||||
inputBoxZhuYinSongs.Text += button.Tag.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void ModifyButtonZhuYinSingers_Click(object sender, EventArgs e)
|
||||
{
|
||||
// 如果輸入框不為空,且包含輸入內容,則刪除最後一個字符
|
||||
|
@ -1,5 +1,5 @@
|
||||
using System.IO;
|
||||
using DirectShowLib;
|
||||
// using DirectShowLib;
|
||||
using LibVLCSharp;
|
||||
|
||||
namespace DualScreenDemo.Services
|
||||
@ -15,6 +15,7 @@ namespace DualScreenDemo.Services
|
||||
{
|
||||
Core.Initialize();
|
||||
_libVLC = new LibVLC(
|
||||
// "--reset-plugins-cache", //產生libvlc plugins設定cache,加快初次啟動速度,生成快取後註解關閉此設定。
|
||||
"--verbose=-1",
|
||||
// enableDebugLogs: true,
|
||||
"--audio-time-stretch",
|
||||
@ -66,7 +67,7 @@ namespace DualScreenDemo.Services
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public bool IsAtEndTime()
|
||||
{
|
||||
var duration = _mediaPlayer.Media?.Duration ?? 0;
|
||||
@ -84,7 +85,7 @@ namespace DualScreenDemo.Services
|
||||
_media = new Media(filePath, FromType.FromPath);
|
||||
_mediaPlayer.Media = addMediaOption(_media, audioTrackIndex);
|
||||
_mediaPlayer.Play();
|
||||
_mediaPlayer.Fullscreen=true;
|
||||
_mediaPlayer.Fullscreen = true;
|
||||
_mediaPlayer.Mute = false;
|
||||
// _mediaPlayer.Stopped += (s, e) => Console.WriteLine("Player Stopped");
|
||||
}
|
||||
@ -99,7 +100,7 @@ namespace DualScreenDemo.Services
|
||||
{
|
||||
media.AddOption(":avcodec-hw=dxva2");
|
||||
media.AddOption(":audio-output=directsound");
|
||||
media.AddOption(":drop-late-frames");
|
||||
media.AddOption(":drop-late-frames");
|
||||
media.AddOption(":network-caching=300");
|
||||
media.AddOption(":live-caching=300");
|
||||
media.AddOption(":file-caching=300");
|
||||
@ -122,7 +123,7 @@ namespace DualScreenDemo.Services
|
||||
_mediaPlayer.Mute = isMuted;
|
||||
return _mediaPlayer.Mute;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Dispose
|
||||
@ -145,4 +146,6 @@ namespace DualScreenDemo.Services
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user