If the the player is in any play mode or in pause, stops the rotation of the disc. If the disc is already stopped or there is no disc, opens the door.
To stop the disc without risk of ejecting it, use video("stop")
Example
-- stop then eject the disc
get videodisc("reject")
get videodisc("reject")
videodisc(Step)
videodisc(status time)
videodisc("status time")
videodisc("status chapter")
Returns the current chapter or elapsed time for CLV discs.
Note:
videodisc(reject)
videodisc(step)
ideodisc(Step re
videodisc("step")
videodisc("step reverse")
Steps by one frame from the current frame and leaves the player in still mode.
videodisc(stop)
ideodisc(reject)
videodisc("stop")
videodisc("reject")
Both forms of this function call have the same effect.
Stops the spinning of the disc. On most players, the video picture is replaced by a blank background.
On Pioneer players, calling this function when the disc is already stopped also ejects the disc. You might want to check the player status with videodisc("status player") before calling videodisc("stop") to avoid unexpected opening of the player's door.
videodisc(pause)
videodisc("pause")
Stops the playing, but leaves the laser arm at the current frame position. The picture disappears (except on LD-V8000).
videodisc(status keydata)
videodisc("status keydata")
Returns the key (user) data embedded on the disc, if any. Does not work on the LD-V2200.
If no data is available, returns null.""""""""not availabe,
videodisc(open)
videodisc(status <status item>)
videodisc(play [from <spec>] [to
c(Scan)
videodisc(Scan R
videodisc(Scan)videodisc(Scan Re
videodisc(status frame)
videodisc(set key lock
videodisc(stop)
videodisc(set port
videodisc(set speed
videodisc(status time)
videodisc(select audio
videodisc(set stop [frame|chapte
videodisc(status disc)
videodisc(stop)videodisc(reject)
videodisc(initialize)
videodisc(status keydata)
videodisc(play [from <spec>] [to
Starts playing from the current position. If the disc is stopped, starts playing from frame 1. The playing stops when a stop mark is encountered.
The <spec> for the optional from and to arguments is either a frame number, or the word chapter followed by a number.
The optional speed parameter is a number from 1 to 255. If it is omitted, normal play speed is assumed.
Examples:
get videodisc("play")
get videodisc("play, 240") -- at 6 times normal speed
get videodisc("play reverse") -- at normal speed, but in reverse
get videodisc("play from 2345 to 2378", 10) -- at 1/6th normal speed
The script of this book contains a general purpose function to control a videodisc player. This specific book is dedicated to the Pioneer LD-V2200 player; it also works with the LD-V4200 and the LD-V8000. Another book with the same function could control another board. The script, controls and features of the first page are included as examples of the kinds of things you can do by calling the function in the script of this book.
Typically, the way to use this book is by including it in the system variable sysBooks to make its functions available to your application. For instance, the enterBook handler in the script of your application book could contain the statement "push LD-V2200.TBK onto sysBooks". You can use more than one system book at the same time; for instance, another system book could contain the functions to control a videodisc player, and yet another one could contain handlers and functions for a test scoring system.
ions for a test scoring system.
How to use this book with your application
All video control is through one function, videodisc , which you call with different arguments.
A typical call to video is in the form
get videodisc<command>[, <parameter>])
Some of the calls require the parameter; a few don't. See the reference section of this book for details.
Function calls to videodisc return 1 if successfull or a negative number if they failed. Typical causes of errors would be that videodisc("open") was not called successfully earlier in the session, or that one of the arguments to the function was illegal or out of range. This function also uses an auxiliary DLL, TBK-COMM.DLL which is available on the Asymetrix BBS.
Videodisc Control
videodisc(select audio
<channel
Selects the audio channel(s) to be played from the disc. .
The <channel spec> parameter is 0 for no audio, 1 for channel 1, 2 for channel 2, and 3 for stereo.
evel is set to the current audio level.
video("fade in") sets it to 255 , and video("fade out") sets it to 0 .
videodisc("select audio",<channel spec>)
videodisc(status playerType)
videodisc("status playerType"))>")
Returns information on the player type. If the function recognizes the player's code, it returns a manufacturer and model number as well as the code, otherwise it returns only the code.
Example:
get videodisc("status playertype")
if it contains "Pioneer LD-V2200"
return true
else
request "Oops. That's not a LD-V2200!"
return false
-- Script
demo
-- Last rev. 6/4/90
HC.O.
ooldBSize
defSize
5805,840
5805,840
enable
"help"
odefBounds <>
videodisc("Open", defcomport
8) < 0
"Cannot initialize the
=. Video controls will have"\
&& "no effect."
default
4s_inHelp
s_videodisc_init <>
Stop")
Close")
"frame"
"chapter"
exitHelp
"5805,840"
defsize
setControls
4s_discType, s_discControls
"CLV"
"Time"
"CAV callouts"
"Frame"
4s_suspend_fr, s_suspend_ch, s_videoDisc_init,
<> "
<> "CAV"
status
c":"
isNumber(
"No response"
"Videodisc player off
disconnected."\
&& "Closing driver.
doHelp
disable
defbounds
ExitHelp
activateInstance
Manother instance
same
mode
-- but we are activating
5which
-- Special stuff
maintain correct proportions, etc.
buttons
-- on
cauthoring
adjust x --**
-- reset
moved
objs
-15,
-15,
-15,\
-15,
-15,
-15,
- 15,\
setCaption what
0,50.1875,0
z cpT
vePage
doHelp
ExitHelp
enterPage
activateInstance
setControls
adjust
setCaption
disable
leavePage
enable
enterPage
oldBSize
defSize
enable
reader
defBounds
defBounds
sizeToPage
defcomport
videodisc
Cannot initialize the videodisc. Video controls will have
no effect.
default
leavePage
Close
videodisc
frame
chapter
cpexitHelp
5805,840
defBounds
defsize
sizetopage
s_inHelp
setControls
frame or time
help frame or time
CLV controls
CAV callouts
CLV callouts
frame or time
Frame
help frame or time
Frame
CLV controls
CLV callouts
CAV callouts
s_discType
s_discControls
chapter
frame
chapter
frame
status disc
videodisc
status time
videodisc
frame
status frame
videodisc
isNumber
frame
setControls
No response
Videodisc player off or disconnected.
Closing driver. Videodisc controls will have no effect.
Close
videodisc
status chapter
videodisc
isNumber
chapter
default
s_suspend_fr
s_suspend_ch
s_videoDisc_init
s_discType
doHelp
ox%disable
defbounds
defSize
sizeToPage
default
s_inHelp
ExitHelp
defSize
defbounds
enable
default
s_inHelp
activateInstance
defSize
cpExitHelp
s_inHelp
adjust
defBounds
setCaption
disable
enable
0,0,0
8b9j:f;`<V=
jxm&n|n
vDvjv
w(wNwtw
defsize
5805,840
defBounds
122,198,517,281
oldBSize
5805,840
This sample page exercises the videodisc control function in the script of this book. For more information about this function and its parameters, and how to use it with your own application, click "How to Use This Book".
Current Chapter and Frame numbers. To go to a chapter or frame number directly, simply type it into one of these fields and press Enter. Press Esc to have numbers update automatically again. r
Stop Disc
Reset Disc
Scan Reverse
Variable Speed Play
for CAV discs only
(Drag the thumb or click)
Reverse Still Forward
Other neat trick:
Right-click the mouse to show/hide chapter and frame numbers in the video picture.
field-1
reset --**
proportions
moved
- 15,
- 15,\
- 15,
-15,
reset
reset
phone number
dial (
keydown
keydown
zalignment
centered
C.0. 6/4/900
Copyright
1990 Asymetrix Corporation
Exit Help
4s_inHelp
defComPort
"Default COM port
videodisc control
&& ". Choose the
use."
f"COM1"
"COM2"
"COM3"
"123"
dummy
(Close)
(Open)
default
odefBounds
adjust
buttonUp
buttonDown
buttonUp
defComPort
Default COM port for videodisc control is now COM
defComPort
. Choose the port to use.
defComPort
videodisc
defComPort
videodisc
default
Close
dummy
s_inHelp
buttonDown
defBounds
2925,4800,3825,5100
Set COM Port
CLV controls
videodisc("
buttonStillDown
buttonStillDown
pause
videodisc
CAV callouts
Play Reverse
Step Reverse
Stepl/Step
CLV Callouts
Pause
CLV overlay
videodisc("still")
buttonStillDown
buttonStillDown
still
videodisc
Disc is CLV
6930,5130
videodisc(status player)
videodisc("status player") item>")
Returns status information about the current state of the player. The returned value can be either:
-1 (see videodisc("Open"))
Dead (player is off or not connected correctly)
Door Open
Set Up
Disc Unloading
Still
Pause
Search
Multi-speed play
videodisc(status disc)
videodisc("status disc"))s item>")
If no disc is currently loaded, returns "No disc"
Otherwise, returns a string of 4 items.
Item 1: Disk type (CAV or CLV or unknown)
Item 2: Disc size (12 inch or 8 inch)
Item 3: Disc side (1 or 2 or unknown)
Item 4: Whether the disc has chapter codess
videodisc(open door)
videodisc("open door")
Stops the videodisc if it is spinning, and opens the videodisc player door or tray.
videodisc(set port
<port number
Sets the COM port to be used. If the videodisc driver is currently open, it is closed first and then reopened with the new port setting. If the new port setting was invalid, or the open failed because the port was not available, the driver is left in closed condition.
When the port setting is changed successfully by this function call, the user-defined property defComPort of the current book is set to the number of the new port.
Sets the stop register to the frame or chapter (for CAV discs) or for the time (CLV discs) specified. If you then send a play command, the playing will stop when the specified address is reached, and the setting will be cleared. If you don't specify chapter, frame or address, frame is assumed for CAV discs, and time is assumed for CLV discs.
Note: Depending on the player, different player functions may clear this setting before it is reached. Test carefully.
Example
get videodisc("set stop frame", 12345)
get videodisc("play")
-- being naturally lazy, I prefer to use the following for the same effect:
get videodisc("play to 12345")
videodisc(set background color
videodisc("set background color", <color>)lue>
Sets the color displayed when the player is paused or stopped with no picture. With Pioneer players, this color is blue by default.
<color> must be "black" or "blue" -- the quotes are important.
videodisc(set speed
<field rate
Sets the speed for variable speed playing. Frame rate is the number of frames per second. The current mode of the player does not change. If the player is already playing at variable speed, the new speed takes effect immediately.
The following integer values work well as <field rate> for Pioneer players:
240 (4X normal speed)
180 Any value between 1 and 255 is OK
60 (normal speed)
10 (1/6 normal speed)
videodisc("set speed", <field rate>)
videodisc(set key lock
videodisc("set key lock",<on|off>)
Locks (disables) or enables the front panel controls of the videodisc player. Usually, only the power switch still works when the lock is in effect.
<on|off> is either 1 for locked, or 0 for unlocked
Sorry, control for one player at a time only in this version.
defComPort
defComPort
Use which COM port (1, 2, 3 or 4?)
Cancel
defComPort
defComport
OpenComPort
Serial port COM
is not available.
is busy.
Try another one?
Cancel
defComPort
defComPort
Try COM1?
defComport
Try another port?
Cancel
defComPort
defComPort
defComPort
setComPort
askVDPlayer
defComPort
setComPort
askVDPlayer
askVDPlayer
No videodisc player on COM
defComPort
or wrong player setup.
Check that the player is turned on and connections are
correct.
Try Again
Cancel
Cancel
defComPort
closeComPort
defComPort
s_VideoDisc_Init
Cancel
anything
player
cidID
s_videoDisc_Init
params
which
VDClose
defComPort
CloseComPort
s_VideoDisc_Init
which
VDSelectAudio
stereo
VDCmd
VDCmd
right
VDCmd
VDCmd
params
which
VDSetDisplay
VDCmd
VDCmd
params
whichOne
VDQuery
askVDPlayer
askVDPlayer
askVDPlayer
isNumber
askVDPlayer
No disc loaded
No chapter codes
Has chapter codes
unknown
Side 1
Side 2
unknown
12 inch
8 inch
unknown
unknown
Player
askVDPlayer
P1506
Pioneer LD-V8000 (
P1507
Pioneer LD-V2200 (
Player
askVDPlayer
No response
isNumber
Door Open,Park,Set Up,Disc Unloading,Play,
Still,Pause,Search,Scan,Multi-Speed
KeyData
askVDPlayer
s_disctype
which
askVDPlayer
defComPort
writeComPort
seconds
maxPause
maxPause
isComRxReady
No response
isComRxReady
readComPort
cursor
systf
maxpause
VDPlay
VDQuery
askVDPlayer
isNumber
askVDPlayer
wordOffset
stripTime
isNumber
chapter
frame
stripTime
No Response
askVDPlayer
wordOffset
stripTime
isNumber
chapter
frame
askVDPlayer
VDCmd
VDCmd
60SPMR
VDCmd
VDCmd
s_discType
params
vdSetPort
isNumber
defComPort
VDClose
VDOpen
VDOpen
currentP
s_videodisc_Init
stripTime
00000
rightbuttonDown
4s_display_fr
videodisc("
status chapter")
I",0)
uttonDown
rightbuttonDown
leavebackground
rightbuttonDown
set display
videodisc
status chapter
videodisc
set display
videodisc
status chapter
videodisc
s_display_fr
leavebackground
s_display_fr
videodisc(status frame)
ideodisc
videodisc("status frame")
videodisc("status chapter"))
Returns the current frame or chapter number for CAV discs.
reference
The videodisc function controls the videodisc player through the serial port. You can use any of the serial ports available on the machine (COM1 through COM4). To select the serial port, set the user-defined property defComPort of the current book to the number of the current port: 1 for COM1, 2 for COM2, etc.
Windows is very fussy about serial ports. If any problem occurs while a port is in use or if a port was not closed properly before leaving Windows, you may have to cold-boot your machine in order for the port to work again. To avoid problems, be sure to faithfully call videodisc("open") and videodisc("close") at the beginning and end of a session. Also call videodisc("set port", x) to change ports safely.
TBK-COMM.DLL can service several ports with different settings at the same time. The ports not used by videodisc are still available for other uses.
The reference section begins on the next page..e reference section begins on the next page.
You must call videodisc with the "Open" command before any other calls to the function. The function will return -1 if the initialization failed.
After calling this function, the serial port to communicate with the videodisc player is open. More than one instance can use this port to talk to the player via TBK-COMM.DLL, but this requires extreme care.
You can check easily that the videodisc driver is open: If you call the function videodisc with any parameter other than "open" or "close" and you get an error, it is not open.
videodisc("open")
videodisc(close)
videodisc("close")
Call video with this command when you end the session, to be sure that the serial port you were using is released and things are left tidy.
See also videodisc("Open").
Example:
to handle leaveBook
system s_videodisc_OK
if s_videodisc_OK
get videodisc("stop")
get videodisc("close")
end if
videodisc(initialize)
ideodisc(r
These two commands have the same effect. If the videodisc is in any play mode, playing stops. The player spins the videodisc and seeks frame 00001. When that frame is found, the player remains in still mode.
Example:
get videodisc("reset") -- gets the disc ready to play from frame 1
videodisc("initialize")
videodisc("reset")
videodisc(scan)videodisc(scan re
Scans the videodisc from the current position, skipping about 400 frames each time it is called.
Example
to handle buttonStillDown
get videodisc("scan")
endkey color), the effect of this function call remains invisible until you set the chroma key color or you call video ("set inset", <rectangle>).
The system variable s_video_level is set to the current video level.
video("fade in") sets it to 255 , and video("fade out") sets it to 0 .
<length> is in hundredths of a second. If <length> is not specified, the fade will take one second.
Note: Control returns to your application as soon as the fade is initiated, not when it is complete.
videodisc("scan")
videodisc("scan reverse"),<length>])]))>])
videodisc(close)
c(initialize)
videodisc
videodisc(pause)
videodisc(status <status item>)
Returns information about the status of the player. See the various pages that follow for information on specific items.a rectangle in ToolBook units
Example: get video("set inset", bounds of rectangle "inset reference")
You can also specify a rectangle in pixels relative to the screen. Simply add the word "pixels" at the end of the rectangle string.
Example: get video("set inset","10,0,450,340 pixels")
<rectangle> can also be one of the following values:
full screen -- the video will take over the full screen, regardless of chroma key color setting
none -- the video inset is removed and chroma key is turned off
videodisc("status <status item>")rectangle>)
videodisc(open door)
videodisc(Seek [frame|time|chapt
videodisc(seek [frame|time|chapt
videodisc("seek [frame|time|chapter]", <number>)
reeze")
Positions the player to the specified frame, time or chapter, and leaves it in still mode. The second word after seek is optional. If omitted, frame is assumed. Seek time is not implemented on all players, and works only on CLV discs when implemented.
Examples:
get videodisc("Seek", 8907) -- goes to frame 8907
get videodisc("Seek chapter", 3) -- goes to first frame of chapter 3
get videodisc("Seek frame", 8907) -- goes to frame 8907