superstar_v2/PrimaryFormParts/PrimaryForm.SyncScreen.cs

168 lines
9.9 KiB
C#

using OverlayFormObj;
using System.IO;
namespace DualScreenDemo
{
public partial class PrimaryForm : Form
{
public Panel primaryScreenPanel;
public Button syncServiceBellButton;
public Button syncCutSongButton;
public Button syncReplayButton;
public Button syncOriginalSongButton;
public Button syncMuteButton;
public Button syncPauseButton;
public Button syncPlayButton;
public Button syncVolumeUpButton;
public Button syncVolumeDownButton;
public Button syncMicUpButton;
public Button syncMicDownButton;
public Button syncCloseButton;
private void InitializeSyncScreen()
{
this.primaryScreenPanel = new System.Windows.Forms.Panel();
this.syncServiceBellButton = new System.Windows.Forms.Button();
this.syncCutSongButton = new System.Windows.Forms.Button();
this.syncReplayButton = new System.Windows.Forms.Button();
this.syncOriginalSongButton = new System.Windows.Forms.Button();
this.syncMuteButton = new System.Windows.Forms.Button();
this.syncPauseButton = new System.Windows.Forms.Button();
this.syncPlayButton = new System.Windows.Forms.Button();
this.syncVolumeUpButton = new System.Windows.Forms.Button();
this.syncVolumeDownButton = new System.Windows.Forms.Button();
this.syncMicUpButton = new System.Windows.Forms.Button();
this.syncMicDownButton = new System.Windows.Forms.Button();
this.syncCloseButton = new System.Windows.Forms.Button();
this.SuspendLayout();
ResizeAndPositionControl(this.primaryScreenPanel, 0, 0, 1440, 900);
this.primaryScreenPanel.TabIndex = 0;
this.primaryScreenPanel.BorderStyle = BorderStyle.FixedSingle;
this.primaryScreenPanel.BackColor = System.Drawing.Color.Black;
var data=LoadConfigData();
// 同步畫面 服務鈴
ConfigureButton(this.syncServiceBellButton, 1240, 17, 161, 161,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_服務鈴.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_服務鈴.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_服務鈴.png")),
//(sender, e) => SendCommandThroughSerialPort("a2 53 a4"));
(sender,e)=>OnServiceBellButtonClick(sender,e));
ConfigureButton(this.syncCutSongButton, 1218, 195, 205, 56,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_切歌.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_切歌.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_切歌.png")), (sender, e) => videoPlayerForm.PlayNextSong());
ConfigureButton(this.syncReplayButton, 1218, 265, 205, 56,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_重唱.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_重唱.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_重唱.png")), ReplayButton_Click);
// 有人聲入口位置
ConfigureButton(this.syncOriginalSongButton, 1218, 335, 205, 56,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_原唱.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_原唱.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_原唱.png")), (sender,e) => videoPlayerForm.ToggleVocalRemoval());
ConfigureButton(this.syncMuteButton, 1218, 406, 205, 55,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_靜音.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_靜音.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_靜音.png")), MuteUnmuteButton_Click);
ConfigureButton(this.syncPauseButton, 1218, 475, 205, 56,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")), SyncPauseButton_Click);
ConfigureButton(this.syncPlayButton, 1218, 475, 205, 56,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_暫停.png")), SyncPlayButton_Click);
ConfigureButton(this.syncVolumeUpButton, 1218, 546, 205, 55,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_音樂+.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_音樂+.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_音樂+.png")), null);
this.syncVolumeUpButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↑ ","a2 b3 a4"); };
this.syncVolumeUpButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); };
ConfigureButton(this.syncVolumeDownButton, 1218, 616, 205, 55,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_音樂-.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_音樂-.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_音樂-.png")), null);
this.syncVolumeDownButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("音量 ↓ ","a2 b4 a4");};
this.syncVolumeDownButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel();};
ConfigureButton(this.syncMicUpButton, 1218, 686, 205, 56,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_麥克風+.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_麥克風+.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_麥克風+.png")), null);
this.syncMicUpButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↑ ","a2 b5 a4");};
this.syncMicUpButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); };
ConfigureButton(this.syncMicDownButton, 1218, 756, 205, 56,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_麥克風-.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_麥克風-.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_麥克風-.png")), null);
this.syncMicDownButton.MouseDown += (sender, e) => { OverlayForm.MainForm.ShowTopRightLabel("麥克風 ↓ ","a2 b6 a4");};
this.syncMicDownButton.MouseUp += (sender, e) => { OverlayForm.MainForm.RedisplayTopRigthLabel(); };
ConfigureButton(this.syncCloseButton, 1218, 826, 205, 56,
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_關閉.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_關閉.png")),
new Bitmap(Path.Combine(serverPath, "themes\\superstar\\button\\3.介面\\同步畫面_關閉.png")), SyncCloseButton_Click);
this.ClientSize = new System.Drawing.Size(1440, 900);
this.Controls.Add(this.primaryScreenPanel);
this.Controls.Add(this.syncCloseButton);
this.Name = "PrimaryForm";
this.ResumeLayout(false);
}
private void SyncPauseButton_Click(object sender, EventArgs e)
{
videoPlayerForm.Pause();
syncPauseButton.Visible = false;
syncPlayButton.Visible = true;
syncPlayButton.BringToFront();
pauseButton.Visible = false;
playButton.Visible = true;
}
private void SyncPlayButton_Click(object sender, EventArgs e)
{
videoPlayerForm.Play();
syncPauseButton.Visible = true;
syncPauseButton.BringToFront();
syncPlayButton.Visible = false;
pauseButton.Visible = true;
playButton.Visible = false;
}
private void SyncCloseButton_Click(object sender, EventArgs e)
{
VideoPlayerForm.Instance.ClosePrimaryScreenPanel();
}
private void SyncScreenButton_Click(object sender, EventArgs e)
{
videoPlayerForm.IsSyncToPrimaryMonitor = true;
videoPlayerForm.SyncToPrimaryMonitor();
}
}
}