home | products |web boards| faq | galleries | contact | about  
multimedia autorun autorun
download multimedia buy now graphics multimedia search


 

DVDlab
Home

Cowboy Who
Intro
Production
Authoring
Promo

Articles
H. Theater
DOF Machine
3D Video

EditStudio
Start here

Photo-Brush
Start here

Real-Draw
Start here

CompactDraw
Start here

PhotoSEAM
Start here

Multimedia Builder
Start here

Other tools
UltraSnap
Camera Tools

 

 

 

 


Creating DVD Layout Part 3

Top  Previous  Next

So I have the basic layout done, but I would love to make the navigation cosmetically correct.

That means when user select to play episode 6, I want it to return to the menu from where he started (Episodes 2) and have the ep. 6 highlighted.

 

For this we will use GPRM0 register that will remember what episode we were playing.

Just to make it more obvious, we will simply associate the episode number with the GPRM0. That is GPRM0=1 is for First episode , 2 for second etc. (We will ignore 0 so the episode number correspond to the GPRM0 value)

 

First Let's reset this parameter in the main menu:

clip0045

Open VM Commands and in PRE command part click edit.

In the Register Alias I will change the GPRM0 alias from G0 to HighlitingEp. This is just infernally for VM Visual Block editor where the GPRM0 will be from now represented by the HighlitingEp alias.

 

clip0058

 

Now I will add just the Operator to set the HighlitingEp which is the GPRM0 to 1 (first episode)

clip0059

When I close this, I will see in the VM script that indeed the GPRM0 was set as 1.

 

clip0055

 

Just to be consistent, I also added the same line to the First Play VM command, where I already had GPRM1 = 0 (For the selection which button was pressed on main menu)

 

Now, let each episode set this parameter to the correct number.

In each episode PRE command we will change this GPRM1 (alias HighlitingEp) to correspond to the actual Episode number:

clip0061

 

All is set, now we need some main test code that will process these data.

 

The main code

Our ROOT menu is the Episode 1 and here is where every one single episode will end up.

So let's open the VM commands on this menu.

There are already some commands inserted in DVD-lab dynamically added commands.

1. GPRM12 = 1024
2. if (GPRM11 == 11) GPRM12 = 0
3. if (GPRM11 == 10) GPRM12 = 0
4. if (GPRM12 == 0) Goto 6
5. SetHL_BTN GPRM12
6. GPRM11 = 10
7. GPRM15 = 10

This is where the Abstraction Layer (AL) of DVD-lab shows its trails. Without the abstraction layer, many of the advanced functionality in DVD-lab PRO will not work, like the Play list or even simple linking from a movie to menu will not work, since by specs the title can link directly only to the Root menu.

In DVD-lab few registers above GPRM10 are used.In this code only GPRM11,12 and 15 are used:

GPRM11 is Node - this is a special flag that allows for the main AL functionality. Thanks to this flag many linking type that are not possible in specs are possible in DVD-lab.  We should never overwrite the Node.

GPRM12 is Temp - this is used by AL for a temporary storage within one object. We can also use this for storing temporary data but only within one object as most likely any other object will rewrite this GPRM.

GPRM15 is LNode - this is used for Return to last menu object. Such node is placed only in menus and so the AL's Return to last menu object can determine what was the last menu used.

 

As you can see the default code also set Highlighting of a certain button

SetHL_BTN GPRM12

and if you look at the first line, it is GPRM12 = 1024. The DVD uses buttons based on 1024 multiplier. That is first button is 1024, second is 2048 etc. So this code will always set the first button on the menu as highlighted by default.

This is what we need to change.

The rest code works mostly with the node flag and what it does is simply to avoid setting of the Highlighting in two special cases - when the played Node is the same as the Node of this object. Confusing? maybe, but what it means is if the motion video (if any) in this menu loops we don't want to set the highlighting to button 1 again and again each loop, because user may already change it and then it will be confusing!

Anyway, it is part of AL and it works so we don't have to spend much time on this.

 

In DVD-lab PRO we can design the code as either Visual Blocks or directly as Script. We can also switch between these two later. Here we will be working with the Visual Block editor as it is perhaps more explanatory.

 

clip0063

 

So we will click Edit button and add new commands in the Custom PRE Commands:

 

clip0060

 

What this does?

If the HighlitingEp carries the number of currently watched episode. If no episode played yet then it is 1 as we set in the main menu VM command.

1. Since we have only 4 buttons on each of two episode menu, in this Episodes 1 menu we want to process only number 1,2,3,4.

Everything else will be processed by Episodes 2. That is the first line of our code.

2. We will put this episode number to the Temp parameter (since we need to modify it)

3. Now we can reset the Episode number. We don't need it anymore

4. We will multiply the Temp by 1024. This will ultimately give us the Button number that can be directly used in SetHL_BTN later

 

The Visual Block Editor correspond to this VM code (in case you prefer scripting)

GPRM12 = 4
if (GPRM0 > GPRM12) LinkPGCN 3
GPRM12 = GPRM0
GPRM0 = 1
GPRM12 *= 1024

You see in Script we have to use constants as in LinkPGCN where we link to PGC 3, that is our Episode 2. The Block Editor is more universal because it fills these constants dynamically to always correct value.

So far so good. It is now also time to note that in order for this work, the buttons on the Episodes menu must be ordered in the correct order. What that means? The first button must be the button for Ep 1, second for Ep 2 etc, else it will not work.

And advanced DVD-lab user already knows that the order of buttons in menu is determined by their position in layers. The bottom-most object is button 1, above it is button 2 etc.

Now again let's look at the default code we had previously as Dynamically added commands:

1. GPRM12 = 1024
2. if (GPRM11 == 11) GPRM12 = 0
3. if (GPRM11 == 10) GPRM12 = 0
4. if (GPRM12 == 0) Goto 6
5. SetHL_BTN GPRM12
6. GPRM11 = 10
7. GPRM15 = 10

The code is ok, except that we don't want the very first line of the dynamically added code GPRM12 = 1024, because GPRM12 is Temp and we already spend some time to fill the Temp with a value corresponding to latest played episode.

 

We cannot just change the Dynamically added code. Why? because it is in fact not there yet. This window only shows what code will be there during compilation, but that code can change any minute, by simply deleting object or changing some parameters of menu.

The dynamically added code is at this moment just a virtual code. That means we cannot change something that was not yet created.

 

So how we do this?

By making the Dynamically code permanent. We will add the code to our Custom PRE command code and remove the line that we don't need.

 

clip0062

5. This line is a script and we will add two lines from the dynamically added code.

6. This is the line if (GPRM12 == 0) Goto XXX. This line is to simply bypass the SetHL_BTN GPRM12 line if the GPRM12 (Temp) is zero. That's what we do here as well. But we do it in Visual block editor to avoid putting any constant line number to the GOTO. Obviously the original line if (GPRM12 == 0) Goto 6 will not work, because now, the 6th line in our code is something else.

7. A script SetHL_BTN GPRM12, this will set the Highlighting to the value set in Temp. This is the command that will change the button Highlighting to the last played episode.

8.-9. From the original code, we will set the Node and LNode to the same value as it was - 10 in this case. This is necessary so we keep with the Abstraction Layer

10 . Script: Break. This will bypass any other code below, in our case this will bypass the Dynamically Added code - we don't need it because we already put all what was necessary to this code. In fact we don't want to run the dynamically added code, as it will break all what we were doing.

 

When we close the VM Visual editor we will see that the code in Custom PRE Commands has been updated:

 

1. GPRM12 = 4
2. if (GPRM0 > GPRM12) LinkPGCN 3
3. GPRM12 = GPRM0
4. GPRM0 = 1
5. GPRM12 *= 1024
6. if (GPRM11 == 10) GPRM12 = 0
7. if (GPRM11 == 11) GPRM12 = 0
8. if (GPRM12 == 0) Goto 10
9. SetHL_BTN GPRM12
10. GPRM11 = 10
11. GPRM15 = 10
12. Break

 

Because of the very important Break at the line 12 The DVD-lab dynamically added commands that continue after this code will be NOT executed.

 

Episodes 2 menu

From the code above we see that if the HighlitingEp register is > 4 then we go to Episodes 2.

Here our Custom PRE command have to do basically the same as we did in Episodes 1, except for few small details.

 

clip0064

 

In line 2 we test if perhaps the variable HighlitingEp is not already less than 5 in which case we don't want to subtract 4 on line 3.

This should probably never happen, but it is still here if for some reason user gets to the second menu manually. We know that sometimes playing with remote on some players may allow for direct jumping to menus.

Then on line 3 we simply subtract 4 from the value and the rest goes similarly to the code in Episodes 1.

Again, we will add the AL code at the end and use Break as the last line. The Abstraction Layer code will have obviously few constants different, because the Node of this menu is also different.

 

Note about NODEs.

So what is this GPRM11 Node exactly? When you are in the Connection window, you can show the nodes using the "Show Nodes" button. This will reveal that every object: menu, title, VM command etc. has two Nodes. IN node and OUT node. This is simply the GPRM11 value that is set in PRE and POST command of any object.

clip0065

Thanks to this number the AL (Abstraction Layer) and advanced programmer as well always knows what was the last object that played. If AL for example see that GPRM11 has value of 10, then it knows that we are coming from the Episodes 1 menu by clicking on some button. If the GPRM11 has value 11 then AL knows that we are coming from Episodes 1 menu, but this time because of Link end (for example Timeout, video or audio end etc..)

Top  Previous  Next


You can now buy this Cowboy Who? Season 1 double-disc collectror's ultra-limited edition on DVD!

Part hallucination, part labor of love, it is, at the same time, like nothing you’ve ever seen...
Don't wait until it's too late!



If you see anything interesting on this site which you think would be worth for your friends to know, simply click this button:

The link to this page will be included automatically.
No SPAM! Neither you, nor your friend will become part of ANY mailing list.

Images on this web-site were captured with UltraSnap and created with Real-DRAW PRO

 
© www.MediaChance.com 2000