diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-06-19 21:36:56 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-06-19 21:36:56 +0400 |
commit | 587d165341ab5a27594c037348a306ecd901ac4e (patch) | |
tree | 274f2c517c47b48c57491406979c97307bce17c0 /src/DSUtil/DSUtil.h | |
parent | b9664e1796e35229686d2e89cd223ef3c6a655b8 (diff) |
move PauseGraph and ResumeGraph defines to DSUtil.h so that they are not duplicated
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@5201 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/DSUtil/DSUtil.h')
-rw-r--r-- | src/DSUtil/DSUtil.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/DSUtil/DSUtil.h b/src/DSUtil/DSUtil.h index c39f7d2e2..d38caeeff 100644 --- a/src/DSUtil/DSUtil.h +++ b/src/DSUtil/DSUtil.h @@ -200,6 +200,25 @@ public: #define EndEnumSysDev }}}
+#define PauseGraph \
+ CComQIPtr<IMediaControl> _pMC(m_pGraph); \
+ OAFilterState _fs = -1; \
+ if (_pMC) _pMC->GetState(1000, &_fs); \
+ if (_fs == State_Running) \
+ _pMC->Pause(); \
+ \
+ HRESULT _hr = E_FAIL; \
+ CComQIPtr<IMediaSeeking> _pMS((IUnknown*)(INonDelegatingUnknown*)m_pGraph); \
+ REFERENCE_TIME _rtNow = 0; \
+ if (_pMS) _hr = _pMS->GetCurrentPosition(&_rtNow);
+
+#define ResumeGraph \
+ if (SUCCEEDED(_hr) && _pMS && _fs != State_Stopped) \
+ _hr = _pMS->SetPositions(&_rtNow, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning); \
+ \
+ if (_fs == State_Running && _pMS) \
+ _pMC->Run();
+
#define QI(i) (riid == __uuidof(i)) ? GetInterface((i*)this, ppv) :
#define QI2(i) (riid == IID_##i) ? GetInterface((i*)this, ppv) :
|