/// <summary> /// Navigates to the Root menu of the DVD title /// </summary> public void GotoRootMenu() { if (m_dvdControl == null) { return; } IDvdCmd cmd; m_dvdControl.ShowMenu(DvdMenuId.Root, DvdCmdFlags.Block | DvdCmdFlags.Flush, out cmd); if (cmd != null) { Marshal.ReleaseComObject(cmd); } }
void TestButton() { int hr; int pulButtonIndex; IDvdCmd ppCmd = null; hr = m_idc2.ShowMenu(DvdMenuId.Title, DvdCmdFlags.Flush, out ppCmd); DsError.ThrowExceptionForHR(hr); DsRect pRect = new DsRect(); hr = m_idi2.GetButtonRect(1, pRect); //ThrowExceptionForHR(hr); hr = m_idi2.GetButtonAtPosition(new Point(130, 130), out pulButtonIndex); DsError.ThrowExceptionForHR(hr); Debug.Assert(pulButtonIndex == 1, "TestButton"); }
public void ShowDvdMenu() { ServiceRegistration.Get <ILogger>().Debug("DvdPlayer: ShowDvdMenu"); _dvdCtrl.ShowMenu(DvdMenuId.Root, DvdCmdFlags.None, out _cmdOption); }
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 TestMenusAndButtons() { int hr; IDvdCmd ppCmd; DvdDomain dvdd; int pulButtonsAvailable; int pulCurrentButton; // Top menu hr = m_idc2.ShowMenu(DvdMenuId.Title, DvdCmdFlags.Flush | DvdCmdFlags.SendEvents, out ppCmd); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); Application.DoEvents(); hr = m_idi2.GetCurrentDomain(out dvdd); DsError.ThrowExceptionForHR(hr); Debug.Assert(dvdd == DvdDomain.VideoManagerMenu, "TestMenusAndButtons"); hr = m_idc2.SelectButton(2); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); Application.DoEvents(); hr = m_idi2.GetCurrentButton(out pulButtonsAvailable, out pulCurrentButton); DsError.ThrowExceptionForHR(hr); Debug.Assert(pulCurrentButton == 2, "TestMenusAndButtons2"); Debug.Assert(pulButtonsAvailable == 2, "TestMenusAndButtons2a"); // Button 1 leads to a chapter menu with 2 items hr = m_idc2.SelectButton(1); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); Application.DoEvents(); hr = m_idc2.ActivateButton(); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); hr = m_idc2.ReturnFromSubmenu(DvdCmdFlags.Flush | DvdCmdFlags.SendEvents, out ppCmd); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); hr = m_idc2.SelectRelativeButton(DvdRelativeButton.Lower); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); hr = m_idi2.GetCurrentButton(out pulButtonsAvailable, out pulCurrentButton); DsError.ThrowExceptionForHR(hr); Debug.Assert(pulCurrentButton == 2, "TestMenusAndButtons2"); hr = m_idc2.SelectAndActivateButton(1); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); hr = m_idc2.SelectButton(2); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); hr = m_idc2.SelectAtPosition(new Point(130, 130)); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); hr = m_idi2.GetCurrentButton(out pulButtonsAvailable, out pulCurrentButton); DsError.ThrowExceptionForHR(hr); Debug.Assert(pulCurrentButton == 1, "TestMenusAndButtons2"); hr = m_idc2.ReturnFromSubmenu(DvdCmdFlags.Flush | DvdCmdFlags.SendEvents, out ppCmd); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); hr = m_idc2.ActivateAtPosition(new Point(130, 130)); DsError.ThrowExceptionForHR(hr); Thread.Sleep(100); }