示例#1
0
        /// <summary>
        /// Enumerates available chapters. Needs to be executed after title changes.
        /// </summary>
        protected override void EnumerateChapters()
        {
            if (!_initialized || _dvdInfo == null)
            {
                return;
            }
            List <string>        chapters = new List <string>();
            DvdPlaybackLocation2 location;
            int hr = _dvdInfo.GetCurrentLocation(out location);

            if (hr == 0)
            {
                int chapterCount;
                _dvdInfo.GetNumberOfChapters(location.TitleNum, out chapterCount);
                for (int i = 1; i <= chapterCount; ++i)
                {
                    chapters.Add(GetChapterName(i));
                }
            }
            lock (SyncObj)
                _chapterNames = chapters.ToArray();
        }
示例#2
0
        void TestPlayTitle()
        {
            int     hr;
            IDvdCmd ppCmd = null;
            DvdPlaybackLocation2 pLocation;

            AllowPlay();
            hr = m_idc2.PlayTitle(2, DvdCmdFlags.Flush | DvdCmdFlags.SendEvents, out ppCmd);
            DsError.ThrowExceptionForHR(hr);

            Thread.Sleep(2000);

            hr = m_idi2.GetCurrentLocation(out pLocation);
            DsError.ThrowExceptionForHR(hr);

            hr = m_idc2.Stop();
            DsError.ThrowExceptionForHR(hr);

            Debug.Assert(pLocation.TitleNum == 2, "PlayTitle");
        }