Пример #1
0
        public Form1(string mediafile)
        {
            InitializeComponent();
            Form1.Instance = this;
            // set window location/sizing and force to top of z index
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.WindowState     = FormWindowState.Maximized;
            this.Focus();
            this.TopMost = true;
            this.Refresh();

            vlcLibrary = new VLCLibrary();
            if (vlcLibrary.DetectVLC())
            {
                try
                {
                    vlcLibrary.SetupVLC();
                }
                catch (Exception e)
                {
                }
            }

            // activate the remote control hooks
            remoteManager      = new MCRemoteControlManager();
            remoteManager.form = this;
            remoteManager.AssignHandle(this.Handle);

            IntPtr panelHandle = panel1.Handle;

            string[] args = new string[] {
                "-I", "dummy", "--ignore-config",
                @"--plugin-path=" + MediaCenterVLCPlayer.Properties.Settings.Default.VlcPluginsPath
            };

            if (!System.IO.Directory.Exists(MediaCenterVLCPlayer.Properties.Settings.Default.VlcPluginsPath))
            {
                DialogResult result = MessageBox.Show("Error: we do NOT have a valid location for the VLC plugins folder", "Error", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
            }
            // init VLC
            try
            {
                instance = new VlcInstance(args);
            }
            catch (VlcException e)
            {
                MessageBox.Show("Error creating VLC Instance:" + e.Message);
                Environment.Exit(0);
            }

            player          = instance.CreatePlayer(mediafile);
            player.Drawable = panelHandle;
            // give the remote control lib access to the active panel so it gets keyboard/mouse/remote events
            remoteManager.playerHandle = player.Handle;

            IntPtr p_event_manager = vlcLibrary.media_player_event_manager(player.Handle);

            eventmanager = new VlcEventManager(instance, p_event_manager);
            eventmanager.InitalizeEvents();
        }
Пример #2
0
        public Form1(string mediafile)
        {
            InitializeComponent();
            Form1.Instance = this;
            // set window location/sizing and force to top of z index
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.WindowState = FormWindowState.Maximized;
            this.Focus();
            this.TopMost = true;
            this.Refresh();

            vlcLibrary = new VLCLibrary();
            if (vlcLibrary.DetectVLC())
            {
                try
                {
                    vlcLibrary.SetupVLC();
                }
                catch (Exception e)
                {
                }
            }

            // activate the remote control hooks
            remoteManager = new MCRemoteControlManager();
            remoteManager.form = this;
            remoteManager.AssignHandle(this.Handle);

            IntPtr panelHandle = panel1.Handle;

            string[] args = new string[] {
                "-I", "dummy", "--ignore-config",
                @"--plugin-path=" + MediaCenterVLCPlayer.Properties.Settings.Default.VlcPluginsPath
            };

            if (!System.IO.Directory.Exists(MediaCenterVLCPlayer.Properties.Settings.Default.VlcPluginsPath))
            {
                DialogResult result = MessageBox.Show("Error: we do NOT have a valid location for the VLC plugins folder", "Error", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
            }
            // init VLC
            try
            {
                instance = new VlcInstance(args);
            }
            catch (VlcException e)
            {
                MessageBox.Show("Error creating VLC Instance:" + e.Message);
                Environment.Exit(0);
            }

            player = instance.CreatePlayer(mediafile);
            player.Drawable = panelHandle;
            // give the remote control lib access to the active panel so it gets keyboard/mouse/remote events
            remoteManager.playerHandle = player.Handle;

            IntPtr p_event_manager = vlcLibrary.media_player_event_manager(player.Handle);
            eventmanager = new VlcEventManager(instance, p_event_manager);
            eventmanager.InitalizeEvents();
        }
 public void MCRemoteControlManagerConstructorTest()
 {
     MCRemoteControlManager target = new MCRemoteControlManager();
     Assert.IsInstanceOfType(target, typeof(MCRemoteControlManager));
 }