Tutorial: Page (1) of 2 - 03/25/05 Email this story to a friend. email article Print this page (Article printing at MyDmn.com).print page facebook

Scripting System Streams in DVD Studio Pro

Part 1: Enabling and disabling subtitles with an optional resume function By Dave Nagel
Whether you like it or not, over the course of your DVD authoring career, there will come a time when you simply have to resort to scripting. One of those occasions is when you're working with multiple streams--whether those streams be audio, subtitles or angles. There's simply no way around it. And each one of these stream scripting scenarios has different issues associated with them. In this first part in our third series on scripting in DVD Studio Pro, we'll take a look at scripting subtitles--specifically scripting buttons so that viewers can not only enable and disable them in a menu, but also resume where they left off in the last tack viewed.

For this exercise, I'll assume you already have your subtitles created, imported and ready to go. If not, there's a comprehensive reference on subtitle creation within DVD Studio Pro's user guide, so I won't regurgitate that information here. Before getting started with this, you should place your subtitles into the S1 field in DVD Studio Pro's Track Editor window. And make sure that you do not have the "Force Display" option enabled. If you do, select one of the subtitles in the track. Then, in the Inspector palette, uncheck the Force Display checkbox and hit the "Apply to Stream" button to disable forced display on all of the subtitles in the stream.

For this project, we'll be working with two buttons--one to enable subtitles and one to disable the subtitles, each with an option for resuming the track from where it was last played. In addition, we'll have a third button containing its own script that will set a value in GPRM 7 and also jump to our track. (This third one is only necessary if you wish to incorporate the resume option into your subtitle scripts. (In other words, you want to provide your viewers with an option to turn subtitles on or off and resume track playback with the single click of a button.)


Before we get started, if you haven't done so already, you might want to go back and read up on our previous articles on DVD Studio Pro. Here's a complete list as of this posting (March 2005).

DVD Studio Pro Scripting, Series 1
Part 1: General scripting information
Part 2: Creating an interactive quiz
Part 3: Keeping track of time
Part 4: Pausing and resuming a timer


DVD Studio Pro Scripting, Series 2
Part 1: The basics of working with SPRMs
Part 2: Bit-wise operations and binary number conversion

Other scripting articles
Scripting a dynamic 'play all' button

General design and authoring topics
DVDSP General Walkthrough
Customizing Button States
Highlights and Overlays
Zoom Masks
Customizing Masks
Fixing color shift (for DVDSP 2.0 only)
Motion Masks (custom patches)
Remote Rollovers
Setting Up DTS Playback on the Mac
Creating Alpha Transitions, Part 1
Quick Tip on Stories
Alpha Transitions, Part 2
Delaying Button Highlights
Buttons over Video
Media Storage
Creating a "Play All" Button by Merging Tracks
Display Conditions and Prescripts

Script 1: enabling subtitles
In our hypothetical project here, the viewer has the option of going to a menu to turn subtitles on or off. This menu will contain two buttons (one for on, one for off). And you'll need to create two scripts for this.



For the first script, choose Project > Add to Project > Script. Rename the script "Subtitles On." In the Script Editor window, select the default "Nop" command. Go to the Inspector palette, and change the command to "Set System Stream." Check the "Subtitle" checkbox, and select "Subtitle Stream 1" from the list of options. Also check the "View" checkbox on the same line. This is what actually turns on the subtitles.



Now, in a script, the "Set System Stream Command" can't stand alone, so you'll need to add a second command to finish it up. In this case, I'll just add a "Jump" command to take the viewer back to the menu currently being viewed. To do this, click the "+" icon in the Script Editor window. Select the new command, and change it to "Jump" in the Inspector palette. And set the "Target" value to the current menu. In my case, that's menu 1.



Now, if you want to add a Resume function, which will take the viewer back to his or her last place in the previously viewed track, you'll need to add another command. (This step is optional. Not everyone wants to resume immediately when changing subtitle options.) So hit the "+" icon again, and change that default command to "Resume." After you do this, move the Resume command in the Script Editor window to the second position, between the "Set System Stream" command and the "Jump" command.



The effect of moving this into the second position is that when this script is activated, the player will set the system stream, then resume playing the movie, ignoring the Jump command completely. However, if there is no track to resume, it won't work at all. So what you need to do is to check the "Compare Command" option in the Inspector, and then give the Resume command something to look at to verify whether or not there is a track to resume. (Don't worry. All will become clear in a little bit.)

In this case, my Compare Command function is going to look for a value in GPRM 7 (a value of 1). If that value isn't present in GPRM 7, then the Resume command will be ignored, and, instead, the next command (Jump) will be activated. The Compare Command function in tis case will look like this.



Make sure you have everything just as it appears in the screen shot above: "Execute if GPRM 7 is = to Immediate with value 1."

That's it for the first script. Connect it to your "Turn Subtitles On" button by dragging it on top of that button in the Menu window.



Page: 1 2 Next Page


Related Keywords:apple dvd studio pro, scripting, scripts, subtitles, resume, subtitle stream

HOT THREADS on DMN Forums
Content-type: text/html  Rss  Add to Google Reader or
Homepage    Add to My AOL  Add to Excite MIX  Subscribe in
NewsGator Online 
Real-Time - what users are saying - Right Now!

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