Previous: Multimedia capabilities
Up: Multimedia capabilities
Next: MMedUtils
Previous Page: Multimedia capabilities
Next Page: MMedUtils
VdDscMgr, short for VideoDiscManager, is a Turbo Pascal unit providing routines to client compilation units to perform fundamental operations with videodisc, and possibly, in the future, CD-ROM. The current version is designed solely from experience with IBM's M-Motion/A multimedia adapter and its M-Control program components. It is intended, of course, to be portable across different multimedia video (or video and audio) cards; but without experience with those cards, we cannot say at present what features of M-Motion and M-Control it may now rely on which other popular multimedia cards might not support. We hope, however, that all dependencies are isolated in the unit MMedUtils, described following this one.
VdDscMgr is explicitly intended as a companion unit to Ports, for the support of computer-student dialogues. It does not presume any event queues or windowed runtime support.
VdDscMgr does not yet have fully adequate handling for the exceptions that an external, parallel device like a videodisc player can present. It relies on the player's being correctly connected at initialisation, with power on, and neither disconnected nor switched off during execution.
unit VdDscMgr;
{ First attempt at videodisc manager unit for Turbo Pascal,
using IBM's M-Motion/A video card for videodisc image capture
and control. Derived from linear test program.
17 Dec. 90. A. Milne }
interface
uses MMedUtil;
const viNameMaxLength = 40;
type viDirection = (viReverse, viForward);
viSpeeds = (viStillSpd, viPlaySpd, viScanSpd, viFastSpd,
viUserDefSpd);
viComponent = (viAudio, viVisual, viAudioVisual);
viSndChannel = (viChnl1, viChnl2, viBothChnls);
viDiscIDStr = STRING[viNameMaxLength];
FrmAddrRng = MMedUtil.FrmAddrRng;
procedure viSlide( Location: FrmAddrRng);
procedure viSlideLarge( Location: FrmAddrRng;
xSctnLeft,ySctnTop, xSctnRight,ySctnBottom: real);
procedure viFilm( Start, Stop: FrmAddrRng; Component: viComponent);
procedure viStartFilm( Start, Stop: FrmAddrRng; Component: viComponent);
procedure viStop(VAR StoppedAt: FrmAddrRng);
function viStatus: viStates;
procedure viStillSound( StillFrame, SndStart, SndStop: FrmAddrRng);
function viSetSndChannel( NewChannel: viSndChannel): viSndChannel;
procedure viInit( BaseFrame: FrmAddrRng);
procedure viClear( Xl, Yt, Width, Height: INTEGER);
function viCurrentFrame: FrmAddrRng;
procedure viWhatDiscName( var VideoDiscID: viDIscIDStr);
(**
procedure viReadSettings( var indexshown: boolean;
var CurrentSpeed: viSpeeds;
var CurrentDirection: viDirection);
**)
procedure viSetFrmIdxDisp( DisplayOn: BOOLEAN);
procedure viSetSpeed( NewSpeed: viSpeeds);
procedure viSetSpeedPercent( Percentage: integer);
procedure viSetDirection( NewDirection: viDirection);
{* procedure viSetTrace( FileName: STRING; TurnOn: BOOLEAN);*}
implementation
procedure viInit( BaseFrame: FrmAddr);
viInit performs essential initialisation for VdDscMgr, and must be called before any other routine from the manager is used.
BaseFrame is the amount of displacement by which all frame numbers given to VdDscMgr routines during a given execution are to be raised. In most cases this will simply be 0; however, this can be used, if necessary, to compensate for pressing or editing errors that leave material displaced on the videodisc.
viInit leaves the current target area for video on the screen as the whole text/graphics part of the screen; however, since this leaves a black border unused, there is a small amount of shrinking in the video to fit this area.
See below under mmInit4.2
procedure viSlide( Location: FrmAddr);
viSlide jumps the videodisc player to frame number Location and shows the contents of that frame in the current video display area, which will typically have been established by Ports4.3, MMedUtils4.2, and the client program's port definitions.
procedure viSlideLarge( Location: FrmAddr; xSctnLeft,ySctnTop, xSctnRight,ySctnBottom: real);
viSlideLarge jumps the videodisc player to frame number Location, and adjusts the viewing so that only a section of the frame's image is seen, adjusted in size to fill the currently set display area on the screen. (xSctnLeft, xSctnTop), and (xSctnRight,ySctnBottom) give the coordintes within the image, specified in percentages of the full height and width of the image, of the corners of that section. This routine is not yet implemented.
procedure viFilm( Start, Stop: FrmAddr; Component: viComponent);
viFilm jumps the videodisc player to frame number Start, and causes it to play until it reaches frame Stop, displaying the live video into the current video display area. (If Stop is less than Start, the video plays in reverse.) Whether to play audio alone, video alone, or both is selected by Component.
The call does not return until the Stop frame has been reached. The last frame remains still in the video display area, unless some action is taken to replace it.
procedure viStartFilm( Start, Stop: FrmAddr; Component: viComponent);
viStartFilm performs just as viFilm does, but returns to the caller as soon as play has started. This is necessary whenever the program needs to take any action during the play. The calling routine should check viStatus, below, when it needs to determine whether the play has stopped.
Besides by reaching the Stop frame, play can be stopped by calling viFilm or viSlide, which will first stop the play before performing their own display.
procedure viStop(VAR StoppedAt: FrmAddr);
viStop checks whether a play is in progress, and if it is, stops it. The frame number at which play stops, or the current one if no play is in progress, is returned in StoppedAt.
function viStatus: viStates;
viStatus allows a generalised check of the videodisc manager's status. At present this consists simply of:
procedure viStillSound( StillFrame, SndStart, SndStop: FrmAddr);
viStillSound jumps the videodisc player to frame StillFrame to display its contents as a slide in the current video area, then freezes video input to prevent disturbing it, and plays audio only from SndStart to SndStop. This combination has been called a freeze.
function viSetSndChannel( NewChannel: viSndChannel): viSndChannel;
viSetSndChannel presumes that the videodisc being used supports two separate sound tracks or channels, identified as channel 1 and channel 2, and causes subsequent audio and audiovisual plays to use the audio from the combination of channels specified by NewChannel.
Since using neither channel constitutes simply playing video alone, omitting sound should be done by passing viAudio to the Components parameter for viFilm or viStartFilm. This avoids questions of precedence and other confusions between two parameter settings with overlapping meanings.
NOTE: it is important to choose exactly the right combination of channels for a given play, since the two channels may be used for different kinds of sounds, rather than effecting stereo. Furthermore, at least one kind of videodisc player has been noted not to play either channel if both channels are selected but only one recorded on.
procedure viClear( Xl, Yt, Width, Height: INTEGER);
viClear wipes the area of the screen starting at the point (Xl,Yt) in the upper left, and extending Width and Height pixels from it, clear of video, replacing it with video black. Text and graphics in the M-Motion version are not affected.
Note that viClear permits screen areas to be specified other than the current video display area.
function viCurrentFrame: FrmAddr;
viCurrentFrame returns the frame number where the player is currently positioned. It can be called whether a play is in progress or not; however, some allowance may have to be made for a slightly delayed report from the player, in the case of a play, which could leave the reported frame number a couple of frames behind the true one.
procedure viWhatDiscName( var VideoDiscID: viDIscIDStr);
viWhatDiscName attempts to obtain an identification string from its special location on the videodisc, and return it. Note below under mmWhatDiscID for its limitations.
procedure viReadSettings( var indexshown: boolean; var CurrentSpeed: viSpeeds; var CurrentDirection: viDirection);
viReadSettings permits the caller to obtain the current values of certain variables global to the videodisc support:
procedure viSetFrmIdxDisp( DisplayOn: BOOLEAN); procedure viSetSpeed( NewSpeed: viSpeeds); procedure viSetDirection( NewDirection: viDirection);