/p >
//// Is this an audio-only file (no video component)? ();
//// Have the graph signal event via window callbacks for performance (pME- gt; SetNotifyWindow ((OAHWND) ghApp, WM_GRAPHNOTIFY, 0)); (! g_bAudioOnly)
{
//Setup the video window (pVW- gt; put_Owner ((OAHWND) ghApp)); (pVW- gt; put_WindowStyle (WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN)); (InitVideoWindow (1, 1) );
}
{
//Initialize the default player size and enable playback menu items (InitPlayerWindow ());
}
//Complete window initialization (ghApp, SW_SHOWNORMAL); (ghApp); (ghApp); _ bFullscreen=FALSE; _PlaybackRate=1.0;
//# ifdef REGISTER_FILTERGRAPH
//hr=AddGraphToRot (pGB, amp; g_dwGraphRegister);
//if (FAILED (hr))
//{
//Msg (TEXT ( Failed to register filter graph with ROT! hr=0x% x ), hr);
//g_dwGraphRegister=0;
//}
//# endif
//Run the graph to play the media file (pMC- gt; Run ()); _ psCurrent=Running; (ghApp);
} hr;
}
//ЯInitVideoWindow (int nMultiplier, int nDivider)
{
//LONG lHeight, lWidth; hr=S_OK; rect; (! pBV) S_OK;
//Read the default video size
//hr=pBV- gt; GetVideoSize ( amp; lWidth, amp; lHeight); (hr == E_NOINTERFACE) S_OK;
//Account for requests of normal, half, or double size
/* lWidth=lWidth * nMultiplier/nDivider;=lHeight * nMultiplier/nDivider; nTitleHeight=GetSystemMetrics (SM_CYCAPTION); nBorderWidth=GetSystemMetrics (SM_CXBORDER); nBorderHeight=GetSystemMetrics (SM_CYBORDER); */(ghApp , amp; rect);
//Account for size of title bar and borders for exact match
//of window client area to default video size (ghApp, NULL, 0, 0, rect.right, rect.bottom, _NOMOVE | SWP_NOOWNERZORDER); (ghApp, amp; rect); (pVW- gt; SetWindowPosition (rect.left, rect.top, rect.right, rect.bottom)); hr;
}
//ЯInitPlayerWindow (void)
{
//Reset to a default size for audio and after closing a clip
/* SetWindowPos (ghApp, NULL, 0, 0, _AUDIO_WIDTH, _AUDIO_HEIGHT, _NOMOVE | SWP_NOOWNERZORDER); */
//Check the full size menu item
//CheckSizeMenu (ID_FILE_SIZE_NORMAL);
//EnablePlaybackMenu (FALSE, 0); S_OK;
} CheckVisibility (void)
{lVisible; hr; ((! pVW) || (! pBV))
{
//Audio-only files have no video interfaces. This might also
//be a file whose video component uses an unknown video codec._bAudioOnly=TRUE ;;
}
{
//Clear the global flag_bAudioOnly=FALSE;
}=pVW- gt; get_Visible ( amp; lVisible); (FAILED (hr))
{
//If this is an audio-only clip, get_Visible () will not work.
//
//Also, if this video is encoded with an unsupported codec,
//we will not see any video, although the audio will work if it is
//of a supported format.
//(hr == E_NOINTERFACE)
{_ bAudioOnly=TRUE;
}
{(TEXT ( Failed (% 08lx) in pVW- gt; get_Visible ()! r n ), hr);
}
}
} PauseClip (void)
{(! pMC);
//Toggle play/pause behavior ((g_psCurrent == Paused) || (g_psCurrent == Stopped))
{(SUCCEEDED (pMC- gt; Run ())) _ psCurrent=Running;
}
{(SUCCEEDED (pMC- gt; Pause ())) _ psCurrent=Paused;
}
} StopClip (void)
{hr; ((! pMC) || (! pMS));
//Stop and reset postion to beginning ((g_psCurrent == Paused) || (g_psCurrent == Running))
{pos=0;=pMC- gt; Stop (); _ psCurrent=Stopped;
//Seek to the beginning=pMS- gt; SetPositions ( amp; pos, AM_SEEKING_AbsolutePositioning ,, AM_SEEKING_NoPositioning);
//Display the first frame to indic...