added to turn off cgd render
Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
8af247c632
commit
8ec6252437
4
CdgPlayer/KaraokeVideoPlayer.Designer.cs
generated
4
CdgPlayer/KaraokeVideoPlayer.Designer.cs
generated
@ -44,8 +44,8 @@
|
|||||||
this.vlcPlayer.TabIndex = 0;
|
this.vlcPlayer.TabIndex = 0;
|
||||||
this.vlcPlayer.Text = "vlcControl1";
|
this.vlcPlayer.Text = "vlcControl1";
|
||||||
this.vlcPlayer.VlcLibDirectory = null;
|
this.vlcPlayer.VlcLibDirectory = null;
|
||||||
if (isCDG) {
|
if (isCDG && !hideOverlay) {
|
||||||
this.vlcPlayer.VlcMediaplayerOptions = new string[] { "--projectm-preset-path=lib\\presets", "--audio-visual=projectm", "--effect-list=scope", "--no-video", "--verbose=2" };
|
this.vlcPlayer.VlcMediaplayerOptions = new string[] { "--effect-list=scope", "--no-video", "--verbose=2" };
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.vlcPlayer.VlcMediaplayerOptions = new string[] { "--projectm-preset-path=lib\\presets", "--effect-list=scope", "--verbose=2" };
|
this.vlcPlayer.VlcMediaplayerOptions = new string[] { "--projectm-preset-path=lib\\presets", "--effect-list=scope", "--verbose=2" };
|
||||||
|
|||||||
@ -15,22 +15,27 @@ namespace KaraokePlayer
|
|||||||
{
|
{
|
||||||
public partial class KaraokeVideoPlayer : UserControl
|
public partial class KaraokeVideoPlayer : UserControl
|
||||||
{
|
{
|
||||||
|
private bool hideOverlay = true;
|
||||||
private GraphicsFile _cdgFile;
|
private GraphicsFile _cdgFile;
|
||||||
private KaraokeVideoOverlay _overlayForm;
|
private KaraokeVideoOverlay _overlayForm;
|
||||||
private DateTime _startTime;
|
private DateTime _startTime;
|
||||||
private readonly System.Timers.Timer _lyricTimer = new System.Timers.Timer();
|
private readonly System.Timers.Timer _lyricTimer = new System.Timers.Timer();
|
||||||
|
|
||||||
public KaraokeVideoPlayer(bool isCDG)
|
public KaraokeVideoPlayer(bool isCDG, bool hideOverlay)
|
||||||
{
|
{
|
||||||
|
this.hideOverlay = hideOverlay;
|
||||||
this.isCDG = isCDG;
|
this.isCDG = isCDG;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_lyricTimer.Interval = 33;
|
if (!hideOverlay)
|
||||||
_lyricTimer.Elapsed += LyricTimerOnElapsed;
|
{
|
||||||
|
_lyricTimer.Interval = 33;
|
||||||
|
_lyricTimer.Elapsed += LyricTimerOnElapsed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LyricTimerOnElapsed(object sender, ElapsedEventArgs elapsedEventArgs)
|
private void LyricTimerOnElapsed(object sender, ElapsedEventArgs elapsedEventArgs)
|
||||||
{
|
{
|
||||||
if (isCDG)
|
if (isCDG && !hideOverlay)
|
||||||
{
|
{
|
||||||
var picture = _cdgFile.RenderAtTime((long)(DateTime.Now - _startTime).TotalMilliseconds);
|
var picture = _cdgFile.RenderAtTime((long)(DateTime.Now - _startTime).TotalMilliseconds);
|
||||||
BeginInvoke(new MethodInvoker(() => { _overlayForm.Graphic.Image = picture; }));
|
BeginInvoke(new MethodInvoker(() => { _overlayForm.Graphic.Image = picture; }));
|
||||||
@ -40,7 +45,7 @@ namespace KaraokePlayer
|
|||||||
public async void Play(Uri file)
|
public async void Play(Uri file)
|
||||||
{
|
{
|
||||||
vlcPlayer.SetMedia(file);
|
vlcPlayer.SetMedia(file);
|
||||||
if (isCDG)
|
if (isCDG && !hideOverlay)
|
||||||
{
|
{
|
||||||
_cdgFile = await GraphicsFile.LoadAsync(Path.ChangeExtension(file.LocalPath, "cdg"));
|
_cdgFile = await GraphicsFile.LoadAsync(Path.ChangeExtension(file.LocalPath, "cdg"));
|
||||||
}
|
}
|
||||||
|
|||||||
4
KaraokePlayer/MainForm.Designer.cs
generated
4
KaraokePlayer/MainForm.Designer.cs
generated
@ -36,8 +36,8 @@
|
|||||||
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||||
this.materialListBox1 = new MaterialSkin.Controls.MaterialListBox();
|
this.materialListBox1 = new MaterialSkin.Controls.MaterialListBox();
|
||||||
this.materialSingleLineTextField1 = new MaterialSkin.Controls.MaterialSingleLineTextField();
|
this.materialSingleLineTextField1 = new MaterialSkin.Controls.MaterialSingleLineTextField();
|
||||||
this.karaokeCDGPlayer = new KaraokePlayer.KaraokeVideoPlayer(true);
|
this.karaokeCDGPlayer = new KaraokePlayer.KaraokeVideoPlayer(true, true);
|
||||||
this.karaokeMP4Player = new KaraokePlayer.KaraokeVideoPlayer(false);
|
this.karaokeMP4Player = new KaraokePlayer.KaraokeVideoPlayer(false, true);
|
||||||
this.browseDialog = new System.Windows.Forms.FolderBrowserDialog();
|
this.browseDialog = new System.Windows.Forms.FolderBrowserDialog();
|
||||||
this.tableLayoutPanel1.SuspendLayout();
|
this.tableLayoutPanel1.SuspendLayout();
|
||||||
this.flowLayoutPanel1.SuspendLayout();
|
this.flowLayoutPanel1.SuspendLayout();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user