Sets the color to be used for chroma key (the color that will be transparent to video). <key color> is either a number from 0 to 15, corresponding to palette entries, or one of the following (matching solid colors of the ToolBook color palette):
black dark red red
white dark green green
dark grey (default) dark yellow yellow
none dark blue blue
all dark magenta magenta
dark cyan cyan
Example: get video("set key color", "dark grey")
Note that currently only black, white and dark grey work reliably with the DVA-4000 board and software before MIC 3.3. and Windows 3.0 rC7.t recognize the default Windows 3.0 palette settings. This will be corrected.
video("set key color, <key color>)
disable
"Previous"
enable
adjust x --**
-- reset proportions
moved
objs
-15,
-15,
-15,\
-15,
-15,
-15,
- 15,\
defBounds
setCaption what
0,50.1875,0
nterpage
adjust
setCaption
previous
disable
enterpage
enable
enterpage
ox%disable
Previous
enable
Previous
previous
adjust
defBounds
setCaption
disable
enable
0,0,0
title
odefBounds
adjust
buttonUp
buttonDown
buttonUp
buttonDown
defBounds
adjust
6 defBounds
5670,4680,6885,5085
Go Back
odefBounds
adjust
buttonUp
buttonDown
buttonUp
buttonDown
defBounds
adjust
defBounds
30,4650,1395,5085
Demo
Previous
odefBounds
adjust
buttonUp
buttonDown
buttonUp
previous
buttonDown
defBounds
adjust
defBounds
3090,4680,4305,5085
Previous
odefBounds
adjust
buttonUp
buttonDown
buttonUp
buttonDown
defBounds
adjust
defBounds
4410,4680,5580,5085
Next
Reference
/"reference"
odefBounds
adjust
buttonUp
buttonDown
buttonUp
reference
buttonDown
defBounds
adjust
defBounds
1485,4665,2715,5085
Reference
The script of this book contains general purpose functions to control a full motion digital video adapter. This specific book is dedicated to the Videologic DVA-4000, but another book with the same functions 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 functions 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 DVA-4000.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.
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, video, which you call with different arguments.
A typical call to video is in the form
get video(<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 video() return 1 if successfull, -1 if they failed. Typical causes of errors would be that video("open") was not called successfully earlier in the session, or that one of the arguments to the function was illegal or out of range.
Video Control
audioControl(set level
Sets the audio level for both stereo channels. <level> is any integer number from 0 to 255. 0 is no sound, 255 is maximum volume.
The system variable s_audio_level is set to the current audio level.
video("fade in") sets it to 255 , and video("fade out") sets it to 0 .
audioControl("set level",<level>)
audioControl(set level
video(close)
video(Fade in[
video(Freeze)
video(set level
video(Initialize)
video(Open)
video(Zoom
video(set inset
video(set key color
video("set frame mode")
video("set field mode")
Sets the frame buffer to full frame mode or to field mode. In some cases, there is a noticeable flicker when a videodisc player is in still frame or playing in slow motion. When in field mode, the resolution is lower but there will be no flicker in the picture because only one of the two fields that make up a complete frame is sampled.
Cannot find MicTalk.dll. The video driver should still work, but
it will be a little slower.
!EOFF
x yx z
FxADE 0,1,3,5 /V;!STATUS
testString
suspend
4s_video_level, s_audio_level, s_OK
-- initialize the
> board
I("Open")
e", 255)
audioControl("
", 200)
key color",
"Cannot
. Video controls will have"\
&& "no effect."
, s_full_flag
exitFullScreen
"zoom
prompt"
", 0)
("Close")
} <>
showFullScreen
, s_norm_b, s_norm_sz, s_video_zoomed, s_old_z
Rect"
640* 15, 480 * 15
-3,-22,643,483
defsize
-- While
, keep
inset
synch
-- reference
-- Also, adjust
slider
thumbs
reflect
%necessary
4s_old_is, s_old_vl, s_old_al,
, s_old_f
screen")
<> s_old_vs
showSetting (
/255)
/255)
setcaption "Zoom Out"
-- Special stuff
maintain correct proportions,
buttons
-- on
cauthoring
x --**
-- reset
moved
objs
-15,
-15,
-15,\
-15,
-15,
-15,
- 15,\
defBounds
setCaption what
disable
0,50.1875,0
enable
FullScreen
leavePage
exitFullScreen
enterpage
adjust
leaveBook
setCaption
disable
showFullScreen
enable
enterpage
video
set level
video
set level
audioControl
set key color
key color name
video
Cannot initialize the DVA board. Video controls will have
no effect.
reader
sizeToPage
s_video_level
s_audio_level
leavePage
exitFullScreen
zoom target
zoom prompt
set level
audioControl
Close
video
s_full_flag
leaveBook
exitFullScreen
s_full_flag
showFullScreen
full Rect
zoom target
zoom prompt
s_full_flag
s_norm_b
s_norm_sz
s_video_zoomed
s_old_z
exitFullScreen
defsize
sizeToPage
full Rect
s_full_flag
s_norm_b
s_norm_sz
inset rectangle
set inset
full screen
video
set inset
video
showSetting
thumb 2
showSetting
thumb 1
setcaption
Zoom Out
zoom button
setcaption
zoom button
s_old_vs
s_video_zoomed
s_old_z
s_full_flag
s_old_f
s_old_is
s_old_vl
s_old_al
s_video_level
s_audio_level
adjust
defBounds
setCaption
disable
enable
0,0,0
4p8zB
Full Screen
ShowFullScreen
odefBounds
adjust
buttonUp
buttonDown
buttonUp
ShowFullScreen
buttonDown
defBounds
adjust
defBounds
4095,3300,6795,3720
Full Screen
Copyright
1990 Asymetrix Corporation
field-1
reset --**
proportions
moved
- 15,
- 15,\
- 15,
-15,
reset
reset
key color name
dial (
keydown
keydown
alignment
centered
cyan magenta
Chroma key color
video("
key color",
hilite"\
>- 30,\
>- 30
"inset
"full rect"
"zoom
default
buttonDown
buttonDown
name of target?
set key color
video
key color hilite
key color name
inset rectangle
full rect
zoom target
240,50,100
zoom target
0,50,100
default
dark grey
dark green
dark cyan
dark blue
dark magenta
black
white
yellow
magenta
green
dark red
light grey
dark yellow
key color hilite
Inset Rectangle
field-1
reset --**
proportions
moved
- 15,
- 15,\
- 15,
-15,
reset
reset
phone number
dial (
keydown
keydown
&alignment
centered
C.0. 5/17/90
video("Freeze")
odefBounds
adjust
buttonUp
buttonDown
buttonUp
Freeze
video
buttonDown
defBounds
adjust
'defBounds
4155,705,6810,1125
Freeze
:)B*;
video("Unfreeze")
odefBounds
adjust
buttonUp
buttonDown
buttonUp
Unfreeze
video
buttonDown
defBounds
adjust
T*defBounds
4155,1140,6810,1560
Unfreeze
video("Fade
odefBounds
adjust
buttonUp
buttonDown
buttonUp
Fade in
video
buttonDown
defBounds
adjust
,defBounds
4125,2250,6810,2700
Fade In Video
video("Fade out")
odefBounds
adjust
buttonUp
buttonDown
buttonUp
Fade out
video
buttonDown
defBounds
adjust
Z/defBounds
4125,2700,6810,3150
Fade Out Video
Zoom button
4s_video_zoomed
("Zoom out")
Target" \
3prompt" \
odefBounds
adjust
buttonUp
buttonDown
buttonUp
Zoom out
video
Zoom Target
Zoom Target
Zoom prompt
Zoom target
s_video_zoomed
buttonDown
defBounds
adjust
2defBounds
4140,1680,6810,2130
"ah3d3
Zoom
Inset Rectangle: This rectangle is used as reference for the location and size of the video image keyed into the VGA output.
slide 1
reset --**
proportions
moved
- 15,
- 15,\
- 15,
-15,
reset
reset
6defpos
135,3585
phone number
dial (
keydown
keydown
X8alignment
centered
thumb 1
4s_y_offset, s_def_NumF
omaxY
odefX
-- recalibrate
sBnds
("slide" &&
ominY
oheight
"0.000"
old_loc
<> s_old_loc
optional here, depending on how
the setting can be done
setStuff
-- clean up
showSetting ratio
-- Adjust
reflect a changed
( I'm tied
-- Assumes I am already calibrated
c must be a floating point
zbetween 0
1 (inclusive)
) * (1 -
whatever we're supposed
according
thumb
1 - (
) / (
AudioControl("Set Level",
(255 *
ubleClick
buttonDown
buttonStillDown
buttonUp
buttonDoubleClick
showSetting
setStuff
buttonDown
slide
height
height
0.000
sBnds
s_y_offset
s_def_NumF
buttonDoubleClick
buttonDown
buttonStillDown
setStuff
s_y_offset
s_old_loc
buttonUp
setStuff
s_y_offset
s_old_loc
s_def_NumF
showSetting
ratio
setStuff
Set Level
AudioControl
@maxY
@maxX
Aheight
,A AminY
FA:AdefX
fAVAlowest
150,4800
vAhighest
150,3600
slide 2
reset --**
proportions
moved
- 15,
- 15,\
- 15,
-15,
reset
reset
Ddefpos
135,3585
phone number
dial (
keydown
keydown
Ealignment
centered
thumb 2
4s_y_offset, s_def_NumF
omaxY
odefX
-- recalibrate
sBnds
("slide" &&
ominY
oheight
"0.000"
old_loc
<> s_old_loc
optional here, depending on how
the setting can be done
setStuff
-- clean up
showSetting ratio
-- Adjust
reflect a changed
( I'm tied
-- Assumes I am already calibrated
c must be a floating point
zbetween 0
1 (inclusive)
) * (1 -
whatever we're supposed
according
thumb
multiplier
1 - (
) / (
Video("Set level",
(255 *
ubleClick
buttonDown
buttonStillDown
buttonUp
buttonDoubleClick
showSetting
setStuff
buttonDown
slide
height
height
0.000
sBnds
s_y_offset
s_def_NumF
buttonDoubleClick
buttonDown
buttonStillDown
setStuff
s_y_offset
s_old_loc
buttonUp
setStuff
s_y_offset
s_old_loc
s_def_NumF
showSetting
ratio
setStuff
Set level
Video
multiplier
Nhighest
150,3600
Nlowest
150,4800
NdefX
NminY
Nheight
OmaxX
&OmaxY
Audio volume
Video level
PQ<R,
odefBounds
adjust
buttonUp
buttonDown
buttonUp
buttonDown
defBounds
adjust
NRdefBounds
4140,4140,6810,4590
Edit Page Script
zoom Target
4s_y_offset, s_x_offset
"inset
oxmin
oymin
oxmax
oymax
loc -
-- calculate how large I am
where I am relative
-- reference
Then translate that
pixels
X"tbkwin.dll"
INT xPixelsFromUnits(
yPixelsFromUnits(
((639 * (
)) / wu)
((479 * (
)) / hu)
((639 * (
)) / wu)
((479 * (
)) / hu)
zoomRect
video("Zoom",
G prompt"
uttonDown
buttonStillDown
buttonDown
buttonDoubleClick
buttonDown
inset rectangle
s_y_offset
s_x_offset
buttonStillDown
s_y_offset
s_x_offset
buttonDoubleClick
tbkwin.dll
xPixelsFromUnits
yPixelsFromUnits
inset rectangle
video
set inset
inset rectangle
video
zoom prompt
zoomRect
Zymax
Zxmax
Zymin
Zxmin
4[ \,
odefBounds
adjust
buttonUp
buttonDown
buttonUp
buttonDown
defBounds
adjust
2\defBounds
4140,4620,6810,5085
How To Use This Book
zoom prompt
Move the rectangle over the portion of the picture to magnify, then double-click it.
Full Rect
exitFullScreen
buttondown
buttondown
exitFullScreen
odefBounds
adjust
buttonUp
buttonDown
buttonUp
exitFullScreen
buttonDown
defBounds
adjust
`defBounds
8565,6660,9345,7005
reference
Audio control
The Videologic board is capable of controlling the audio level. This book's script contains one function that can set the audio level with the DVA board. This is the audioControl function, which is described more fully in the reference section.
The reference section begins on the next page.......
reference
disable
"Next"
enable
adjust x --**
-- reset proportions
moved
objs
-15,
-15,
-15,\
-15,
-15,
-15,
- 15,\
defBounds
setCaption what
0,50.1875,0
trim(
"title")
legalname(
, 60)
"titles"
default
djust
setCaption
disable
enterpage
enable
adjust
saveas
enterpage
ox%disable
enable
adjust
defBounds
setCaption
disable
enable
0,0,0
saveas
title
title
legalname
titles
default
* j
title
odefBounds
adjust
buttonUp
buttonDown
buttonUp
buttonDown
defBounds
adjust
defBounds
5670,4680,6885,5085
Go Back
odefBounds
adjust
buttonUp
buttonDown
buttonUp
buttonDown
defBounds
adjust
defBounds
15,4650,1380,5085
Demo
Previous
odefBounds
adjust
buttonUp
buttonDown
buttonUp
previous
buttonDown
defBounds
adjust
defBounds
3090,4680,4305,5085
Previous
odefBounds
adjust
buttonUp
buttonDown
buttonUp
buttonDown
defBounds
adjust
defBounds
4410,4680,5580,5085
Next
Reference
titles
audioControl(set level
video(close)
video(Fade in[
video(Freeze)
video(Initialize)
video(Open)
video(set inset
video(set key color
video(set level
video(Zoom
video(Open)
video("Open")
You must call video with the "Open" command before any other calls to the function. The function will return -1 if the DVA software was not running.
After calling this function, no video is displayed, but the board is initialized to convenient default settings:
- Full frame video
- Chroma key off
- Chroma key color is dark greyyyyyyyyyy
video(close)
video("close")
Call video with this command when you end the session, to be sure that the video effects get turned off and you end up with what appears as a plain VGA.
Example:
to handle leaveBook
system s_video_OK
if s_video_OK
get video("close")
end if
video(Initialize)
video("Initialize")
Resets the video board to the same defaults as video("Open")
video(Fade in[
Fades the video in (to maximum level) or out (to black). If the video is not shown (no chroma key color is selected, or there is no screen area matching the chroma key 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.
video("Fade in"[,<length>])
video("Fade out"[,<length>])
video(set level
Sets the video level. <level> is any integer number from 0 to 255. 0 is black, 255 is full level.
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 .
video("set level",<level>)
video(set inset
Sizes and places the video picture to match <rectangle>.
<rectangle> is a list of four numbers defining the bounds of 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
video("set inset",<rectangle>)
video(Zoom
Zooms the portion of the incoming video defined by "rectangle" to fill the inset rectangle.
<rectangle> is a list of four numbers defining a rectangle. It is expressed in pixels, relative to the full video frame. See the script of the rectangle "zoom target" that appears when you click the zoom button on page 1 of this book for a complete example.
If you resize the display rectangle with video("set inset", <rectangle>), the same portion of the video frame will be resized to fit.
Zooming works on a frozen picture too. See video("Freeze").
Use video("Zoom out") to use the entire video frame again.
The system variable s_video_zoomed is set to 1 when the image is zoomed, and to null when it is not...
video("Zoom",<rectangle>)
video("Zoom out")
video(Freeze)
video("Freeze")
video("Unfreeze")
Freezes or unfreezes the incoming video picture. When a picture is frozen, you can zoom in and out of it just as if it was moving.
The system variable s_video_frozen is set to 1 when the image is frozen, and to null when it is not.