Index
Next Prev


Variables concept (and programming): 

The 'programing language' for dvdauthor and MuxMan is quite different unfortunately. Dvdauthor uses a C like 'high level' language, whereas MuxMan is very near to the machine code and resembles more something like assembler. One big advantage of MuxMan is the use of symbolic names. Instead of 'titleset 1 menu 4' you can use the name 'titleset1submenu3' for jump and call commands. Another advantage is the similarity with the code shown in pgcedit. If you want/need to adjust or debug the code with pgcedit you will find your commands easily.

DVD Players (also soft player such as PowerDVD, WinDVD...) have a so-called 'virtual machine'. You can understand it as a simple programmable processor.  The virtual machine has 16 'general purpose' register (which can be compared with variables in a programming language), which use 16 bit integer values. Dvdauthor uses 3 of it for internal purposes so that the registers g0 to g12 remain for (free) use. In addition you have comparison operators =,<,>... and you can use "if... then... else..."  instructions. Furthermore there are system registers, these correspond e.g. to the selected audio stream and/or subtitle stream as well as for the selected button in a menu (audio0 to audio7, and/or subtitle0 to subtitle31/subtitle64 to subtitle95, as well as button1024 to button36864).  For subtitle streams there are two ranges 0-31 as well as 64-95.  This is due to the fact that there are so-called "forced" subtitles, which are always visible.  If you want to see 'normal' subtitles, you should use the range 64 to 95, otherwise only those subtitles (from the selected stream) that are formatted as 'forced' are shown. For buttons the button number is always multiplied by 1024, the first button of a menu is therefore 1024, the second 2048...

In MuxMan it is 'similar', but button numbers are not multiplied by 1024 (you can use button 1 to 36). To set an audio or subtitle stream the command 'SetSTN' can be used (i.e. 'SetSTN audio=1, subpicture=1:OFF'). To set a specific button as highlighted, use SetHL_BTNN HL_BTNN=X with X=button number. Unfortunately there is no (free) documentation for these commands. Some explanation can be found on dvd-replica or mpucoder. A few commands and 'tricks' are described in the chapters VM command editor and Jump and Call overview.

The following paragraph is for dvdauthor only. The principle is quite the same for MuxMan, but as the syntax for MuxMan is much more difficult to understand, I will describe only the dvdauthor statements here.

In GFD the registers g0, g1 g2 and g3 are used for internal purposes:  g1 to start a film directly ('start action' = 'Show movie') and g2 to start the next film ('End action' = 'Next title'). In addition the register g0 is used if a PlayAll button is defined and g3 is used for 'Loop with jump Menu'.

1.  Film direct start:  For this the register g1 is set to "1" before showing the main menu ( < pre > { g1=1;  } </pre > ). 
In the Titleset menu it is then examined whether g1=1.  If yes, the film is started (the menu is 'jumped over'), if no, the menu is shown normally.  (   < pre > { if (g1 eq 1) jump title 1 chapter 1;  } </pre >   )
Before playing the film g1 is then put back to 0, in order to be able to start the menu by remote if necessary, otherwise it would be again 'jumped over'.  (  < pre > { g1=0;  } </pre >   )

2.  Start next film:  (quite complicated, since a non visible pseudo menu (pgc without vob) in the VMGM domain (main menu) is used)
In the (normal) main menu nothing special happens, but there is a second pseudo menu which only contains commands:

  < pgc pause="0 ">
  < pre >
   { if (g2 eq 1) jump titleset 1 menu;
     if (g2 eq 2) jump
titleset 2 menu;
      ... 
     if (g2 eq N) jump
titleset N menu; }
  </pre >
  </pgc >

(N is the number of the last film)
If this pseudo menu is started, the commands are 'processed' and depending on the value of g2 the appropriate titlesetmenu is started.  After a film g2 is set on the number of the next film (as well as g1 is set to "1") and the pseudo menu is started.  After the first film thus: 

< post>{g1=1;g2=2;call vmgm menu 2;}</post >

Further explanations (as well as the structure of the entire control XML file) see dvdauthor manual:  http://dvdauthor.sourceforge.net/doc/dvdauthor.html and Wiki: http://nfs.shawnfumo.com/wiki/DVDAuthor/VMLanguage