private void TestStream()
        {
            m_br     = new BinaryReader(new FileStream(sFileName, FileMode.Open, FileAccess.Read));
            m_Called = false;

            m_read.OpenStream(this, this, IntPtr.Zero);
            System.Threading.Thread.Sleep(5000);
            Debug.Assert(m_Called);
            m_br.Close();
        }
        private void TestStream()
        {
            m_br = new BinaryReader(new FileStream(sFileName, FileMode.Open, FileAccess.Read));

            IWMReader read = m_read as IWMReader;

            read.Close();
            m_read.OpenStream(this, this, IntPtr.Zero);
            m_br.Close();
        }
Esempio n. 3
0
        //------------------------------------------------------------------------------
        // Name: Open()
        // Desc: Creates the reader and opens the file.
        //------------------------------------------------------------------------------
        public void Open(string ptszFile)
        {
            Close();

            m_hrAsync = 0;

            //
            // Open input file
            //
            m_pStream.Open(ptszFile);

            //
            // initial state is "not set".
            //
            m_hEvent.Reset();

            //
            // Open the stream
            //
            m_pReader2.OpenStream(m_pStream, this, IntPtr.Zero);

            //
            // Wait for the open to finish
            //
            m_hEvent.WaitOne(-1, false);

            int i;

            m_pReader.GetOutputCount(out i);
            m_SampleCount = new int[i];

            // Turn on the user clock.  This will send samples to IWMReaderCallback::OnSample as fast
            // as it can.  If you comment this line out, samples will be sent at the rate specified
            // in the file (ie a 47 second clip will take 47 seconds to process).
            m_pReader2.SetUserProvidedClock(true);

            //
            // Check open operation result
            //
            if (m_hrAsync < 0)
            {
                throw new COMException("Open failed", m_hrAsync);
            }
        }