Chapter 3 — Using the VTR API
35
Methods Exposed Through IVTRCenter
Methods Exposed Through IVTRCenter
The methods exposed through the IVTRCenter interface fall into three categories:
those used to initialize the component, those used to manage the serial port, and
those used to control the tape deck itself.
Component Initialization Method
long Initialize() –
This method should be called immediately after a Smart Pointer
to the IVTRCenter interface is created. It connects to and sets up the serial port
in preparation for sending commands to or receiving information from the tape
deck. Note that you should identify the serial port used for tape-deck communi-
cations
before
calling
Initialize()
. Do this by calling
PutComPort(val)
.
The
Initialize()
method returns 0 if successful, 1 if not.
Serial Communications Port Management Methods
long Connect()
long Disconnect() –
As discussed at the beginning of this chapter, these methods
allow you to connect or to disconnect from the serial port used to communicate
with the tape deck. Before returning control of the tape deck back to the Filter
Manager, you should call
Disconnect()
on the IVTRCenter interface. To return
control of the tape deck to the VTR component, first call the Filter Manager
VTRDisconnect()
method, then call the
IVTRCenter Connect()
method.
Both of these methods return 0 on success, -1 on error.
Tape Deck Control Methods
The remaining methods of the IVTRCenter interface allow you to issue commands
to the tape deck using Sony 9-pin protocol. The tape-deck control methods available
through the IVTRCenter interface are described below.
long Eject() –
Issues a command to the tape deck to eject the tape.
The method returns:
0 if the command was successful
-9 if the command failed
-32 if VTRType is not set to SONY_9_PIN.
long FFwd() –
Issues a command to the tape deck to fast-forward the tape.
The method returns:
0 if the command was successful
-17 if the command failed
-32 if VTRType is not set to SONY_9_PIN.