You are on page 1of 7

DLP Branching and VM Commands

Lesson #3
Page 1 of 7

A branching object in DVD Lab Pro (DLP) is simply a way to play only one or more (user defined)
chapters in a movie object. The movie object must be local to the current active VTS. What is nice about a
branching object is that the source movie is only written once to the disk. A new title entry (program chain pgc)
is defined by logically pointing to the appropriate VOBUs without having to rewrite the same portions of the
movie over and over again. By leveraging the power of the logical DVD arrangement, a branching object can
solve many programming problems faced by the Author.

Lesson #3 will use branching objects and VM programming to solve a real life-programming problem.
Consider these customer requirements.

Requirements
Inputs: Outputs:
MPEG2 compliant video with AC3 audio Using customer provided MPEG2 and AC3 elementary
streams, author a DVD that meets these requirements.
A text file showing the chapter start points in
the video.
For each odd number chapter (1,3,5,7 etc.)
the chapter needs to loop indefinitely until
the user tells it to move to the next chapter.
For each even number chapter (2,4,6,8 etc.)
the chapter only plays once and then call the
next (odd) chapter.
To advance to the next chapter, the user can
push ‘root’ or ‘main’ menu button on the
remote.
To interrupt or restart the demonstration, the
user can push the ‘title’ menu button on the
remote.
After playing the last chapter, automatically
restart the demonstration without user
intervention.
Option to play the entire movie without
looping.
DLP Branching and VM Commands
Lesson #3
Page 2 of 7

DLP Step DLP Output


Begin by creating a DLP
project with one VMG and
one VTSM menu. By
default, a movie object is
created automatically for
you.

Import the movie and add


the chapters using the text
file (or manually add the
chapters via the movie
timeline).

Be default chapter 1 is
always the beginning of the
movie.
DLP Branching and VM Commands
Lesson #3
Page 3 of 7

DLP Step DLP Output


For this example, create
four branching objects. To
help visualize the process,
let’s tie each chapter to the
branching object number.
(chapter 1 = branching
object 1 etc.)

Repeat for all four


branching objects.
DLP Branching and VM Commands
Lesson #3
Page 4 of 7

DLP Step DLP Output


Let’s change the network to
reflect the looping and
single play requirements.
You can use the ‘draw end
links connections icon’ for
graphically build your
network.

To loop an object unto


itself, use the tool and draw
back upon itself. A ‘loop’
text tag will appear on the
link (as shown).

I rearranged the objects to


visually show the network.

First play and title will


point to the VMG menu.

VMG menu has two


buttons ‘Demo’ and ‘Play’.
Demo will play the
loop/single play network
while ‘play’ will play the
entire movie.

Note that the movie1 object


links back to the VMG
menu. Also, branch objects
1 and 2 do not have
traditional in-bound
network links. We will call
these titles using VM
commands.
DLP Branching and VM Commands
Lesson #3
Page 5 of 7

DLP Step DLP Output


VM Programming In order for the user to force the navigation path through the network (less hard
coding in links) is to use VM commands. I will use two GPRM registers (0 and
1) to help me navigate through the branches.

GPRM0 = G0 = tells me what current object I’m playing


GPRM1 = G1 = used for comparison in the root menu. I cannot do a direct
comparison (i.e. to a constant) so I set G1 to the value and compare against it.
Set G0 in each branching
object by right clicking on
the branching object and
select ‘edit VM’. Enter the
VM editor and type in the
following VM PRE-
commands:

GPRM0 = 1 (branch #1)


GPRM0 = 2 (branch #2)
GPRM0 = 3 (branch #3)
GPRM0 = 4 (branch #4)

Note that a ‘+’ will appear


in the connections window
showing you a VM pre-
command (user) exists.
DLP Branching and VM Commands
Lesson #3
Page 6 of 7

DLP Step DLP Output


By design, the VMG menu
will be the interface to the
user. The VTS root menu
will only be used for
comparisons to decide on
the next title to play (i.e.
the next branching object to
play).

Enter in the following


PRE-commands into the
VTS root menu. Right
click and them enter the
VM editor for the menu.

(Important note: You must


use the ‘quick link’ button
in the editor to obtain the
correct PGC….why?)

Explanation of the VM coding:

1: GPRM1 = 1
2: if (gprm0 = gprm1) JumpVTS_TT 3
3: GPRM1 = 2
4: if (gprm0 = gprm1) JumpVTS_TT 4
5: GPRM1 = 3
6: if (gprm0 = gprm1) JumpVTS_TT 5
7: JumpVTS_TT 2

1-6
When the user pushes the ‘root’ or ‘main’ menu button on the remote, the player
will interrupt the branch title and execute the root pgc. At this point the logic of
the pre-commands takes over. We know where we were at because we set G0
equal to the current playing branch in the branches pre-commands. Thus if we’re
playing branch #1 (a looping object), we will jump to branch #2 and begin
playing that title.

7
In VMG menu we will set G0 = 0 to tell the logic to drop through and
immediately start with branch #1 (when demo is pushed). A side effect is that G0
= 4 when playing branch #4, thus it returns to branch #1 as well. ☺
DLP Branching and VM Commands
Lesson #3
Page 7 of 7

DLP Step DLP Output


Set G0 = 0 in the VMG
menu.

Save your project and compile. Does it behave as expected?

Final Comments As you can see you can do some complex programming with minimal effort in
DLP.

Questions:

1. If you had to expand this example for eight or ten chapters, what would
change?
2. Why did we have to use the ‘quick link’ button in the VM editor to set the
correct jump VM commands?
3. If we had to deal with two different movies (with different attributes), what
would change?

You might also like