58
Argus Encoder Family Version 2.6 API Developer’s Guide
RegCtrlPnl
a default value to be given to the variable if no Registry setting is available. The
method returns TRUE if it is successful.
5.
Destructor
: Closes the Registry table.
Example: Loading an Encoder Registry Table
As an example of using the CRegistry class to load settings, the following method
loads some of the video encode settings from the “IBM Video” Registry table.
Again, this method is provided as an example of the calls required to read a table
from the Registry. In a production-quality application, you should check the return
of each of the included function calls to make certain that “rc” is equal to TRUE.
//////////////////////////////////////////
//Loads Video settings from the Registry//
//////////////////////////////////////////
void CVideoPage::InitializeVideoSettings()
{
CRegistry Settings ;
CRegistry Video ;
unsigned char VideoMode, RefFrameDistance;
unsigned long BitRate;
if( Settings.Open(HKEY_CURRENT_USER, ARGUS_KEY ) == TRUE )
{
if( Video.Open(Settings.hKey(), _T(“IBM Video”)) == TRUE )
{
Video.GetValue( _T(“BitRate”), &BitRate, 8000000 );
Video.GetValue( _T(“VideoMode”), (BYTE*)&VideoMode,
(BYTE)VM_AFF );
Video.GetValue( _T(“VerticalRes”), &m_ulVerticalRes, VRES_480 );
Video.GetValue( _T(“HorizRes”), &m_ulHorizRes, HRES_720 );
Video.GetValue( _T(“VideoFormat”), (BYTE*)&m_VideoFormat,
(BYTE)VF_NTSC );
Video.GetValue( _T(“Inverse32Flag”), &m_bInverse32Flag, FALSE );
Video.GetValue( _T(“InputType”), (BYTE*)&m_InputType,
(BYTE)VIS_HARDWARE_DEFAULT );
Video.GetValue( _T(“IFrameDistance”), &IFrameDistance, 15);
Video.GetValue( _T(“RefFrameDistance”), (BYTE*)