本文整理汇总了C++中CComQIPtr::GetCurrentPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ CComQIPtr::GetCurrentPosition方法的具体用法?C++ CComQIPtr::GetCurrentPosition怎么用?C++ CComQIPtr::GetCurrentPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComQIPtr
的用法示例。
在下文中一共展示了CComQIPtr::GetCurrentPosition方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTimer
LRESULT CLMoviePlayer::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
#if 0
CComQIPtr<ILXFrameworkFrame> frame;
m_app->m_spAddinSite->GetFrame(&frame);
CComPtr<ILXFrameworkApp> app;
frame->GetApp(&app);
// CComPtr<ILXUIMDIFrameElement> frameelement;
// frame->get_Element(&frameelement);
CComPtr<ILXUIDocument> appdocument;
app->get_Document(&appdocument);
CComQIPtr<ILMediaSeeking> seeking = m_filterGraph;
LONGLONG currentPos;
seeking->GetCurrentPosition(¤tPos);
CComPtr<ILDOMElement> element;
appdocument->getElementById(L"media_current", &element);
if (element)
{
WCHAR str[64];
swprintf(str, L"%g", (double)currentPos / LTIME_SCALE);
element->put_textContent(str);
}
#endif
return 0;
}
示例2: pos
extern "C" int WINAPI pos(HWND,HWND,char *data,char*,BOOL,BOOL)
{
CComPtr<IFilterGraph> pFG;
if(!GetFilterGraph(&pFG))
return 1;
CComQIPtr<IMediaSeeking> pMS = pFG;
REFERENCE_TIME pos, dur;
if(FAILED(pMS->GetCurrentPosition(&pos)) || FAILED(pMS->GetDuration(&dur)))
return 1;
if(dur > 10000000i64*60*60)
{
sprintf(data, _T("%02d:%02d:%02d/%02d:%02d:%02d"),
(int)(pos/10000000/60/60), (int)(pos/10000000/60)%60, (int)(pos/10000000)%60,
(int)(dur/10000000/60/60), (int)(dur/10000000/60)%60, (int)(dur/10000000)%60);
}
else
{
sprintf(data, _T("%02d:%02d/%02d:%02d"),
(int)(pos/10000000/60)%60, (int)(pos/10000000)%60,
(int)(dur/10000000/60)%60, (int)(dur/10000000)%60);
}
return 3;
}
示例3: GetPosition
MEDIA_TIME FMPlayerDShow::GetPosition()
{
MEDIA_TIME rtCur = 0;
CComQIPtr<IMediaSeeking> iSeeking = m_FilterGraph;
if (iSeeking)
{
iSeeking->GetCurrentPosition(&rtCur);
}
return rtCur;
}
示例4:
LRESULT CLX3DViewer::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
UINT wTimerID = (UINT)wParam; // timer identifier
if (wTimerID == m_nRunTimer)
{
CComQIPtr<ILMediaSeeking> seeking = m_filterGraph;
LONGLONG currentPosition;
seeking->GetCurrentPosition(¤tPosition);
m_currentPosition = currentPosition / 100000.0;
m_slider.SetPos(m_currentPosition);
InvalidateRect(&m_slider.GetRect());
UpdateWindow();
}
return 0;
}