added to turn off cgd render

Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
Matt Bruce 2016-03-19 13:10:35 -05:00
parent 8af247c632
commit 8ec6252437
3 changed files with 14 additions and 9 deletions

View File

@ -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" };

View File

@ -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"));
}

View File

@ -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();