private void DoIndex(IndexerType it, bool b) { IWMIndexer pIndex; WMUtils.WMCreateIndexer(out pIndex); IWMIndexer2 pIndex2 = pIndex as IWMIndexer2; pIndex2.Configure(0, it, null, null); m_IndexComplete = false; m_MaxIndex = 0; m_IndexError = 0; pIndex2.StartIndexing(sFileName, this, IntPtr.Zero); while (!m_IndexComplete) { if (b) { pIndex.Cancel(); } else { System.Threading.Thread.Sleep(0); } } if (m_IndexError != 0) { throw new COMException("Indexing error", m_IndexError); } }
private void Config() { IWMIndexer pIndex; WMUtils.WMCreateIndexer(out pIndex); IWMIndexer2 pIndex2 = pIndex as IWMIndexer2; pIndex2.Configure(0, IndexerType.FrameNumbers, null, null); pIndex2.StartIndexing(sFileName, this, IntPtr.Zero); while (!m_IndexComplete) { System.Threading.Thread.Sleep(0); } WMUtils.WMCreateSyncReader(IntPtr.Zero, Rights.Playback, out m_read); }