"Last menu" command

Posted by CaseyPetersen 
"Last menu" command
July 02, 2010 12:01PM
Hi everyone!

There was a feature back in DVDit Pro 2.5 that I really liked, but have not seen in anything since then. It was a little thing that they called "Last Menu". At the end of a clip, or any time you pushed the menu button, there was an option to go to any specific menu, or the last menu...the last menu used...so if you were watching a DVD, and hit Chapters from your main menu, and selected a chapter, then hit menu again, it would take you back to the chapters menu...the last menu you came from.

I really want to be able to do this again in DVD studio pro, but am not sure how. Anyone have any ideas?

Thanks!
Casey
Re: "Last menu" command
July 06, 2010 03:31PM
Hi Casey - your thread on the Apple discussions has the answers, and I've posted about a scripted solution, which I copy here for you (note that there is a small error in the scripts which I've marked correctly here):

Hmm... so you want to try scripting? Great! I think everyone should...

I'll assume a simple two menu and two track disc... here's what you do.

Create a script that reads:

mov GPRM0, 1
Jump track1

and point your menu button for track 1 to that script instead of the track. Repeat this for track 2 (which is linked to from Menu 2), but change the script slightly:

mov GPRM0, 2
Jump track2

Now, whenever you leave the menu to go to the track, you first of all put a value into a memory slot (a 'GPRM'). Because of this, you can now work out exactly which menu you came from.

Create a third script and make it read as follows:

Jump Menu1 If (GPRM0 = 1)
Jump Menu2 If (GPRM0 = 2)

Set this script as the menu call and end jump for both tracks. Now, when you select a track from a menu the memory slot will get a value. As the track ends it goes to the third script which jumps back to a menu according to whatever the value was.

Now, this is a basic outline - it can be done in several ways, but this is a straightforward version. You will quickly want to not only get back to the right menu, but also the button you were last on. This is also reasonably easy, but involves a little extra logic in your scripts. We have to store the menu button you just used to go to a track (and don't forget you could be going to a specific chapter in a track, not just to the start of the track), and then go back to the menu and that particular button.

There are several ways, but here's a simple one. Your first script now should read:

mov GPRM0, 1
mov GPRM1, SPRM8
div GPRM1, 1024
Jump Track1

The first two lines get the button value (all button values are stored automatically in SPRM8, but you can't do anything with SPRM8 except read from it... you must put the value into another GPRM, in this case I used GPRM1) and then reduce it to a simple integer (buttons are in values of 1024, so dividing by that value means you end up with 1, 2, 3, etc instead of 1024, 2048, 3096 etc.) Your second script (when selecting from the second menu) should read almost the same:

mov GPRM0, 2
mov GPRM1, SPRM8
div GPRM1, 1024
Jump Track2 //this was the error. It should say Track2, but on the apple forums it reads 'Track1'

Now, your third script needs two sets of logic - one to find out the button value and one to get to the menu... lets assume three buttons on a menu for this example:

goto 5 if (GPRM0 = 2)
Jump Menu1:button1 If (GPRM1 = 1)
Jump Menu1:button2 If (GPRM1 = 2)
Jump Menu1:button3 If (GPRM1 = 3)
Jump Menu2:button1 If (GPRM1 = 1)
Jump Menu2:button2 If (GPRM1 = 2)
Jump Menu2:button3 If (GPRM1 = 3)
Jump Menu1

Now, as the track finishes (or you press the 'Menu' button) the disc fist looks to see whether you came from menu 2. If you did, it sends you to the line that starts dealing with the menu2 jumps. If not, it starts working through the possible menu 1 jumps.

Scripts work through a line at a time until something evaluates to being 'true'. As soon as the correct combination is found, the jump takes place. In the last line I've put a safety net that gets you to a menu just in case nothing works. If you don't put it, nothing bad should happen in such a simple structure, but it's good practice. If for some reason none of the lines evaluate to 'true' then your disc will hang. The last line at least gets you out of that possibility.

Now - there's no reason you can't target specific chapters, or stories, or have many more tracks and buttons on menus... it is all possible, but just gets more complex.

Finally, there are other ways to achieve this, and some are more efficient to write (take less lines of code) but are harder to understand. This method is a 'long hand' way of doing the job that will definitely work, but takes longer to create and is easier to follow.

Finally, finally, you do not need to script this at all. You can do all of it by using stories.

--

lafcpug mod
Re: "Last menu" command
July 06, 2010 04:21PM
WOW!!! THANKS!!!!!!!

I'll have to give this a shot tomorrow (hopefully).
Re: "Last menu" command
July 08, 2010 04:56PM
Okay...I'm over my head already!

I'm stuck on the first item:

Create a script that reads:
mov GPRM0, 1
Jump track1

I don't even know how to do that much! Maybe you can point me to a scripting basics site smiling smiley

Casey
Re: "Last menu" command
July 09, 2010 06:45PM
OK- it's quite hard to describe this in writing, but very easy to show you...

When you add a script to your project it has a single command showing - 'nop', which stands for 'No Operation'. Click on the nop and look in the property inspector. You should have access to a series of commands that you can apply.

Use the 'Set GPRM' command first, and the inspector will change again and show you all the things you can do. In the first drop down, select 'Mov' and in the following boxes set the target GPRM to be GPRM0 and the value to be 'immediate', then specify the '1' in the text field.

Note the script line now reads 'mov GPRM0, 1'

Now, add a new line to the script by clicking on the '+' and make sure the new 'nop' appears at the bottom. Click on it and go back to the inspector, choose 'Jump'. In the resulting inspector choices, choose 'Track' and then follow the small arrow to see a list of all the available tracks, and select Track 1.

The second line should now read 'Jump Track 1'.

There is a full list of what the commands mean here:

[www.dvdstudiopro.co.uk]

--

lafcpug mod
Sorry, you do not have permission to post/reply in this forum.
 


Google
  Web lafcpug.org

Web Hosting by HermosawaveHermosawave Internet


Recycle computers and electronics