コード例 #1
0
//Ver 1.2
//Note : Because the program stores the state for only one compressor (in the pVideoCompressParams),
//if the user chooses "Configure" for compressor A, then chooses another compressor B and presses "Configure" again
//the previous state info for compressor A will be lost. 
void CVideoOptions::OnConfigure() 
{
	// TODO: Add your control notification handler code here
	int sel = ((CComboBox *) GetDlgItem(IDC_COMPRESSORS))->GetCurSel();
	if (sel != CB_ERR)  {	
		
		//Still unable to handle DIVX state (results in error)
		//if (compressor_info[sel].fccHandler==mmioFOURCC('D', 'I', 'V', 'X')) return;

				
		HIC hic = ICOpen(compressor_info[sel].fccType, compressor_info[sel].fccHandler, ICMODE_QUERY);		
		if (hic) {			
			
			//Set our current Video Compress State Info into the hic, which will update the ICConfigure Dialog
			SetVideoCompressState (hic , compressor_info[sel].fccHandler);
			
			ICConfigure(hic,m_hWnd);			

			//Get Video Compress State Info from the hic after adjustment with the ICConfigure dialog
			//This will set the external pVideoCompressParams variable which is used  by AVICOMPRESSOPTIONS
			//(This means the external variable pVideoCompressParams will be changed even if user press "Cancel")
			GetVideoCompressState (hic , compressor_info[sel].fccHandler);			
			
			ICClose(hic);
		}

	}	
	
}
コード例 #2
0
//Ver 1.2
// Note : Because the program stores the state for only one compressor (in the
// pVideoCompressParams), if the user chooses "Configure" for compressor A, then
// chooses another compressor B and presses "Configure" again the previous state
// info for compressor A will be lost.
void CVideoOptionsDlg::OnConfigure()
{
	int sel = m_ctrlCBCompressor.GetCurSel();
	if (sel != CB_ERR) {
		// Still unable to handle DIVX state (results in error)
		//if (pCompressorInfo[sel].fccHandler == mmioFOURCC('D', 'I', 'V', 'X'))
		//	return;

//TODO, How long is this code stil experimental and soo in use ???
#define EXPERIMENTAL_CODE
#ifdef EXPERIMENTAL_CODE
		CHIC chic;
		if (chic.Open(pCompressorInfo[sel].fccType, pCompressorInfo[sel].fccHandler, ICMODE_QUERY)) {
			// Set our current Video Compress State Info into the hic,
			// which will update the ICConfigure Dialog
			SetVideoCompressState(chic, chic.Handler());
			chic.Configure(m_hWnd);

			// Get Video Compress State Info from the hic after adjustment with the
			// ICConfigure dialog. This will set the external pVideoCompressParams
			// variable which is used by AVICOMPRESSOPTIONS (This means the external
			// variable pVideoCompressParams will be changed even if user press "Cancel")
			DWORD dwSize = chic.GetStateSize();
			LRESULT lResult = chic.GetState(m_cOpts.State(dwSize), dwSize);

			// if (lResult != dwSize)  ==> C4244 Warning, type mismatch
			if ( lResult - dwSize != 0 ) // Save
			{
				m_cOpts.State(0L);
			}
		}
#else
		HIC hic = ICOpen(pCompressorInfo[sel].fccType, pCompressorInfo[sel].fccHandler, ICMODE_QUERY);
		if (hic) {
			// Set our current Video Compress State Info into the hic, which will
			// update the ICConfigure Dialog
			SetVideoCompressState(hic, pCompressorInfo[sel].fccHandler);

			ICConfigure(hic, m_hWnd);

			// Get Video Compress State Info from the hic after adjustment with the
			// ICConfigure dialog. This will set the external pVideoCompressParams
			// variable which is used by AVICOMPRESSOPTIONS (This means the external
			// variable pVideoCompressParams will be changed even if user press "Cancel")
			GetVideoCompressState(hic, pCompressorInfo[sel].fccHandler);

			ICClose(hic);
		}
#endif
#undef EXPERIMENTAL_CODE
	}
}