/// <summary> /// Leaves a menu and resumes playback. /// </summary> public void Resume() { VerifyAccess(); if (m_dvdControl == null) { return; } IDvdCmd cmd; m_dvdControl.Resume(DvdCmdFlags.None, out cmd); if (cmd != null) { Marshal.ReleaseComObject(cmd); } }
// Get past all the menus to a point where titles can be played. void AllowPlay() { int hr; int buttonavail, curbutton; IDvdCmd ppCmd = null; DvdDomain dvdd; hr = m_idi2.GetCurrentDomain(out dvdd); DsError.ThrowExceptionForHR(hr); if (dvdd == DvdDomain.Stop) { hr = m_idc2.Resume(DvdCmdFlags.Flush, out ppCmd); if (hr < 0) { hr = m_idc2.ShowMenu(DvdMenuId.Title, DvdCmdFlags.Flush, out ppCmd); DsError.ThrowExceptionForHR(hr); } } while ((hr = m_idi2.GetCurrentDomain(out dvdd)) == 0 && ((dvdd == DvdDomain.VideoManagerMenu) || (dvdd == DvdDomain.VideoTitleSetMenu))) { hr = m_idi2.GetCurrentButton(out buttonavail, out curbutton); DsError.ThrowExceptionForHR(hr); if (curbutton > 0) { hr = m_idc2.SelectAndActivateButton(1); DsError.ThrowExceptionForHR(hr); } Thread.Sleep(500); } DsError.ThrowExceptionForHR(hr); hr = m_idc2.Stop(); DsError.ThrowExceptionForHR(hr); }
void TestPauseResume() { int hr; IDvdCmd ppCmd; DvdDomain dvdd; DvdPlaybackLocation2 pLocation, pLocation2; AllowPlay(); hr = m_idc2.PlayChapterInTitle(1, 2, DvdCmdFlags.Flush | DvdCmdFlags.SendEvents, out ppCmd); DsError.ThrowExceptionForHR(hr); Thread.Sleep(500); hr = m_idc2.Pause(true); DsError.ThrowExceptionForHR(hr); Thread.Sleep(3000); hr = m_idi2.GetCurrentLocation(out pLocation); DsError.ThrowExceptionForHR(hr); Thread.Sleep(3000); hr = m_idi2.GetCurrentLocation(out pLocation2); DsError.ThrowExceptionForHR(hr); Debug.Assert(pLocation.TimeCode.bSeconds == pLocation2.TimeCode.bSeconds, "TestPauseResume"); hr = m_idc2.Pause(false); DsError.ThrowExceptionForHR(hr); Thread.Sleep(500); hr = m_idi2.GetCurrentLocation(out pLocation2); DsError.ThrowExceptionForHR(hr); Debug.Assert(pLocation.TimeCode.bSeconds != pLocation2.TimeCode.bSeconds, "TestPauseResume2"); hr = m_idc2.ShowMenu(DvdMenuId.Root, DvdCmdFlags.Flush | DvdCmdFlags.SendEvents, out ppCmd); DsError.ThrowExceptionForHR(hr); Thread.Sleep(500); hr = m_idi2.GetCurrentDomain(out dvdd); DsError.ThrowExceptionForHR(hr); Debug.Assert(dvdd == DvdDomain.VideoManagerMenu, "TestPauseResume3"); hr = m_idc2.Resume(DvdCmdFlags.None, out ppCmd); DsError.ThrowExceptionForHR(hr); Thread.Sleep(500); hr = m_idi2.GetCurrentDomain(out dvdd); DsError.ThrowExceptionForHR(hr); Debug.Assert(dvdd == DvdDomain.Title, "TestPauseResume4"); hr = m_idc2.StillOff(); DsError.ThrowExceptionForHR(hr); hr = m_idc2.Stop(); DsError.ThrowExceptionForHR(hr); }