Basic Overview |
Top Previous Next |
All actions on DVD are driven by a special DVD command language also called virtual machine commands (VM). If you decided to create a DVD all by yourself (without an authoring application) it is simply not enough to place all the video files there, but you have to write a "program" or set of instructions to tell the DVD player how to start, what to do with the files, what to do when the files finish playing etc. And we didn't even started with menus yet....
VM Introduction The major task of any mainstream DVD authoring application is to hide as much as possible of this from the users. It is obvious why. Users would require a much deeper knowledge of the DVD structure to be able to do even simple task like playing a movie. A DVD authoring application has to create a flexible environment for the user yet it has to be smart enough to be able to translate all this flexibility into a playable VM command language. Because VM commands are a language, two similar DVD's that seems to behave the same way are very often created totally different way internally. All the pages in this tutorial before this one talk about various way of linking "objects", "buttons" and various smart components. But what is hidden beneath this is in fact the difficult task of creating DVD structure and a "program" in DVD machine code that would perform what users visually designed. A simple way of checking this is to open connection window, right click on a Menu to open the menu and select Edit VM Commands. In the window that will open you will see in the DVD-lab dynamically added commands something like this: 1. GPRM12 = 1024 2. if (GPRM11 == 7) GPRM12 = 0 3. if (GPRM12 == 0) Goto 5 4. SetHL_BTN GPRM12 5. GPRM11 = 6 6. GPRM15 = 6 There are already some commands and we didn't make anything yet! As you may see DVD-lab goes one step beyond standard DVD authoring. It allows you to not only see these commands but also add a new ones. For serious authors this is very important feature. No matter how smart you can make your authoring application, there is always something that it will not allow you to do easily or not at all. Having ability to edit VM commands opens a whole new range of possibilities. An example may be a DVD created for the testing of knowledge where you need to discover good and bad answers. Places for VM commands VM commands can be inserted in these places:
VM language The DVD VM language has less than 40 instructions that can also be combined. A need to combine instructions comes from the fact that at some places DVD allows only one line of VM commands. A typical example are the VM commands on menu buttons. VM Blocks A special aid to your vm scripting in DVD-lab PRO comes in a form of visual "block" language. This overcomes the problem with DVD VM code being static. For example a line if (G0==255) LinkPGC 2 in your vm code will link to a PGC 2 which may be Menu 1 at the time of writing, but later after you delete and add few menus or change their order, it may become a completelly different menu which requires you to change the code. In VM Blocks you visually specify what you want to do using few pre-defined bocks for Operator, Link, If-Goto, If-link and insert between these normal VM Script. This creates a dynamic VM code that is always actualized. You can switch between the VM Script and VM Blocks on the fly. PRE and POST commands Commands on DVD can be in many places, but in most cases you will look for PRE and POST commands. The PRE command is the place before the object (Movie, Menu) plays and POST is just after the object is played.
Abstraction Layer commands The structure of any object would be like this:
A VM Command window that appears when you select "Edit VM Commands" reflects this situation The numbers 1,2,3 on the image above shows the position of the commands. The 1 and 3 are custom commands editable by user the B are Abstraction commands that DVD-lab creates. Note about menus. Menus always execute PRE command when you go to the menu, but if you get out of the menu with a button, the POST command of menu is not executed, instead a Button VM Command (one line) assigned with the button is used. The POST command of menu is executed only if menu times out (or for non-looping motion or audio menu). Show Commands in Connections
Chapter Commands A movie can have a VM command on each chapter. These are also called cell commands. When you are in movie window, right click on a chapter point and from menu select Chapter VM Command... Chapter command can be only one line. Technical Note: If chapter has a VM command a short pause may occur on that spot during playback. Menu Cell Commands Domain Commands (1) - VTS Root VM - commands that are in the ROOT menu of each VTS. This is associated with menus and with the "Menu" button on remote. The domain Commands can be edited also from Project Window by doubleclicking on these items under Commands sections. DVD Domains: Objects and commands on DVD can be in a few different places called domains. We have:
If you want to know more about the structure, see appendix. Variables (registers, GPRM, SPRM) As with any language, VM commands have a few registers (or variables if you will) that can be used to read or store temporary values. There are 16 GPRM registers (General Parameter) that can be freely used by DVD programmer and 24 SPRM registers (System Parameters) that are used to access information specific to DVD player (for example region of the player). You can't write to SPRM registers. There are 16 registers GPRM0 - GPRM15, but as described before, DVD-lab creates its own VM code so the actions you design visually will work on DVD. In DVD-lab we tried to use the minimum number of registers for our internal purposes. These are registers GPRM11 to GPRM15 inclusive. Writing to these registers will make other parts of DVD-lab code (abstraction layer) not work correctly. In other words: DON'T touch! We were very careful to use as few registers as possible so you can use the rest for your own programming needs. DVD-lab reserved GPRM registers
* GPRM13 is also used as a one-time flag to make sure DVD player starts with subtitles OFF. You can freely use the registers GPRM0 ... GPRM10 for your own VM programming creations. PGC Numbers We will mention this on the following pages as well but it is vital to remember:
|