Display Condition

The menus, tracks, and stories within DVD Studio Pro can have a display condition applied to them that determines whether they appear, and if not, what should appear instead. For example, based on the DVD player’s aspect ratio setting, the condition can determine whether to play the current track or a track that is better suited to the aspect ratio setting. Or, you can choose to show or not show a menu based on the language setting.

By assigning a pre-script to the element or running a script before it is selected, you can include settings in the General Purpose Register Memories (GPRMs) as part of the condition. See Scripting Overview for information on setting up scripts.

Comparing Display Conditions and Pre-Scripts

All three elements (menus, tracks, and stories) that can have display conditions can also have pre-scripts. Pre-scripts are scripts that are assigned to an element. They can do everything a display condition can do and more. There are some specific differences to be aware of:

  • When an element has both a pre-script and a display condition, the pre-script executes first.

  • Pre-scripts only execute if you have jumped to the root of the element they are assigned to, either by choosing the element’s name in the Connections tab or the name in square brackets in the shortcut menus. If you connect directly to a marker, slide, or menu button, the pre-script does not run. Display conditions, however, run any time the element it is assigned to is jumped to, whether you jump to its root or to a specific marker, slide, or button.

  • On the DVD, pre-scripts are automatically placed with all other scripts in the VTS 1 file group. This can cause slight delays when executing them because the DVD player may have to jump significant distances to get to and from the script. Display conditions reside in the same file groups as the element they are assigned to, which makes them more efficient when playing.

    Note: You can use the VTS Editor to manually place pre-scripts in the same VTS block as the element it is assigned to. See VTS Editor for more information.

Display Condition Parameters

There are four parameters you need to configure when setting up a display condition:

Figure. Display Condition section of an element's Inspector, identifying the various settings.
  • The conditional element: You choose what is to be evaluated to determine whether the menu, track, or story should be displayed. Examples of what you can choose include the DVD player’s region code, aspect ratio, or the contents of a GPRM.

    Note: Display conditions can only use full 16-bit GPRMs.

  • The conditional relationship: You choose the operation to use to determine the relationship between the conditional element and the conditional state. Example settings include smaller, greater, and equal.
  • The conditional state selection: You choose the state of the conditional element. The choices depend on the conditional element. For example, the states for the player region code element are the eight regions (1 USA, 2 Europe, Japan, 3 Indonesia, Taiwan, and so on).
  • The alternative target selection: You choose the project element (menu, track, story, and so on) that should be displayed if the condition is not satisfied.

Important: You must set all four parameters or else errors will occur during the build process.

When setting display conditions for a track, there is an additional checkbox named Apply to Stories. Select it to have the display condition apply to the stories associated with this track.

Setting Up a Display Condition

You need to set four parameters to create a display condition.

To set up a display condition
  1. Choose the element (menu, track, or story) to set up a display condition for.

  2. Do one of the following:

    • If you are setting up a menu: Click the Advanced tab in the Menu Inspector.
    • If you are setting up a track or story: Click the General tab in the Track or Story Inspector.
  3. Select the Display Condition checkbox.

  4. Choose the conditional element (the first parameter—defines what the condition is to be based on). For a list of conditional elements you can use, see Conditional Elements and States.

  5. Choose the conditional relationship (the second parameter—determines how the conditional element is to be compared with the conditional state, set in the next step). For a list of conditional relationships, see Conditional Relationships.

  6. Choose the conditional element’s state (the third parameter—defines the state that the conditional element is to be compared to). See Conditional Elements and States for the states you can choose for each element.

  7. Choose the Alternate Target element (the fourth parameter—defines what happens if the condition is not met).

To turn off the display condition, select the Display Condition checkbox to remove the checkmark.

Stories can have their own display conditions, or you can use the track’s settings by selecting Apply to Stories in the Track Inspector’s General tab.

Example: Setting a Video Configuration Display Condition

For this example, you have a project with two versions of a track; one has the buttons over video optimized for pan-scan and the other has them optimized for letterbox. This display condition will use the video configuration information (SPRM 14) to choose which version to play.

To configure a video configuration display condition for a track
  1. Choose the track containing the pan-scan optimized video.

  2. Click the General tab in the Track Inspector.

  3. Select the Display Condition checkbox.

  4. Choose Video Player Config from the conditional element pop-up menu.

  5. Choose = (equal) from the conditional relationship pop-up menu.

  6. Enter 256 as the conditional state.

    This is the value for SPRM 14 that indicates the DVD player is set for pan-scan. See SPRM 14: Player Video Configuration for more information.

  7. Choose the track, optimized for letterbox, that you want to use as the alternative to this track from the Alternate Target pop-up menu.

With this display condition, the video configuration of the DVD player is checked to see if it is set at pan-scan. If it is, the track plays. If not, the player jumps to the letterbox track and it is played.

Conditional Elements and States

The conditional elements are based on settings read from the System Parameter Register Memories (SPRMs) or the General Purpose Register Memories (GPRMs).

The conditional states are determined by the element. For example, the menu language element has all supported languages as the possible states. If the state is a numeric entry, you need to enter a decimal-based number (binary and hex numbers are not supported).

  • Menu Language: Use to set up a condition based on the DVD player’s menu language setting (SPRM 0). The states include all supported languages.
  • Audio Language: Use to set up a condition based on the DVD player’s audio language setting (SPRM 16). The states include all supported languages.
  • Subtitle Language: Use to set up a condition based on the DVD player’s subtitle language setting (SPRM 18). The states include all supported languages.
  • Audio Stream Number: Use to set up a condition based on the currently selected audio stream (SPRM 1). The states include audio stream numbers 1 through 8. “Not set” appears next to any streams that currently have no assets assigned.
  • Subtitle Stream Number: Use to set up a condition based on the currently selected subtitle stream (SPRM 2). The states include subtitle stream numbers 1 through 32. “Not set” appears next to any streams that currently have no subtitles assigned.
  • Player Aspect Ratio: Use to set up a condition based on the DVD player’s aspect ratio setting (4:3 or 16:9—bits 8 and 9 of SPRM 14). The states include 4:3, 16:9 Pan-Scan, 16:9 Letterbox, and 16:9 Pan-Scan and Letterbox.
  • Last Track Played: Use to set up a condition based on the most recently played track (SPRM 4). The states include all track numbers in the project.
  • Last Chapter Played: Use to set up a condition based on the most recently played chapter (SPRM 7). The states include all chapter marker numbers in the track.
  • Last Button Selected: Use to set up a condition based on the most recently selected button (SPRM 8). The states include numbers 1 through 36.
  • Player Region Code: Use to set up a condition based on the DVD player’s region setting (SPRM 20). The states include all eight regions.
  • Parental Level: Use to set up a condition based on the DVD player’s parental level setting (SPRM 13). The states include all eight parental levels plus a Not Rated setting.

    Important: DVD players will always set SPRM 13 to Not Rated when playing DVDs authored with DVD Studio Pro.

  • Video Player Config: Use to set up a condition based on the DVD player’s aspect ratio setting (4:3 or 16:9) and display mode (letterbox or pan-scan) (SPRM 14). The state requires a decimal number entry.
  • Audio Player Config: Use to set up a condition based on the DVD player’s audio configuration—PCM, AC-3, and MPEG (SPRM 15). The state requires a decimal number entry.
  • GPRM 0 - 7: Use to set up a condition based on the values stored in one of the eight GPRM locations. The values must first be placed into the GPRM by a separate script that you have run. The state requires a decimal number entry.

    Note: Display conditions can only use full 16-bit GPRMs.

See Scripting Overview for details on scripts, GPRMs, and SPRMs.

Conditional Relationships

There are seven conditional relationships for you to choose from when setting up your display condition.

Figure. Display Condition section of an element's Inspector showing the conditional relationships pop-up menu.
  • = (equal): The element and state are exactly equal. For example, if you choose the Player Region Code element, a state of 1-USA, and the “equal” relationship, you can only play the track if the DVD player is set for region 1-USA.
  • != (not equal): The element and state are not exactly equal. For example, if you choose the Audio Language element, a state of French, and the “not equal” relationship, you can play the track as long as the DVD player is not set for French.
  • > = (greater or equal): The element is either greater than the state, or they are equal. For example, if you choose the Parental Level element, a state of PG-13, and “greater or equal,” you can play the track as long as the DVD player is set to PG-13 or higher (R or NC-17).
  • > (greater): The element is greater than the state. For example, if you choose the Audio Stream Number element, a state of 2, and “greater,” you can play the track as long as one of the two first audio streams is not selected.
  • <= (smaller or equal): The element is either less than the state, or they are equal. For example, if you choose the Last Track Played element, set the state to 12, and “smaller or equal,” you can play this track as long as the previous track is from 1 to 12.
  • < (smaller): The element is less than the state. For example, if you choose the Subtitle Stream Number element, set the state to 4, and “smaller,” you can play this track as long as subtitle streams 1 through 3 are selected.
  • & (and): Provides a binary bit-wise “and” function. Several of the elements contain multiple settings. You can use the “and” relationship to extract one setting from the element. For example, if you choose the Audio Player Config element (which contains several settings related to the DVD player’s audio capabilities), a state of 2048-DTS, and the “and” relationship, you can only play the track if bit 11 of the 16-bit byte is one, indicating that the DVD player supports DTS audio. See Using Bit-Wise Operations for details on using a bit-wise “and” function.

Issues with Display Conditions

There are several issues with using display conditions that you should be aware of:

  • The Last Chapter Played setting is reliable only when assigned to menus: When using the Last Chapter Played setting for display conditions assigned to a track or story, you get unreliable playback on some DVD players. The Last Chapter Played setting can be used reliably with display conditions assigned to menus.
  • Display Conditions using the subtitle stream number only work with the subtitle stream set to View: When you configure a display condition for a track or story that uses the subtitle stream number option, the display condition works correctly only if the subtitle stream is set to be viewed. For example, if you configure a menu’s button to use subtitle stream S1 and a track has a display condition configured for subtitle stream S1, the display condition only works correctly if you also select the subtitle stream’s View checkbox in the Button Inspector.
  • Some DVD players do not allow parental level in display conditions: Some DVD players do not process the parental level option correctly when used in a display condition, allowing content to play that should be disallowed.

    Important: DVD players always set SPRM 13 to Not Rated when playing DVDs authored with DVD Studio Pro.