Question for Hal about "play all #3" tutorial

Hi Hal,

http://www.dvdstudiopro.co.uk/play-all-3/

I like the idea behind these three scripts because it allows the user to break out of the play all mode. I've been studying it to see how I could apply it to a multi-menu project and have some questions. In my project, the play all button will only be on one of the menus. Each clip is a separate track (there are no chapter markers).

1) Set up script

I think I need a different version of this script for each menu in the project. The first will be just like in the tutorial and be linked to each button on only the menu containing the play all option. The other versions will be linked to each button on all the other menus with two changes: a) it won't need lines 4-7, and b) I need to hard code the base value at line 9 to be relative to the respective menu I'm on. Do I have this correct? Or is there a way I can calculate the base value so I can end up with only two versions of the script, one for the menu containing the play all option, and the second for all the other menus that DON'T have the play all option?

2) End jump script

I think I need a different version of this, one for each menu, linked to all tracks for that menu, because I need to hard code the value for line 7 to be relative to the menu I'm on, and likely hard code the menu in line 9. Do I have this correct?

3) MenuCall script

This one really has me stumped. Is the intention to go to the menu button of the track that was being played at the time the user pressed the menu button? When I play the .img of the tutorial project and hit the menu button, it always goes to the play all button.

If the intent is for the script to take the user to the menu where the last track was being played, and line 3 gets the button number, how do I get the right menu number? What would line 9 look like?

-----

The tutorial project doesn't seem to work correctly in the simulator. Choosing the play all button executes clip 1, then branches to the end jump script, then gets stuck in an infinite loop at line 5. GPRM 0 has the value of 65535. Clip 1 says on the screen and never advances to clip 2.

-----

Is there a better way to do what I want to accomplish with these multiple menus, given that I have separate tracks for everything?

PowerBook PowerPC G4 1.5GHZ with 1.25GB RAM, Mac OS X (10.4.11), QT 7.5, DVD SP 3.0.2, FCE 2.0.3, 5th generation iPod

Posted on Sep 18, 2008 10:57 PM

Reply
4 replies

Sep 19, 2008 3:18 PM in response to Todd Andrews

Hi Todd, thanks for the feedback on that project. I have to say I've tried downloading and opening it and I am not getting the same error you are seeing, which seems odd.

As I understand it you have got three menus and only one has got the play all button on it. The others have direct links to the individual tracks.

In this case I wouldn't use that particular scripting system I don't think. I would probably use the same sort of system as described in the Manual and not try to make it a dynamic scripting solution.. unless there was a really compelling reason why. Let's explore how to do this if there was such a reason...

I'd only set a flag for the play all from the button on the first menu. Every other button on the other menus would clear the play all flag and then go on to the appropriate track. The menu call would then need to see if there was a play all in progress or not, and the end jumps would go to a script to see which is the next track to play if in a play all, or return you to the menu if not.

So, the play all button would go to a script like this:

mov GPRM0, 1
mov GPRM1, 49280
Jump Indirect GPRM1

The buttons on the other menus would need to clear the play all (which we can do by overwriting the value with something else), so go to a script that keeps track of the menu and also the button value, which we can use later to get back to the right place. I'll assume that on menu 2 you have got three buttons (tracks 1, 2 and3), and menu three you have the next three buttons (tracks 4, 5 and 6):

mov GPRM0 Last Item
mov GPRM1, SPRM8
div GPRM1, 1024
add GPRM1, 3 If (GPRM0 = 96)
mul GPRM1, 128
mov GPRM2, 49280
add GPRM2, GPRM1 If (GPRM1 !=128)
Jump Indirect GPRM2

The end jump script would be something like this:

Jump Menu2 \[GPRM1\] If (GPRM0 = 64)
Jump Menu3 \[GPRM1\] If (GPRM0 = 96)
add GPRM1, 128 If(GPRM0 = 1)
Jump Menu1 If (GPRM1 > 50048)
Jump Indirect GPRM1

So, what is going on here is that in the second script we assume we are starting a single track playing. We get the last item (the value of the menu, which will either be 64 or 96 depending on which menu you were just on), we get the button value and then increment it accordingly if we were on menu 3. All of this overwrites the play all set up in script 1, which is irrelevant if we are starting from a different menu. We put the value of the first track into GPRM2, then we increment it to get us to the correct track for the button we selected - as long as it wasn't the button for track 1. In that case we simply want to go to track 1, of course.

The third script works for both scenarios and gets us back to the correct menu and button if we came from menu 2 or 3 (where there is no play all), but if we did come from menu 1 and are in a play all we need to get to the next track in the sequence. In this I have assumed six tracks, so the top value for that is 50048. If we add 128 and find ourselves above that value then we must have played all of the tracks, so we can go back to menu 1. Otherwise we head on to the next track in the play all sequence. If you have more tracks you'll need to adjust this number accordingly.

All you need do now is sort out what happens when the user presses the menu button whilst in a play all, and does so only to pause playback. They may wish to resume the play all later on, so we can't simply clear the values. If they press menu, then go to a different menu and select a track we can safely assume they are out of the play all now and want to watch an individual track. You'll need a script for the menu call for every track, something like this:

Jump Menu2 \[GPRM1\] If (GPRM0 = 64)
Jump Menu3 \[GPRM1\] If (GPRM0 = 96)
Jump Menu1

And assume that people know they will need to press the menu button a second time to resume playback. Of course, you could send them to a different menu in line three which looks identical to menu 1 but has a 'resume' button instead of 'play all'. You can also simply allow them to move on to a different menu as well, which will lead them to activate the second script, overwriting the play all and get out of the loop that way. It's your call, really.

Now, don't confuse track values with menu values - tracks start at 49280 and increment by 128 each time. Stories also increment that value by 128 if you have got any on your tracks. Menus start at 32 and increment by 32 each time.

This is all conjecture on my part - I haven't had a chance to set this up and test it in any way, but the logic seems about right. I'd be interested to know if you use it, and if so, whether it works for you. I'll try to build a sample project with it when I get a chance.

Sep 20, 2008 11:07 PM in response to Hal MacLean

Hi Hal, thanks for your prompt and very detailed reply. It's very helpful. One thing I'm trying to figure out:

You'll need a script for the menu call for every track,


I know (or think I know) that a script tied to a track overrides the disc-level menu call, but I'm not sure I understand why the track-level override might be needed in this case. My brain isn't wrapping around that concept so maybe I better turn in and ponder it after a few hours of sleep. 😀

Sep 21, 2008 9:51 AM in response to Todd Andrews

It's simply that you have got three menus, so when you are in a play all and the user selects menu, where do you send them? It's fine to have the menu call in each track and you can assume that if they are in track 4 you return them to menu three and the button for track four... however, if they got there from a play all, do you want to send them to menu 1 and the play all button?

If so, use the value in GPRM0 from the above scripts to get you where you need to go. If you are in the play all scenario, that value would be '1'. If you are not, it will either be '64' or '96'. If you are in a play all the value in GPRM1 will be over 49280, otherwise it will be much lower (a button number), so it should be easy enough to get to the correct menu:

Jump Menu1 If (GPRM0 = 1)
Jump Menu2 \[GPRM1\] If (GPRM0 =64)
Jump Menu3 \[GPRM1\] If (GPRM0 =96)

Again, I have not tested this... you should try it and see if it works.

Sep 21, 2008 11:06 PM in response to Hal MacLean

I think I'm too much of a noob to grasp some of these advanced concepts so I'm going to start out with something a bit simpler (I hope) and come back to this thread after I have more experience under my belt. 😀 Thanks for your help in any case as it's provided me with some techniques I'll no doubt use in the future.

I've run into a couple of scripting problems but since they are not directly related to the play all#3 tutorial I'll start a new thread.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Question for Hal about "play all #3" tutorial

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.