void TestState() { int hr; IDvdCmd ppCmd; IDvdState dss; long diskid; int pl; AllowPlay(); hr = m_idc2.PlayChapterInTitle(1, 2, DvdCmdFlags.Flush | DvdCmdFlags.SendEvents, out ppCmd); DsError.ThrowExceptionForHR(hr); Thread.Sleep(500); hr = m_idi2.GetState(out dss); DsError.ThrowExceptionForHR(hr); hr = m_idc2.Stop(); DsError.ThrowExceptionForHR(hr); hr = dss.GetDiscID(out diskid); DsError.ThrowExceptionForHR(hr); // supposed to be a fixed number Debug.Assert(diskid == 6633412489990086489, "GetDiscID for testme.iso"); hr = dss.GetParentalLevel(out pl); DsError.ThrowExceptionForHR(hr); // no parental level set Debug.Assert(pl == -1, "GetParentalLevel"); }
protected override void DoStartRendererWithHint(RenderingStartHint startHint) { DvdRenderingStartHint hint = startHint as DvdRenderingStartHint; if (dvdGraphBuilder == null) { _vdi = new VideoDvdInformation(renderMediaName); InitMedia(); InitAudioAndVideo(); // Run the graph to play the media file int hr = mediaControl.Run(); DsError.ThrowExceptionForHR(hr); // Give enough time for the filter graph to be completely built Thread.Sleep(500); rotEntry = new DsROTEntry(mediaControl as IFilterGraph); } if (hint == DvdRenderingStartHint.MainMenu) { int hr = dvdControl2.ShowMenu(DvdMenuId.Title, DvdCmdFlags.Flush | DvdCmdFlags.Block, _lastCmd); DsError.ThrowExceptionForHR(hr); } else if (hint == DvdRenderingStartHint.Beginning) { int hr = 0; if (ProTONEConfig.DisableDVDMenu) { hr = dvdControl2.PlayTitle(1, DvdCmdFlags.Flush | DvdCmdFlags.Block, _lastCmd); } else { //dvdControl.PlayForwards(1f, DvdCmdFlags.Flush | DvdCmdFlags.Block, _lastCmd); hr = dvdControl2.ShowMenu(DvdMenuId.Title, DvdCmdFlags.Flush | DvdCmdFlags.Block, _lastCmd); } DsError.ThrowExceptionForHR(hr); } else if (hint.Location.ChapterNum == 0) { int hr = dvdControl2.PlayTitle(hint.Location.TitleNum, DvdCmdFlags.Flush | DvdCmdFlags.Block, _lastCmd); DsError.ThrowExceptionForHR(hr); } else { int hr = dvdControl2.PlayChapterInTitle(hint.Location.TitleNum, hint.Location.ChapterNum, DvdCmdFlags.Flush | DvdCmdFlags.Block, _lastCmd); DsError.ThrowExceptionForHR(hr); } if (ProTONEConfig.PrefferedSubtitleLang > 0) { int sid = _vdi.GetSubtitle(ProTONEConfig.PrefferedSubtitleLang); if (sid > 0) { SetSubtitleStream(sid); } } }
void TestPlayChapterInTitle() { int hr; IDvdCmd ppCmd; DvdPlaybackLocation2 pLocation; AllowPlay(); hr = m_idc2.PlayChapterInTitle(1, 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 == 1, "PlayChapterInTitle"); Debug.Assert(pLocation.ChapterNum == 2, "PlayChapterInTitle2"); }