Chapter 4 — Sample Applications
57
RegCtrlPnl
RegCtrlPnl
The Sample C++ Registry-Control Application
Overview
As discussed in Chapter 2, and also in Appendix A and Appendix B, most of the
properties that must be defined before starting the encode process are set in Argus-
specific Windows Registry tables. Many of these properties can be set once when
the encoder software is installed and left unchanged thereafter. For the purpose of
setting all of the encoder parameters with the click of a single button, the RegCtr-
lPnl application is included with the SDK.
Specific applications, however, may need to reset a subset of the encoder proper-
ties before each encode. For example, most applications will assign a new MPEG
file path name with each encode. Other applications may allow the user to change
the video bit rate or resolution with each encode.
In order to adjust specific Windows Registry settings prior to an encode, you may
need to control the Registry programmatically. To allow programmatic access to the
encoder Registry tables, Vela has designed a C++ class (CRegistry), the source code
to which is provided in the RegCtrlPnl sample application. RegCtrlPnl uses the
CRegistry class to read from and to write to the encoder Registry tables. We encour-
age you to use the CRegistry class to access and modify the encoder Registry tables.
Example screen shots developed from the RegCtrlPnl program are shown at the end
of this section.
CRegistry Methods
The CRegistry class provides the following five methods (or, in the case of
numbers 3 and 4, types of methods).
1.
Constructor
: Creates an instance of the class and initializes its members.
2.
Open
: Opens the Registry. Returns TRUE if successful, FALSE otherwise.
3.
SetValue
: Writes a setting to the Registry. There are a number of SetValue
methods defined in the CRegistry class, each of which handles a specific data
type. The
SetValue()
method is usually called with two arguments: The name of
the Registry key and the value to be saved to that Registry key. The method
returns TRUE if it is successful.
4.
GetValue
: Reads a setting from the Registry. Again, there are a number of
GetValue methods defined in the CRegistry class, each of which handles a
specific data type. The GetValue method is usually called with three arguments:
The name of the Registry key, a pointer to a variable to hold the value read, and