public void Display() { String file; vlc1.Initialize(); //vlc1.VideoOutput = Cam1PlaybackWindow; vlc1.PlaylistClear(); OpenFileDialog FileSelect = new OpenFileDialog(); if (FileSelect.ShowDialog() == DialogResult.OK) { Console.WriteLine(FileSelect.FileName); } file = (FileSelect.ToString()).Substring(55); vlc1.AddTarget(file); file = file.Substring(file.Length - 23, 18); //Cam1PlaybackLbl.Enabled = true; //Cam1PlaybackLbl.Text = "File Date: " + (file.Remove(10)) + " Time:" + file.Substring(file.Length - 8, 6); //trackBar1.Maximum = 100; timer1.Enabled = true; vlc1.Play(); }
// TODO: Add pipe server for program mutex. public FormMain() { if (!DesignMode) { Logger.Debug("Initializing LibVLC..."); Vlc.Initialize(); } Logger.Debug("Initializing windows wallpaper..."); if (!WindowsWallpaper.Init()) { MessageBox.Show(this, "Failed to initalize windows wallpaper! Failed to acquire desktop window pointer!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); Application.Exit(); } MimeTypesMap.AddOrUpdate("playlist/json", "dpp"); MimeTypesMap.AddOrUpdate("shadertoy/dpst", "dpst"); MimeTypesMap.AddOrUpdate("shadertoy/shadertoy", "shadertoy"); MediaPlayerStore.Instance.RegisterPlayer <VlcMediaPlayer>("video/x-matroska", "video/mp4", "video/mov", "video/avi", "video/wmv", "video/gif", "video/webm"); MediaPlayerStore.Instance.RegisterPlayer <PictureBoxPlayer>("image/jpeg", "image/png", "image/jpg", "image/bmp", "image/tiff", "image/svg"); MediaPlayerStore.Instance.RegisterPlayer <ShaderToyPlayer>("shadertoy/dpst", "shadertoy/shadertoy"); settingsManager.OnSettingsChanged += (sender, settings) => { CloseToTray = settings.CloseToTray; MinimizeToTray = settings.MinimizeToTray; }; settingsManager.Load(true); if (Settings.StartMinimized) { WindowState = FormWindowState.Minimized; } InitializeComponent(); showToolStripMenuItem.Click += trayShowForm_Click; // Connect the show button in the tray with the required method. }