Chapter 4 — Sample Applications
51
FMTestApp
thread) to cue the next encode. This will ensure that the threads invoking the event
interfaces remain responsive to hardware events.
Note that, by implementing an event interface, you have effectively made your
client code a server for those events. This means you need to take into account the
synchronization of data accessed by objects using the event interface.
Running the Sample Application
The FMTestApp sample C++ application, portions of which have been discussed
in the previous sections of this chapter, is intended as an example of the use of the
Argus Filter Manager interface, not as an end-user application. However, it is
useful to compile and run the sample application to observe and understand the
operation of the Argus encoder.
Controlling the Tape Deck Between Encodes
Note that we have included a center panel on the user interface to demonstrate the
use of the auxiliary VTR component (described in Chapter 3) while not encoding.
Clicking on most of the buttons in this center panel results in a call to the VTR
interface. For example, clicking on the “Forward” button results in a call to
m_IVtr-
>FFwd()
, which causes the tape to fast-forward. Clicking on the “Get Mark In”
button calls
m_IVtr->GetTimeStamp()
, which reads the current time code from the
tape deck into the mark-in edit box. Clicking on “GetMarkOut” not only reads the
time code into the mark-out edit box, but it also calls the FilterManager
MakeDura-
tion()
method to calculate a duration based on the mark-in and mark-out.
Remember that this center panel is intended only to demonstrate the use of the
VTR interface. It is not comprehensive in its coverage of VTR-interface meth-
ods, nor is it very user-friendly. Note also that, although we always sandwich
VTR-interface calls between a
Connect()
and
Disconnect()
pair, this is not
always required. It is necessary only to call
m_IVtr->Connect()
once before
making a series of calls to the VTR interface, then to call
m_IVtr->Disconnect()
before returning the VTR serial port to the control of the Filter Manager inter-
face. For a more detailed explanation of the calls used in the center panel of the
interface, please refer to Chapter 3 of this manual.
Performing an Encode
The sample application offers a simple, straightforward user interface that dem-
onstrates encoding an MPEG asset. After entering the full pathname of the file
that will hold the MPEG stream, as well as the mark-in, mark-out, and duration
of the clip (all expressed in “hh:mm:ss:ff” format), press the Cue button, which
invokes the
OnInitialize()
method listed earlier.