示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (listBox1.GetSelected(0) || listBox1.GetSelected(1))
            {
                m_objMPFile.FileNameSet(listBox1.SelectedItem.ToString(), "");
            }
            else
            {
                m_objMPFile.FileNameSet(textBox1.Text.ToString(), "");
            }
            //m_objMPFile.FileNameSet(@"D:\Firefox\NUEVO Conejos con huron.mp4", "");
            m_objMPFile.FilePlayStart();
            m_objMPFile.FilePlayPause(0);

            M_VID_PROPS props;
            int         index;
            string      name;

            m_objMPFile.FormatVideoGet(eMFormatType.eMFT_Output, out props, out index, out name);

            double inTime;
            double outTime;
            double durTime;

            m_objMPFile.FileInOutGet(out inTime, out outTime, out durTime);

            double pos = 0.0;
            double curPos;
            double step = 60.0;

            bool ok = true;

            while (pos < durTime)
            {
                try
                {
                    m_objMPFile.FilePosSet(pos, 0);
                    Thread.Sleep(500);
                    m_objMPFile.FilePosGet(out curPos);

                    if (pos - curPos > step)
                    {
                        MessageBox.Show("Broken File");
                        ok = false;
                        break;
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString() + "Broken File");
                }
                pos += step;
            }
            if (ok)
            {
                MessageBox.Show("File is Ok");
            }
        }