Chapter 4 — Sample Applications
59
RegCtrlPnl
&RefFrameDistance, (BYTE)FS_IBBP );
Video.GetValue( _T(“ChromaFormat”), (BYTE*)&m_ChromaSelect,
(BYTE)CF_4_2_0 );
Video.GetValue( _T(“ClosedGOP”), &m_bClosedGOP, FALSE );
Video.Close();
}
Settings.Close();
}
Example: Storing Values in an Encoder Registry Table
As an example of using the CRegistry class to store settings, the following func-
tion saves some of the video encode settings in the “IBM Video” Registry table.
Once again, in a production-quality application, you make certain that each call
returns TRUE before continuing to the next. Note that the Settings and Video
Registry sections are closed by the destructor when the Settings and Video objects
go out of scope.
////////////////////////////////////////
//Saves Video settings to the Registry//
////////////////////////////////////////
void CVideoPage::SaveVideoSettings()
{
unsigned char VideoMode,RefFrameDistance;
unsigned long IFrameSel,BitRate;
CString buff;
BitRate = (unsigned long)(m_fVideoBitrate * 1000000);
RefFrameDistance = m_cbRefFrameDist.GetCurSel() + 1;
VideoMode = m_cbVideoMode.GetCurSel();
IFrameSel = m_cbiFrameDist.GetCurSel();
m_cbiFrameDist.GetLBText(IFrameSel,buff);
IFrameDistance = _ttol(buff);
CRegistry Settings ;
CRegistry Video ;
if( Settings.Open(HKEY_CURRENT_USER, ARGUS_KEY ) == TRUE )
{