Esempio n. 1
0
        public frmMain(string File)
        {
#if DEBUG
            File = @"C:\Temp\media\Bud Spencer & Terence Hill Filmmusik-8POtxa0SaBo.mp3";
#endif
            InitializeComponent();
            Fixedsys = new Font("Courier New", 11);

            try
            {
#if DEBUG
                VlcInterface.KillLib();
#endif
                VlcInterface.ExtractLib();
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Unable to Extract VLC Library. Reason: {ex.Message}", "QuickPlay has to terminate", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Environment.FailFast("Unable to extract VLC Library", ex);
            }

            if (File != null)
            {
                CreatePlayer(File);
                Player.Play();
            }
            u = new UdpClient();
            u.Client.Bind(new IPEndPoint(IPAddress.Loopback, Program.UDP_PORT));
            u.BeginReceive(new AsyncCallback(dataRec), null);
        }
Esempio n. 2
0
        private void CreatePlayer(string FileName)
        {
            var V = 100;

            if (Player != null)
            {
                V = Player.Volume;
                Player.Dispose();
            }
            Player        = new VlcInterface(FileName);
            Player.Volume = V;
            //Repeat Mode
            Player.OnEnded += delegate
            {
                Player.Play();
            };
            tPlayerUpdate.Start();
            lblInfo.Text      = FileName;
            lblInfo.ForeColor = Color.Black;
        }