Chapter 4 — Sample Applications
45
FMTestApp
Windows editable text fields that represent the encoder operator’s settings for
duration, mark-in, mark-out, and the full pathname of the file that will hold the
encoded MPEG stream.
If you are upgrading from version 2.2 of our software, you'll notice that there are
a few changes to the
OnInitialize()
. Most of these changes reflect either the more
comprehensive Windows Registry settings or the more extensive error-handling
implemented in version 2.4 of the software. We recommend that you make simi-
lar changes to your existing application.
• The rewritten method now checks the setting of m_bErrorFlag, calling
FilterManager
Reset()
if, and only if, an error occurred during a previous
encode. This re-initializes many of the encoder properties that are kept in
memory, and it resets each of the COM components. The m_bErrorFlag
should be set in the
OnError()
event handler.
• The rewritten method now calls
SaveDataToRegistry()
to save the file name
and the time codes on the GUI to the appropriate Windows Registry tables.
As discussed in earlier sections of the manual, when you use version 2.6 of
the software, using the Registry is the preferred method of saving and load-
ing all of the encoding properties.
• Checking the return value of the
Load()
component is especially important in
version 2.6 of the software. The FilterManager
Load()
method now does a
much more thorough job of validating encode parameters than it did under
versions earlier than 2.3 of the code.
• When Filter Manager calls return an error code (a negative number), the
sample application now displays the error code as well as a brief descriptive
message in the message box.
• If the
Cue()
call returns an error code, the m_bErrorFlag is set to TRUE.
void CFMTestAppDlg::OnInitialize()
{
long result;
IArgusFM *pFM = pFMInterface->GetFMPointer();
CString ErrMsg;
// If the previous encode resulted in an error, be sure to perform a reset before
// saving data to the registry.
if( m_bErrorFlag )