Tutorial: Page (3) of 3 - 11/23/04 Email this story to a friend. email article Print this page (Article printing at MyDmn.com).print page facebook

Scripting in DVD Studio Pro, Series 2

Part 1: The basics of working with SPRMs
Choosing a track automatically based on this value
"So, OK," you say, "I can put the value of SPRM 16 into GPRM 0. What am I supposed to do with it?"

Let's say you have two audio tracks, one in French and one in English. You want the French track to play in every case except when English is set as the audio language. So we'll use the first command in our script to find out the audio planguage set in the DVD player, and then we'll add three more commands to set the audio track based on this information. Then we'll use this script as a pre-script for our track. (Obviously there's an easier way to do this, but follow along anyway, just for the sake of illustration.)

1. Add a new command to your script by pressing the "+" icon in the Script Editor.




2. Select this new command so that it shows up in the Inspector palette. Change the command to "Set System Stream." For the sake of argument, we'll say that Audio Stream 2 is our English audio track, so we'll set it to play Audio Stream 2, as seen below.



3. But, as I say, we only want the EnNglish track to play if English is set as the audio language for the DVD player. So we check the Compare Command option, and use the following settings, which means, "only follow this command if GPRM 0 equals 25966." Again, 25966 is the language code for English, which we stored in GPRM 0 in the first command in this script.



4. Then add another command, and this time set it to play the French track, which, for the sake of argument, is Audio Stream 1 in our track.



And we'll use the compare function to make sure the French track plays only if GPRM 0 IS NOT EQUAL TO 25966. ("Not equal" is represented as "!=" symbol in DVD Studio Pro.)



5. Finally, since we're going to be using this script as a pre-script for our track, we'll add one final command, which is "Exit Pre-Script."




Now, if you'd like to test this script, choose your track in the Outline view, and set its pre-script in the Inspector palette, as seen below.



So now you have a fully functional script that takes information from SPRM 16, moves it to GPRM 0 and then uses the values in GPRM 0 to determine which audio track to play. Next time around, we'll take a look at the more complex process of using bit-wise operations to pull and manipulate data stored in different "bits" within a particular SPRM. If you have any questions in the meantime, be sure to visit me in the DVD Studio Pro forum here.




Page: Prev Page 1 2 3


Related Keywords:apple dvd studio pro, scripting, dvdsp, sprm, gprm

HOT THREADS on DMN Forums

Our Privacy Policy --- @ Copyright, 2015 Digital Media Online, All Rights Reserved