Exemple #1
0
static void Video_OnDestroy(HWND hWindow)
/***********************************************************************/
{
	LPVIDEO lpVideo;

	if ( !(lpVideo = (LPVIDEO)GetWindowLong( hWindow, GWL_DATAPTR )) )
		return;

	if ( lpVideo->lpSwitches )
	{
		FreeUp( (LPTR)lpVideo->lpSwitches );
		lpVideo->lpSwitches = NULL;
	}
	if ( lpVideo->idLoopTimer )
	{
		KillTimer( hWindow, lpVideo->idLoopTimer );
		lpVideo->idLoopTimer = NULL;
	}
	Video_DrawProcInstall( hWindow, NULL/*lpSetProc*/, NULL/*lpDrawProc*/, 33/*wTimeDelay*/ );
	Video_Close( hWindow, lpVideo );
	if ( lpVideo->lpAllShots )
		FreeUp( lpVideo->lpAllShots );
	FreeUp( lpVideo );
	if ( bTrack )
	{
		ReleaseCapture();
		bTrack = NO;
	}
}
Exemple #2
0
void Video_Exit()
{
	//Video_Streamon();
	Video_Streamoff();
	Video_Close();
	Buffer_Free();
}
Exemple #3
0
void prep_exit()
{
	dbg_printf("Services_Close\n");
	Services_Close();
	dbg_printf("Subsystem_Close\n");
	Subsystem_Close();
	dbg_printf("Video_Close\n");
	extern void Video_Close();
	Video_Close();
}
Exemple #4
0
static BOOL Video_Open( HWND hWindow, LPVIDEO lpVideo, WORD wDisk, long lStartFrame )
/***********************************************************************/
{
	if ( !lpVideo )
		return( NO );

	HourGlass( YES );

	// Cleanup any open video file
	if ( lpVideo->lpSwitches )
	{
		FreeUp( (LPTR)lpVideo->lpSwitches );
		lpVideo->lpSwitches = NULL;
	}
	if ( lpVideo->idLoopTimer )
	{
		KillTimer( hWindow, lpVideo->idLoopTimer );
		lpVideo->idLoopTimer = NULL;
	}
	if ( lpVideo->hDevice )
	{
		Video_Close( hWindow, lpVideo );
		lpVideo->hDevice = NULL;
	}

	FNAME szFileName;
	GetWindowText( hWindow, szFileName, sizeof(STRING) );
	GetStringParm( szFileName, 0/*nIndex*/, ',', szFileName );
	lpVideo->lpSwitches = ExtractSwitches( szFileName );
	
	// Replace any %d in the file name with the disk number,
	// and flag whether we need to check disk labels
	wsprintf( szFileName, szFileName, wDisk );
		
	BOOL bFullScreen = (BOOL)GetSwitchValue( 'f', lpVideo->lpSwitches );
	VideoInit( NO/*ZoomBy2*/, bFullScreen );
	if ( !lpVideo->iZoomFactor )
	{
		if ( iDefaultZoomFactor )
			lpVideo->iZoomFactor = iDefaultZoomFactor;
		else
		{
			lpVideo->iZoomFactor = (int)GetSwitchValue( 'z', lpVideo->lpSwitches );
			if ( !lpVideo->iZoomFactor )
				lpVideo->iZoomFactor = 1;
		}
	}
	
	STRING szAlias;
	wsprintf( szAlias, "A%d%ld", wDisk, (LPSTR)hWindow );
	if ( !(lpVideo->hDevice = MCIOpen( GetApp()->m_hDeviceAVI, szFileName, szAlias, hWindow, lStartFrame )) )
	{
		HourGlass( NO );
		return( NO );
	}

	lpVideo->lFrames = MCIGetLength( lpVideo->hDevice );
	lpVideo->wDisk = wDisk;

	//MCISetVideoDrawProc( lpVideo->hDevice, NULL/*lpDrawDibProc*/, NULL/*lpDrawDCProc*/ );
	MCISetTimeFormat( lpVideo->hDevice, MCI_FORMAT_FRAMES );

	// force the control to take on the size of the video file
	RECT rect;
	GetClientRect( hWindow, &rect );
	MapWindowPoints( hWindow, GetParent(hWindow), (LPPOINT)&rect, 2 );
	SetWindowPos( hWindow, NULL, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top,
		SWP_NOZORDER | SWP_NOACTIVATE );

	HourGlass( NO );
	return( YES );
}