This sample shows you how to control the external transport features of your DV device from IC Imaging Control. External Transport means starting, stopping, winding etc. of the tape in the DV device.
The source code for this sample program can be found in the samples\VB6\Controlling DV Devices sample source directory.
Create a new project and add IC Imaging Control to the form. Before you run the program, select the video device, input and video format as shown in the First Steps in Visual Basic 6 chapter. Alternatively, run the program without selecting a device. In this case, the program shows the device selection dialog provided by IC Imaging Control. If you close this dialog without having made a selection, the program will display an error message and terminate.
Now, add 2 buttons to the form and label them Start and Stop. Name the buttons cmdStart and cmdStop respectively.
Add calls to IC Imaging Control's LiveStart and LiveStop methods:
The sub cmdStart_Click contains additional code to advise the DV device to start playing after the Start button has been clicked. If this additional code is missing, you could click the start button, but IC Imaging Control would stay empty, until the external transport mode has been set to "play".
Now, add four new buttons to the form and label them Play, Stop, Rewind and FF. Name the buttons cmdETPlay, cmdETStop, cmdETRewind and cmdETFastForward respectively. These four new buttons are used to set the external transport mode.
Add the click events for the new buttons. Each of the four new buttons sets an external transport mode for IC Imaging Control.
At least, the Form_Load event should check, whether the current video capture device supports external transport. If the device supports external transport, the four buttons, that are used to set the external transport mode, should be enabled.
Calling IC Imaging Control's LiveStart method starts the image stream to capture images from the DV device. If the DV device has not got the "Play" command, no images are delivered from the DV device to IC Imaging Control. Thus, in order to get a live image from a DV device, LiveStart has to be called and then the transport mode has to be set to "Play":
ICImagingControl1.LiveStart
ICImagingControl1.ExternalTransportMode = ET_MODE_PLAY