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

GPRM Partitions in DVD Studio Pro 4, Part 2

Creating partitions and using them in scripts By Dave Nagel
In our last tutorial in this series on Apple's DVD Studio Pro 4, we explored the basics of GPRMs and partitions--when to use them, why to use them and where you can't use them. This time around, we'll answer the question of how to use them, including how to create partitions in the first place and then how to incorporate these partitions into scripts. We'll also cover some of the limitations involved with partitions.

Before we get started, if you'd like an overview of GPRMs and partitions, I urge you to go back and read our previous tutorial on this topic. It will help you to understand the limitations of GPRM partitions and includes specific cases of times you can't or shouldn't use partitions. You can read that article by clicking here. (You can also find a complete list of our previous tutorials on DVD Studio Pro, including in depth articles on scripting, in the list at the end of this article.)

How to create partitions
To begin partitioning your GPRMs, you first need to create a script. So choose Project > Add to project > Script (Command-'). Select this script in the Outline tab. Then, in the Inspector palette, you'll see a complete list of the available GPRMs, along with new pull-down menus. To partition a GPRM, simply select the pull-down menu next to that GPRM and choose the partition method. You can choose one, two, four, eight or 16 partitions for any given GPRM.

Once you do this, the partitions will appear underneath the main GPRM listing, and you can assign custom names to them (by double-clicking their names), just as you can with unpartitioned GPRMs.

The partitions you create will be even. So, if you create four partitions, each one will be a 4-bit partition (4x4=16 total bits).

As long as these partitions are not in use by a script, you can continue changing the configurations of your GPRM partitions. Once you use a GPRM or a partition in a script, the partitions for that GPRM are no longer editable. If later you decide that you want to make a change to the partition configuration, you'll have to go back into your scripts and change the references to that particular GPRM. Then you'll be able to edit the configuration once again. When a partition is in use, the pull-down menu next tot he GPRM will become grayed out, preventing you from making changes.

As a side note, if you wish, you can export your partition settings for use in future projects by clicking the Export button in the Inspector palette. The partition configurations and names will be stored in the exported file, which you can then retrieve later by clicking the Import button in the Inspector palette.

Limitations of GPRM partitions in scripts
Now, before you go crazy and partition all of your GPRMs, you should know that partitioned GPRMs have some limitations that could impact your scripts. The first of these, as we discussed last time around, is the numerical limitation. The more partitions a particular GPRM has, the lower the numerical values that can be stored in them. Here's a list of these limitations based on the number of partitions. The number listed is the maximum numerical value that can be stored in each partition in a given configuration.

One 16-bit partition: 65535
Two 8-bit partitions: 255
Four 4-bit partitions: 15
Eight 2-bit partitions: 3
16 1-bit partitions: 1

So, if your script will only have two choices (0 or 1), then a 1-bit partition will work fine. But if you need to store a number like 1024 in a GPRM, you'll need a 16-bit partition to do it.

But aside from the numerical limitations of partitioned GPRMs, there are other limitations as well. The first is that partitioned GPRMs can't be used in all situations. DVD Studio Pro itself does not allow you to use partitioned GPRMs with the following commands:

? Jump Indirect
? GPRM Mode
? Set System Stream (with the "GPRM-Based" option checked)

The second is that DVD Studio pro does allow you to use partitioned GPRMs in situations that could get you into trouble. In particular, you can use partitioned GPRMs for any Set GPRM command in which the source type is an SPRM. In some cases, this is fine. But in many cases, SPRMs may need to set values well beyond the limitations of 1-, 2-, 4- and 8-bit partitions. Therefore, you should never use a partitioned GPRM with an SPRM when doing so will cause you problems because the range of values that might come from an SPRM are higher than those that can be stuffed into a partitioned GPRM.

Here's a list of the ones that I know for certain require the full 16 bits when passing information to a GPRM:

? SPRM 0 (menu language description code)
? SPRM 4 (current playing title number)
? SPRM 5 (current title number in VTS)
? SPRM 6 (current title PGC number)
? SPRM 7 (current part of title number)
? SPRM 8 (current highlighted button number)
? SPRM 11 (player audio mixing mode for karaoke)
? SPRM 12 (country code for parental management)
? SPRM 13 (parental management)
? SPRM 14 (player video configuration)
? SPRM 15 (player audio configuration)
? SPRM 16 (initial language code for audio)
? SPRM 18 (initial language code for subtitle)

This list is not all-inclusive. So always be sure to test. Or, to be safe, just never pass an SPRM value to a partitioned GPRM.

Incorporating partitions into scripts
So you know how to create partitions and what the limitations of partitions might be. Let's look at an example of how to use them in scripts. For this example, we have a track with two angles, two audio streams, and two subtitle streams. Normally we might simply use a Set System Stream command in our script, followed by a jump to the movie. However, our DVD contains multiple tracks, and each one has different stream options. Therefore don't want to set the system stream for the entire disc all at once. We want to store user preferences for this track in a GPRM, then compare those preferences when the track is played. That way, when the next track is played, we can use a separate comparison script to adjust its system stream preferences without forcing the user to go back and make changes each time a track is viewed.

As usual, the method we're discussing here isn't necessarily the best way to handle this situation, but it is a good example to show you some of the possibilities of working with partitions.

So our project contains six possibilities: angle 1, angle 2, audio stream 1, audio stream 2, subtitle stream 1 and subtitle stream 2. Each one of these options is linked to a button in a menu, where the user can make his or her choices. We could easily consolidate these options into a single script, but to keep things focused, we'll make each option an individual script that will be connected to the buttons in the menu. Therefore, six scripts, which will store information in three partitions: one for audio, one for angle and one for subtitle preferences. Each of these partitions will require a maximum of two bits of information, so we're safe in creating eight partitions for this purpose, even though we won't be using them all.

So begin by creating six new scripts. Select one, and then create eight 2-bit partitions. I'll rename the first three partitions "audio," "angle" and "subtitle," respectively.

Now our partitions for these scripts are set up, and we can start working on the scripts themselves. For each one, we'll have two commands. The first is a Set GPRM. The second is a Jump command. (You need something after a Set GPRM command, or the player will freeze after executing the command.)

1. For my first script, I'll use Set GPRM with a Source Type of Immediate" and a Source Value of "0." For the target, I'll use the pull-down menu in the Inspector palette and select the partition I called "audio."

Page: 1 2 Next Page

Related Keywords:dvd studio pro, gprm, gprm partition


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