diff --git a/CdgPlayer/KaraokeVideoPlayer.Designer.cs b/CdgPlayer/KaraokeVideoPlayer.Designer.cs index 8da7dca..853c09e 100644 --- a/CdgPlayer/KaraokeVideoPlayer.Designer.cs +++ b/CdgPlayer/KaraokeVideoPlayer.Designer.cs @@ -44,8 +44,8 @@ this.vlcPlayer.TabIndex = 0; this.vlcPlayer.Text = "vlcControl1"; this.vlcPlayer.VlcLibDirectory = null; - if (isCDG) { - this.vlcPlayer.VlcMediaplayerOptions = new string[] { "--projectm-preset-path=lib\\presets", "--audio-visual=projectm", "--effect-list=scope", "--no-video", "--verbose=2" }; + if (isCDG && !hideOverlay) { + this.vlcPlayer.VlcMediaplayerOptions = new string[] { "--effect-list=scope", "--no-video", "--verbose=2" }; } else { this.vlcPlayer.VlcMediaplayerOptions = new string[] { "--projectm-preset-path=lib\\presets", "--effect-list=scope", "--verbose=2" }; diff --git a/CdgPlayer/KaraokeVideoPlayer.cs b/CdgPlayer/KaraokeVideoPlayer.cs index b5cff61..7fd4fab 100644 --- a/CdgPlayer/KaraokeVideoPlayer.cs +++ b/CdgPlayer/KaraokeVideoPlayer.cs @@ -15,22 +15,27 @@ namespace KaraokePlayer { public partial class KaraokeVideoPlayer : UserControl { + private bool hideOverlay = true; private GraphicsFile _cdgFile; private KaraokeVideoOverlay _overlayForm; private DateTime _startTime; 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; InitializeComponent(); - _lyricTimer.Interval = 33; - _lyricTimer.Elapsed += LyricTimerOnElapsed; + if (!hideOverlay) + { + _lyricTimer.Interval = 33; + _lyricTimer.Elapsed += LyricTimerOnElapsed; + } } private void LyricTimerOnElapsed(object sender, ElapsedEventArgs elapsedEventArgs) { - if (isCDG) + if (isCDG && !hideOverlay) { var picture = _cdgFile.RenderAtTime((long)(DateTime.Now - _startTime).TotalMilliseconds); BeginInvoke(new MethodInvoker(() => { _overlayForm.Graphic.Image = picture; })); @@ -40,7 +45,7 @@ namespace KaraokePlayer public async void Play(Uri file) { vlcPlayer.SetMedia(file); - if (isCDG) + if (isCDG && !hideOverlay) { _cdgFile = await GraphicsFile.LoadAsync(Path.ChangeExtension(file.LocalPath, "cdg")); } diff --git a/KaraokePlayer/MainForm.Designer.cs b/KaraokePlayer/MainForm.Designer.cs index 9036dc2..deab5db 100644 --- a/KaraokePlayer/MainForm.Designer.cs +++ b/KaraokePlayer/MainForm.Designer.cs @@ -36,8 +36,8 @@ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.materialListBox1 = new MaterialSkin.Controls.MaterialListBox(); this.materialSingleLineTextField1 = new MaterialSkin.Controls.MaterialSingleLineTextField(); - this.karaokeCDGPlayer = new KaraokePlayer.KaraokeVideoPlayer(true); - this.karaokeMP4Player = new KaraokePlayer.KaraokeVideoPlayer(false); + this.karaokeCDGPlayer = new KaraokePlayer.KaraokeVideoPlayer(true, true); + this.karaokeMP4Player = new KaraokePlayer.KaraokeVideoPlayer(false, true); this.browseDialog = new System.Windows.Forms.FolderBrowserDialog(); this.tableLayoutPanel1.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout();