MyDVD Play All Example

Presented here is a Sonic MyDVD project that was authored in DVDAfterEdit to implement a Play All button.

MyDVD does a play all if you activate the first menu. Activating subsequent menus plays that menu and continues to the end. Not a bad solution. We will change it to behave like the Play All examples authored with other programs.

In MyDVD, which uses a motion menu with a button for each clip, very much like iDVD, it creates a separate VTS for each clip. The motion menu is placed in the first Video Title Set Menu. I presume if there are submenus they would be placed in the next VTS, etc.

MyDVD has an abstraction layer layout somewhat similar to DVDSP 2. Each title set menu has three dummy menus, a root menu, a chapter menu, and a non-entry menu. Except they are not quite dummies they have a single frame of black. The motion menu is assigned as a fourth, non-entry menu. If the motion menu is present, the frame of black in the dummy menus is replaced by a frame of black followed by the starting frame of the motion menu.

There are a considerable number of VMG dummy PGCs. They also have a single black frame.

Here are the commands:

First Play PGC

#DVDAfterEdit Commands V1
#PreCommands from "MyDVD Play All:First Play PGC:"
1:	Jump VMG PGC 9

VMG PGC 9

#DVDAfterEdit Commands V1
#PreCommands from "MyDVD Play All:Manager Menus:English (14 menus):VMG PGC 9 (1 program):"
1:	Set r15 = 1
2:	Jump VTS 1 VTS TT 1 Menu Root

Looking at the Video Manager Title Play Map, we see that the first title is VTS 1, as might be expected.

VTS 1 VTSM PGC 1 Menu Root

#DVDAfterEdit Commands V1
#PreCommands from "MyDVD Play All:Video Title Set Menus:Title Set 1 Menus:English (4 menus):
VTSM PGC 1 (1 program):"
1:	if  r15 >= 1 then Link PGC 3
2:	Set r15 = Title
3:	Set r15 &= 0
4:	Set r15 /= 1
5:	Set r15 = 0
6:	Link PGC 4

Since r15 == 1 we will link to VTSM 1 PGC 3

VTS 1 VTSM PGC 3 (non-entry)

#DVDAfterEdit Commands V1
#PreCommands from "MyDVD Play All:Video Title Set Menus:Title Set 1 Menus:English (4 menus):
VTSM PGC 3 (1 program):"
1:	if  r15 >= 3 then GoTo Line 7
2:	if  r15 >= 2 then GoTo Line 5
3:	Set r15 = 0
4:	Link PGC 4
5:	Set r15 = 0
6:	Link PGC 4
7:	if  r15 >= 4 then GoTo Line 10
8:	Set r15 = 0
9:	Link PGC 4
10:	Set r15 = 0
11:	Link PGC 4

Since r15 == 1, we will set it to zero and link to VTSM 1 PGC 4

VTS 1 VTSM PGC 4 (non-entry)

#DVDAfterEdit Commands V1
#CellCommands from "MyDVD Play All:Video Title Set Menus:Title Set 1 Menus:English (4 menus):
VTSM PGC 4 (1 program):"
1:	Link PGC 4

Since this is the motion menu, it just plays (there are no pre commands) and when it reaches the end of the cell it plays again.

We must look at each button command to see what happens next. (The button commands are in the Nav packs; if you dont remember how to get to them see the ReelDVD Play All Example for a screen shot).

Button 1

#DVDAfterEdit Commands V1
#Selected  from "MyDVD Play All:Video Title Set Menus:Title Set 1 Menus:English (4 menus):
VTSM PGC 4 (1 program):PG 1:Cell 1 (29 nav packs):Nav pack 2:"
1:	Jump VTS TT 1 PTT 1

Button 2

#DVDAfterEdit Commands V1
#Selected  from "MyDVD Play All:Video Title Set Menus:Title Set 1 Menus:English (4 menus):
VTSM PGC 4 (1 program):PG 1:Cell 1 (29 nav packs):Nav pack 2:"
2:	Jump VMG PGC 13

Button 3

#DVDAfterEdit Commands V1
#Selected  from "MyDVD Play All:Video Title Set Menus:Title Set 1 Menus:English (4 menus):
VTSM PGC 4 (1 program):PG 1:Cell 1 (29 nav packs):Nav pack 2:"
3:	Jump VMG PGC 12

Button 4

#DVDAfterEdit Commands V1
#Selected  from "MyDVD Play All:Video Title Set Menus:Title Set 1 Menus:English (4 menus):
VTSM PGC 4 (1 program):PG 1:Cell 1 (29 nav packs):Nav pack 2:"
4:	Jump VMG PGC 11

Button 5

#DVDAfterEdit Commands V1
#Selected  from "MyDVD Play All:Video Title Set Menus:Title Set 1 Menus:English (4 menus):
VTSM PGC 4 (1 program):PG 1:Cell 1 (29 nav packs):Nav pack 2:"
5:	Jump VMG PGC 10

The first button jumps directly to the Title, since it is in the same VTS. But all of the others must route themselves through a Video Manager PGC, because of the DVD Spec limitation that you may never navigate directly from one VTS to another.

By the way, that is why the ReelDVD project is so simple since everything is in a single VTS those restrictions dont apply!

VMG PGC 13

#DVDAfterEdit Commands V1
#PreCommands from "MyDVD Play All:Manager Menus:English (14 menus):VMG PGC 13 (1 program):"
1:	Set r15 = 1
2:	Jump VTS 2 VTS TT 1 Menu Root

VMG PGC 12

#DVDAfterEdit Commands V1
#PreCommands from "MyDVD Play All:Manager Menus:English (14 menus):VMG PGC 12 (1 program):"
1:	Set r15 = 1
2:	Jump VTS 3 VTS TT 1 Menu Root

VMG PGC 11

#DVDAfterEdit Commands V1
#PreCommands from "MyDVD Play All:Manager Menus:English (14 menus):VMG PGC 11 (1 program):"
1:	Set r15 = 1
2:	Jump VTS 4 VTS TT 1 Menu Root

VMG PGC 10

#DVDAfterEdit Commands V1
#PreCommands from "MyDVD Play All:Manager Menus:English (14 menus):VMG PGC 10 (1 program):"
1:	Set r15 = 1
2:	Jump VTS 5 VTS TT 1 Menu Root

Button 1 proceeded directly to VTS TT1. (r1 is still set to 1). Each of the other command sequences sets r15 = 1 and goes to the root menu of the desired track.

Each of the root menus is identical, here is one:

VTS 2 VTSM PGC 1 (root)

#DVDAfterEdit Commands V1
#PreCommands from "MyDVD Play All:Video Title Set Menus:Title Set 2 Menus:English (3 menus):
VTSM PGC 1 (1 program):"
1:	if  r15 >= 1 then Link PGC 3
2:	Set r15 = Title
3:	Set r15 &= 0
4:	Set r15 /= 1
5:	Set r15 = 0
6:	Jump VMG PGC 2

Since r15 == 1, it links to PGC 3. Each of the non-entry menus is identical.

VTS 2 VTSM PGC 3 (non-entry)

#DVDAfterEdit Commands V1
#PreCommands from "MyDVD Play All:Video Title Set Menus:Title Set 2 Menus:English (3 menus):
VTSM PGC 3 (1 program):"
1:	if  r15 >= 2 then GoTo Line 4
2:	Set r15 = 0
3:	Jump VTS TT 1 PTT 1
4:	Set r15 = 0
5:	Jump VTS TT 1

Since r15 == 1, it will Jump VTS TT 1 PTT 1. That means to the first PTT in that VTS. Jump VTS TT 1 would seem to have the same result. So, by round-about ways we eventually played each track we wanted for each button in the motion menu.

To see what happens after playing the track, we look at the post commands for each track:

VTS 1 PGC 1 TT 1

#DVDAfterEdit Commands V1
#PostCommands from "MyDVD Play All:Video Title Sets:VTS 1:PGC 1 TT 1:"
1:	Call VMG PGC 8 resume C1

VTS 2 PGC 1 TT 1

#DVDAfterEdit Commands V1
#PostCommands from "MyDVD Play All:Video Title Sets:VTS 2:PGC 1 TT 1:"
1:	Call VMG PGC 7 resume C1

VTS 3 PGC 1 TT 1

#DVDAfterEdit Commands V1
#PostCommands from "MyDVD Play All:Video Title Sets:VTS 1:PGC 1 TT 1:"
1:	Call VMG PGC 6 resume C1

VTS 4 PGC 1 TT 1

#DVDAfterEdit Commands V1
#PostCommands from "MyDVD Play All:Video Title Sets:VTS 1:PGC 1 TT 1:"
1:	Call VMG PGC 5 resume C1

VTS 5 PGC 1 TT 1

#DVDAfterEdit Commands V1
#PostCommands from "MyDVD Play All:Video Title Sets:VTS 1:PGC 1 TT 1:"
1:	Call VMG PGC 4 resume C1

So each track has an associated Video Manager PGC which is invoked after playing the track. Well take a look the first one.

#DVDAfterEdit Commands V1
#PreCommands from "MyDVD Play All:Manager Menus:English (14 menus):VMG PGC 8 (1 program):"
1:	Set r15 = 2
2:	Jump VTS 2 VTS TT 1 Menu Root

Each PGC 8 thru 4 unconditionally jumps to the next title. So now we know how to fix them. Just use another variable to mean play all and make the jumps conditional on that variable. Clear the play all variable when entering the title menu. Set it when invoked by the play all button.

I will leave the exercise to the reader.