예제 #1
0
파일: frmMain.cs 프로젝트: AyrA/QuickPlay
        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);
        }
예제 #2
0
파일: frmMain.cs 프로젝트: AyrA/QuickPlay
 private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (u != null)
     {
         u.Close();
         u = null;
     }
     if (Player != null)
     {
         Player.Dispose();
         Player = null;
     }
 }
예제 #3
0
파일: frmMain.cs 프로젝트: AyrA/QuickPlay
        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;
        }