Sei sulla pagina 1di 8

DVD Lab Pro

Button Processing Programming in VM


Lesson #2
Page 1 of 8

Purpose This lesson will walk through a simple example of determining which
button the user picked from an interactive menu that contains several
buttons. We will also demonstrate how to use the branching object and
virtual machine commands to only play those chapters of interest in two
different video title sets.

Definitions
DLP DVD Lab Pro
VTS Video Title Set
GPMR General Purpose Memory Registers
SPMR System Memory Registers
Empty PGC Program chain that does not contain
any cells but only VM commands.
Sometimes referred to as a pass-
thru PGC.
VM Virtual Machine (instructions)
PTT Part of Title User Defined Chapter
in a movie

Background The programming requirements are:

• Single Menu in VMG domain for all chapter selections


• Play chapters in two different movies, each movie has a different
audio elementary streams (AC3 and LPCM)

Authoring Step DLP Output


Because the two movies
have different audio
streams, we will need to
create two VTS’. Start off
by creating an advanced
project. Then add a second
VTS.
DVD Lab Pro
Button Processing Programming in VM
Lesson #2
Page 2 of 8

Authoring Step DLP Output


Import the four elementary
streams and set the
chapters. For this example,
we’ll set three chapters in
each movie.

Starting with VTS movie1,


select it to make it active
and use the auto chapter
feature. Please note that
we will only ask DLP to
create two (2) chapters
since the first chapter (by
default) starts at the
beginning of the movie.
This leaves us a total of
three chapters per movie.

Note the red markers in the


movie object’s timeline.
These are the chapters.

Repeat for VTS2 movie.


DVD Lab Pro
Button Processing Programming in VM
Lesson #2
Page 3 of 8

Authoring Step DLP Output


By DVD design, we cannot
jump from VMG domain
into VTS –part of the title
(PTT) directly. To solve
this problem, we will create
branching objects in both
VTS domains to access the
PTTs.

Start with VTS1 movie.


Select the movie object to
make VTS1 active. With
VTS1 active, select the
movie branching object to
add three branching objects
to the VTS1 domain.

In this example I deleted


the return links from the
branching objects (for
clarity).
DVD Lab Pro
Button Processing Programming in VM
Lesson #2
Page 4 of 8

Authoring Step DLP Output


Double click on branch 1 in
VTS1. The following pull
down menu will appear.

Select ‘chapter 1’ and then


click on ‘add to list’. Then
click on ‘ok’. We have
created a virtual movie that
will only play the first
chapter of VTS1 movie.
In the background DLP has
created a second title in
VTS1 that is only chapter1.

Note that we didn’t cut out


a portion of VTS1 movie
and added it a second time
Note the warning at the bottom of the object menu. Branching objects are only a snapshoot in
to the VTS1 domain. time. There are no ‘active’ connections back to the movie. If you add and or delete chapters,
you must redo your branching objects.
We’re actually using the
PTT definitions defined by
creating chapters in the
movie. Write the movie
once and use it in several
different ways!

Repeat for chapters two


and three using branching
objects 2 and 3,
respectively.

Repeat the same steps


above for VTS2. The
output is shown.
DVD Lab Pro
Button Processing Programming in VM
Lesson #2
Page 5 of 8

Authoring Step DLP Output


We will now add the
buttons to the VMG menu.

Our menu design will have


eight buttons, four for each
VTS movie.

‘Movie 1’ plays the entire


movie. ‘Cx’ is the
respective chapter.

Lets spice up the menu by


adding a lens flair to the
screen. Note the icon to do
it. Select it and drag a
small box on the menu.
Release it. DLP will create
a nice lens flair to the
menu.

We will now create the


custom VM to help us
navigate through the DVD.

In the connections window


there is a VM ICON.
Select it and add the empty
PGC in VMG domain.

We renamed it to clarify
it’s purposed in this design.
DVD Lab Pro
Button Processing Programming in VM
Lesson #2
Page 6 of 8

Authoring Step DLP Output


Using the button routing
tool link all the buttons (8)
on the menu to the VM
object.

For clarity, link all VTS1


buttons first (top down )
then link all VTS2 buttons
(top down). Thus buttons
1-4 belong to VTS1 and
buttons 5-8 belong to
VTS2.

The yellow number


indicates the button
number.
DVD Lab Pro
Button Processing Programming in VM
Lesson #2
Page 7 of 8

Authoring Step DLP Output


Double click on the VM
object and add the
following VM commands.

Complete and save down


and try compiling it. Does
it work?

Can you do the same


function in a different
way?

An Explanation of the VM code .

• (lines 1,2) The player will put into SPRM8 the last highlited button in multiples of 1024
decimal. Thus button one is stored as 1024decimal and button two = 2048decimal, etc. . We
will need to compare the same way. Note that you can enter in the decimal value and DLP
will convert to hex.
• (lines3-17) The VM command JumpTT only allows comparison by ‘indirect’, meaning, you
can only compare one GPRM to another GPRM. You cannot compare to a ‘direct value’ like
1024 or 2048 etc. So what we will do is used GPRM1 and change its value before doing a
compare. So, having eight buttons we will need to do eight comparisons.
• (line 18) As a default, we will link back to the VMG menu. Just in case we hosed ourself
and forget to check for a certain button.
• The ‘quicklink’ button is essential for VM programming in DLP. To successfully jump to a
PGCN, you must know the number assigned to it by DLP. It is not necessary the sequential
number displayed with the object. Use the ‘quicklink’ button to ensure you will call the
correct PGCN. DLP will fill in the VM code whereever the cursor is located in the edit
window.

Completed VM command:
DVD Lab Pro
Button Processing Programming in VM
Lesson #2
Page 8 of 8

Authoring Step DLP Output


Final Words: The objective of this lesson was to show you how (via VM commands and PGCs) to see which
button was pressed by the user in the VMG menu and perform a certain action. We designed in
VMG because we knew the chapters resided in two different VTS’ due to the two different audio
streams of the source material. If we created the VM in VTS domain, we could not jump across
VTS domains easily.

There are always pitfalls whenever hardcoding in VM. In this example, if you add or take away
titles (movies) in the VTS’, chances are the PGCNs will need to be updated in the VMG VM
object. The JumpTT’s are hard-code using a snapshot of the network at the time of creation. If
you make changes (awl-sheets ☺ ) you must go back and examine your JumpTTs.

You could have just as easily used the button linking tool to link each button to the appropriate
branching object and accomplished the same thing. And in someways, it is much easier to do and
manage down the road. Everything is graphical and easy to understand 6 months down the road.

In this example I purposely left out the return links for all the branching objects in VTS1. What
will occur if you left them out? Will the player lock up or do something else? (hint: IFOedit will
help you find the answer!)

Also, I would like to acknowledge ‘markham’ and ‘moonman’ from the mmbforums with their
VM programming expertise and mentoring. What they shared with me is documented in this
lesson. Thanks guys!

Potrebbero piacerti anche