Category : Files from Magazines
Archive   : OCT91.ZIP
Filename : 2N10053A
// VCR::VCR - Constructor for VCR
// VCR::~VCR - Destructor for VCR
// VCR::SendCommand - Send command string to VCR
// VCR::Stop - Puts the VCR into Stop mode.
// VCR::Eject - Causes the tape to be ejected from the VCR.
// VCR::Rewind - Places the VCR into full speed rewind.
// VCR::FastForward - Places the VCR into full speed fast forward.
// VCR::PlayFastReverse - Places the VCR into fast reverse play.
// VCR::PlayFastForward - Places the VCR into fast forward play.
// VCR::Still - Causes the VCR to Still on the current frame.
// VCR::Record - Begin recording mode.
// VCR::Play - Begins normal play mode.
// VCR::ReversePlay - Begins normal reverse play mode;
// VCR::StepForward - From a still frame, advance to next field.
// VCR::StepReverse - From a still frame, step to previous field.
// VCR::PowerToggle - Toggle VCR power.
#include "VCR.h"
/******************************************************************
* VCR::VCR - Constructor for VCR
*
* Parameters:
* int nNewPortAddress - default is address for COM1:
*
* Class Variables Used:
* SerialPort *spSerialPort;
*
* Returns:
* Nothing
*
* Notes:
* 1. Configures serial port to 9600 baud, 8 data bits,
* no parity, and 1 stop bit.
* Copyright:
* Original code by William H. Roetzheim (619) 669-6970
* Copyright (c) 1991 by William H. Roetzheim
* All rights reserved.
*
**********************************************************************/
VCR::VCR (int nNewPortAddress)
{
spSerialPort = new SerialPort (nNewPortAddress, "VCR");
spSerialPort->>SetBaud (9600);
spSerialPort->>SetBitsPerWord (8);
spSerialPort->>SetStopBits (1);
spSerialPort->>SetParity (NoParity);
}
/******************************************************************
* VCR::~VCR - Destructor for VCR
*
* Parameters:
* None.
*
* Class Variables Used:
* Port *SerialPort
@cplus = *
**********************************************************************/
VCR::~VCR ()
{
delete spSerialPort;
}
/******************************************************************
* VCR::SendCommand - Send command string to VCR
*
* Parameters:
* Str sCommandString - String to be output
*
* Class Variables Used:
* Port *SerialPort
*
**********************************************************************/
void VCR::SendCommand (Str sCommandString)
{
// Send start of command string character
spSerialPort->>OutChar (0x02);
// Send command string
int i;
for (i = 0; i << sCommandString.Length (); i++)
{
spSerialPort->>OutChar (sCommandString.Slice (i));
}
// Send end of command string character
spSerialPort->>OutChar (0x03);
}
/******************************************************************
* VCR::Stop - Puts the VCR into Stop mode.
*
* Notes:
* 1. This will abort any command in process, and stop
* any tape motion.
*
* 2. This command should not normally be used to terminate
* an assembly or insert edit. Stop will immediately
* stop the VCR, preventing a clean edit transition. Use
* Still instead to allow the VCR to establish proper
* sync at the edit out point.
*
* 3. The tape is left loaded on the head to allow quick
* resynchronization after a new play command.
*
* 4. Maximum command duration is 300 ms.
*
* 5. Audio and video are immediately placed into passthrough.
*
**********************************************************************/
void VCR::Stop (void)
{
SendCommand ("A@@");
@cplus = }
/******************************************************************
* VCR::Eject - Causes the tape to be ejected from the VCR
*
* Notes:
* 1. Reception of this command will abort any command
* in process, and eject the tape. If no tape is
* in the VCR, the command has no effect.
*
* 2. After a tape has been ejected, it can only be reloaded
* into the VCR manually.
*
* 3. Maximum command duration is 5 seconds.
*
* 4. Audio and video are immediately placed into passthrough.
*
**********************************************************************/
void VCR::Eject (void)
{
SendCommand ("A@A");
}
/******************************************************************
* VCR::Rewind - Places the VCR into full speed rewind
*
* Notes:
* 1. This is the fastest way to position the tape in the
* reverse direction. No audio or video is output during
* the rewind.
*
* 2. This command cannot be used if high accuracy is required.
* Since the tape is moved at high speed, minor errors in the
* frame count will result every time this command is executed.
* If high accuracy is required, the PlayFastReverse () command
* must be used instead.
*
* 3. Maximum command duration, 300 mSeconds to start rewinding.
*
* 4. Audio and video are placed into passthrough.
*
**********************************************************************/
void VCR::Rewind (void)
{
SendCommand ("A@B");
}
/******************************************************************
* VCR::FastForward - Places the VCR into full speed fast forward
*
* Notes:
* 1. This is the fastest way to position the tape in the
* forward direction. No audio or video is output
* during the fast forward.
*
* 2. This command cannot be used if high accuracy is
* required. Since the tape is moved at high speed,
@cplus = * minor errors in the frame count will result every time
* this command is executed. If high accuracy is required,
* the PlayFastForward () command must be used instead.
*
* 3. Maximum command duration is 300 mSeconds to begin fast
* forwarding.
*
* 4. Audio and video are placed in passthrough.
*
**********************************************************************/
void VCR::FastForward (void)
{
SendCommand ("A@C");
}
/******************************************************************
* VCR::PlayFastReverse - Places the VCR into fast reverse play
*
* Notes:
* 1. This mode moves the tape as fast as possible, while
* still providing a video picture. No audio is output
* during the motion.
*
* 2. This is the fastest way to move the tape in the reverse
* direction and still maintain high tape count accuracy.
*
* 3. The tape speed in this mode is 7X play (SP mode) or 21X
* play (SLP mode).
*
* 4. If very high accuracy is required, use of the CueToFrame ()
* command is preferred, since abrupt tape stops may cause minor
* count errors. Allowing the tape to run off the beginning
* may also cause errors in the tape count.
*
* 5. Maximum command duration is 300 mSeconds to begin play.
*
* 6. Video plays (with high speed noise bars), audio is muted.
*
**********************************************************************/
void VCR::PlayFastReverse (void)
{
SendCommand ("A@D");
}
/******************************************************************
* VCR::PlayFastForward - Places the VCR into fast forward play
*
* Notes:
* 1. This mode moves the tape as fast as possible, while
* still providing a video picture. No audio is output
* during the motion.
*
* 2. This is the fastest way to move the tape in the forward
* direction and still maintain high tape count accuracy.
*
* 3. The tape speed in this mode is 7X play (SP mode) or 21X
* play (SLP mode).
*
@cplus = * 4. If very high accuracy is required, use of the CueToFrame ()
* command is preferred, since abrupt tape stops may cause minor
* count errors. Allowing the tape to run off the end
* may also cause errors in the tape count.
*
* 5. Maximum command duration is 300 mSeconds to begin play.
*
* 6. Video plays (with high speed noise bars), audio is muted.
*
*
**********************************************************************/
void VCR::PlayFastForward (void)
{