Fandom

DVD-lab

Functions

89pages on
this wiki
Add New Page
Talk0 Share

Advanced Authoring - LabTALK - Functions and Commands

Here is a list of labTALK DVD-lab-related Functions and Commands. Unlike the core of the language described in previous pages, these commands here are specific to DVD-lab.

VTS Functions

All commands that works with menus or movies assume for simplicity they are in currently selected VTS. To select different VTS you need to use SetCurrentVTS function.

Command Parameters and Usage Comments
SetCurrentVTS SetCurrentVTS",1,6,"SetCurrentVTS(nVTS) VTS 1..99, Set the VTS as current
GetCurrentVTS nVTS = GetCurrentVTS() returns which VTS is currently Selected

Menu

Menu commands are used to access menu functions. A menu is refered by its number. VTS menus have number 1...255, VMG menus have number 10001..10255
All functions assume this reference. that means command MenuActivate(10001) will activate first VMG Menu.
For clarity you can use function VMG(vmgmenu) that simply add 10000 to the input parameter.
Therefore the command MenuActivate(VMG(1)) does the same as above - select first VMG menu.

Command Parameters and Usage Comments
MenuGetCount nC =MenuGetCount() Get number of menus in current VTS
MenuGetVMGCount nC = MenuGetVMGCount() Get number of VMG menus in current VTS
MenuGetCurSel menu = MenuGetCurSel() Get number of currently selected menu.

VTS menu 1..255, VMG menu 10001..10255

MenuAdd menu = MenuAdd(IsVMG,"Name",openWindow) Add new Menu
MenuAddFrom menu = MenuAddFrom(IsVMG,"Name",openWindow,sFile) Add new menu from menu template (file)
MenuDelete MenuDelete(menu) Delete menu
MenuActivate MenuActivate(menu) Activate (open) the menu in DVD-lab
MenuSetPBC MenuSetPBC(menu,timeout,nFOSEL,nFOACT) Set playback functions Timeout (0-255), ForceSelected button (0 - no button), ForceActivated button (0 - no button)
MenuSetMapSel MenuSetMapSel(menu,nGroup,nColor,nContrast) Set Selected Color Mapping. nGroup: 0=Antialias, 1,2,3= normal group

nColor - 0 to15
nContrast - 0 to 16

MenuSetMapAct MenuSetMapAct(menu,nGroup,nColor0to15,nContrast0to16) Set Activated Color Mapping. nGroup: 0=Antialias, 1,2,3= normal group

nColor - 0 to15
nContrast - 0 to 16

MenuEndLink MenuEndLink(menu, toMenu) Set end link of menu to other menu
MenuSetMotion MenuSetMotion(menu, sVideoFile, sAudioFile) Set files for motion menu
MenuCopy MenuCopy(menuFrom, menuTo) Copy all from other menu
MenuGroupWith MenuGroupWith(menu, withMenu,withMovie) Group menu (create Component) with either menu or movie
MenuPlaceNear MenuPlaceNear(menu, nearMenu, nearMovie, fromWhichSide) Position the menu in Connections near other object. FromWhichSide clockwise 0=top, 1=top right 2=right etc..
MenuSetComponent MenuSetComponent(menu, setIn, setOut) Set the menu in component to be In and/or Out type

setIn, setOut = TRUE or FALSE

MenuRemovePRECommands MenuRemovePRECommands(menu) Remove all PRE commands
MenuAddPRECommand MenuAddPRECommand(menu, commandstring) Add line of PRE command
MenuRemovePOSTCommands MenuRemovePOSTCommands(menu) Remove all POST commands
MenuAddPOSTCommand MenuAddPOSTCommand(menu, commandstring) Add line of POST command
LinkFPtoMenu LinkFPtoMenu(menu) Link First Play to menu
LinkTBtoMenu LinkTBtoMenu(menu) Link Title Button to menu

Object

Object commands gives access to a specific object in a menu (therefore menu number is always one of the parameters).

Command Parameters and Usage Comments
ObjectGetCount ObjectGetCount(menu) Get number of objects in a menu
ObjectGetCurSel object= ObjectGetCurSel(menu) Get currently selected object in a menu
ObjectGetType type= ObjectGetType(menu,object) type: 1-RECTANGLE,2-BITMAP,3-TEXT,4-DUMMY,5-FRAME
ObjectAdd object = ObjectAdd(menu,type,color,"Text") Add new object

type: 1-RECTANGLE,2-BITMAP,3-TEXT,4-DUMMY,5-FRAME
After that you need to use commands below to set position, size etc. of the new object returned by this function

ObjectAddFrom object = ObjectAddFrom(menu,sFile) Add object from the file (image)
ObjectSetSize ObjectSetSize(menu,object,nWidth,nHeight) Set size of the object
ObjectSetPos ObjectSetPos(menu,object,nX,nY) Set position of the object
ObjectGetXPos x = ObjectGetXPos(menu,object) Get X (left) position of object
ObjectGetYPos y = ObjectGetYPos(menu,object) Get Y (top) position of object
ObjectGetWidth nW = ObjectGetWidth(menu,object) Get object width
ObjectGetHeight nH = ObjectGetHeight(menu,object) Get object height
ObjectDelete ObjectDelete(menu,object) Delete object
ObjectSetColor ObjectSetColor(menu,object,color) Set color of the object. the color is RGB (red, green, blue)
ObjectSetAttr ObjectSetAttr(menu,object,transparency,mode) Set object attributes
ObjectSetFont ObjectSetFont(menu,object,"Arial",size) Set font for text objects
ObjectSetText ObjectSetText(menu,object,sText) Set text of text objects
ObjectSetShadow ObjectSetShadow(menu,object,color,type) Set shadow of object
ObjectShadowOffset ObjectShadowOffset(menu,object,xoffset,yoffset) Set shadow offset
ObjectShadowAttr ObjectShadowAttr(menu,object,intensity,blur) Set other shadow attributes
ObjectToBitmap ObjectToBitmap(menu,object) Convert any object to a bitmap object (for example text to bitmap)
ObjectMergeShadow ObjectMergeShadow(menu,object) Merge shadow with the bitmap object
ObjectUnion ObjectUnion(menu,object,menu,object2) Combine two bitmap objects together
ObjectSetVisibility ObjectSetVisibility(menu,object,visibility,locked) Set Visibility of object

0-visible, 1- Invisible Normal etc..

ObjectAutoAction ObjectAutoAction(menu,object,autoaction) Set if object has autoaction (FALSE, TRUE)
ObjectLinkToMenu ObjectLinkToMenu(menu,object,menuTo) Set link of this object to other menu
ObjectLinkToMovie ObjectLinkToMovie(menu,object,MovieNumber,ChapterNumber) Set link of this object to movie and/or chapter number (starts from 1)
ObjectCopy newObject = ObjectCopy(menu,object,menuTo) Create new object by copying. You can create that object in different menu.
ObjectGetLabel sLabel = ObjectGetLabel(menu,object) Get label of the object.

Label is internal name of the object that can be used for indentification

ObjectSetLabel ObjectSetLabel(menu,object,sLabel) Set label of the obejct
ObjectGetFromLabel objText1 = ObjectGetFromLabel(menu,"text1")
Finds object from the speciffied Button Label. Returns -1 if none found.
ObjectGetMenuLink nMenu = ObjectGetMenuLink(menu,object) Get to which menu the object links 0-if no menu link
ObjectGetMovieLink nMovie = ObjectGetMovieLink(menu,object) Get to which movie the object links 0-if no movie link
ObjectGetChapterLink nChapter = ObjectGetChapterLink(menu,object) Get to which chapter of movie the object links, 1- Movie start

Image

Image is a special set of commands that allows access to the bitmap data of a menu objects. Text, rectangles or frames will be first converted to bitmap.

The image functions never access the image data directly, but first creates a copy of it with ImgGrabObject then allows you to freely change the data and after that set that image back to object (or any other object in fact) with ImgSetToObject. You have 3 image buffers where you can store these data, or directly create empty buffer with ImgCreate. These buffers are referred to by the imgNum parameter in every Img command.

So the typical scenario for a script that can change the object on a menu would be:

menu = MenuGetCurSel() Get the currently opened menu
object= ObjectGetCurSel(menu) Get currently selected object on the menu
ImgGrabObject(1,menu,object) Put the bitmap data into buffer 1
imgW = ImgGetWidth(1)

imgH = ImgGetHeight(1)

get the dimensions of the bitmap data (for example for loop)
...... do whatever you want to the buffer with ImgSet etc.
ImgSetToObject(1,menu,object) Put the buffer 1 back to the object

Direct image data manipulation in a loop is a slow process.
It is important to note that ImgSetToObject will not resize the object if the image buffer is different size than the object. You can resize the object afterwards to the same size like image buffer with the object command: ObjectSetSize(menu,object,imgW,imgH)

Command Parameters and Usage Comments
ImgGrabObject ImgGrabObject(imgNum,menu,object) Grabimage data from object

imgNum = temporary image buffer 1,2 or 3")
If object is 0 then a background will be grabbed

ImgSetToObject ImgSetToObject(imgNum,menu,object) Set image data to Object
ImgCreate ImgCreate(imgNum,width,height) Create empty image data with defined size
ImgHasData bHasData = ImgHasData(imgNum) Does the image buffer has any data?
ImgGetWidth imgW = ImgGetWidth(imgNum) Get width of the image buffer
ImgGetHeight imgH = ImgGetHeight(imgNum) Get Height of the image buffer
ImgGetR r = ImgGetR(imgNum,x,y) Get red color of pixel at x, y
ImgGetG g = ImgGetG(imgNum,x,y) -green-
ImgGetB b = ImgGetB(imgNum,x,y) -blue-
ImgGetA a = ImgGetA(imgNum,x,y) -alpha transparency-
ImgSetR r = ImgSetR(imgNum,x,y,nValue) Set Red color to the pixel at x,y
ImgSetG g = ImgSetG(imgNum,x,y,nValue) -green-
ImgSetB b = ImgSetB(imgNum,x,y,nValue) -blue-
ImgSetA a = ImgSetA(imgNum,x,y,nValue) -alpha transparency-
ImgFill ImgFill(imgNum,color) Fill whole buffer with color
ImgFillAlpha ImgFillAlpha(imgNum,alpha) Fill alpha channel of buffer with alpha value 0-255
ImgFillCol ImgFillCol(imgNum,x,color) Fill x column with color
ImgFillRow ImgFillRow(imgNum,y,color) Fill y row with color
ImgCopyCol ImgCopyCol(imgNumFrom,xFrom,imgNumTo,xTo) Copy column from one buffer to another
ImgCopyRow ImgCopyRow(imgNumFrom,yFrom,imgNumTo,yTo) Copy row from one buffer to another
ImgCopy ImgCopy(imgNumFrom,imgNumTo,xOffset,yOffset) Copy image data from one buffer to another. You can specify the offset from where to start copying
ImgCopyAlpha ImgCopyAlpha(imgNumFrom,imgNumTo,xOffset,yOffset) Copy only alpha data from one buffer to another
ImgOverlay ImgOverlay(imgNumFrom,imgNumTo,xOffset,yOffset) Overlay one image buffer on top of another
ImgGrabChapterFrame ImgGrabChapterFrame(imgNum,nMovie,nChapter) Grab a video frame from chapter to imgNum buffer.

nChapter = 0 ->Movie start

ImgGrabMenuFrame ImgGrabMenuFrame(imgNum,nMenu) Grab how a menu looks like to an image buffer
ImgResize ImgResize(imgNum,nW,nH) Resize buffer to any size
ImgBlur ImgBlur(imgNum,nBlurValue) Blur buffer.

nBlurValue 1-255

ImgBlurAlpha ImgBlurAlpha(imgNum,nBlurValue) Blur only alpha channel

nBlurValue 1-255

ImgSharpen ImgSharpen(imgNum,nSharpen) Sharpen Image buffer

nSharpen 1-100

ImgInflate ImgInflate(imgNum,nAddW,nAddH) Add empty border around the image buffer

Movie

Movie commands are not fully finished yet. There is no way to add for example chapters, slides to slideshow etc...

Command Parameters and Usage Comments
MovieGetCount nC = MovieGetCount() How many movies object we have in current VTS
MovieGetCurSel movie = MovieGetCurSel() Currently selected movie (movie window that is in front of other windows)
MovieAdd movie = MovieAdd(IsSlideshow,"Name",openWindow)
MovieDelete MovieDelete(movie)
MovieActivate MovieActivate(movie)
MovieSetFiles MovieSetFiles(movie,sVideo,sAudio) For multiplexed mpg use the same file for both sVideo and sAudio

Others

Here are few other support commands..

Command Parameters and Usage Comments
ProgressBar ProgressBar(nFrom,nTo,"Text") Creates progress bar with range nFrom to nTo
ProgressSetPos ProgressSetPos(nPos) Set progress in the progressbar to nPos value (nFrom<nPos<nTo)
SaveInteger SaveInteger("uniquekey",variable) Store in registry
LoadInteger var = LoadInteger("uniquekey",default) Read from registry

Variables

LabTALK will fill up few variables.

Command Parameters and Usage Comments
bCancelInput if (bCancelInput) then

end
endif

If user press cancel on previous input command this variable will become TRUE
menusInBlackBox Important array for script inside Components, see <a href="cnt_compon.htm">components</a> for more details
vmgsInBlackBox -//-
moviesInBlackBox -//-

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.