Exemple #1
0
        private void btnBrowse_Click(object sender, EventArgs e)
        {
            var ofd = new OpenFileDialog();
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                tbFileName.Text = ofd.FileName;
                m_play = new Capture(panel1, tbFileName.Text);
                tbFileName.Enabled = false;

                // Let us know when the file is finished playing
                m_play.StopPlay += new Capture.CaptureEvent(m_play_StopPlay);
                m_State = State.Stopped;

                ShowTime();
            }
        }
Exemple #2
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            // If we have no file open
            if (m_play == null)
            {
                // Open the file, provide a handle to play it in
                m_play = new Capture(panel1, tbFileName.Text);

                // Let us know when the file is finished playing
                //m_play.StopPlay += new Program.DxPlayEvent(m_play_StopPlay);
                //m_State = State.Stopped
            }

            //need modify
            btnStart.Text = "Stop";
            m_play.Start();
            btnPause.Enabled = true;
            tbFileName.Enabled = false;
            m_State = State.Playing;
        }
Exemple #3
0
        /// <summary>
        /// Browsing to the video file
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnBrowse_Click(object sender, EventArgs e)
        {
            var ofd = new OpenFileDialog();
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                tbFileName.Text = ofd.FileName;

                if (m_play != null)
                {
                    this.btnStart.BackgroundImage = global::ShotsDetect.Properties.Resources.images;

                    m_play.Dispose();
                    lbPlay.Items.Clear();
                }
                try
                {
                    m_play = new Capture(panel1, tbFileName.Text);
                    tbFileName.Enabled = false;

                    char[] sep = { '\\' };
                    String[] list = tbFileName.Text.Split(sep);
                    lbPlay.Items.Add(list[list.Length - 1]);

                    m_play.getMediaPosition().get_StopTime(out duration);

                    // Let us know when the file is finished playing
                    m_play.StopPlay += new Capture.CaptureEvent(m_play_StopPlay);
                    m_State = State.Stopped;

                    ShowTime();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Load file failed!");
                    tbFileName.Text = "";
                }
            }
        }