Академический Документы
Профессиональный Документы
Культура Документы
14-2
Chapter 14
Using Command Sequences
(for Advanced Users)
Command Sequences are not available in the standard version of DVDConductor. They
may be added by installing the DVDPowerPack upgrade.
At Spruce Technologies, weve gone to great lengths to keep DVDMaestro and
DVDConductor as user-friendly as possible, by shielding you from many of the complexities of the DVD-Video Specification. As a result, your Spruce authoring software gives you
the tools you need to create Hollywood-calibre titles quickly and easily without having
to be a programming expert. Indeed, many users will choose to skip this chapter, and will
still be able to create impressive titles using all of their Spruce authoring softwares other
features.
If youre a relatively advanced user, however, you may wish to take advantage of some of
your Spruce authoring softwares more esoteric capabilities, by using the Command
Sequence features built into DVDMaestro and DVDPowerPack-enhanced versions of
DVDConductor. As well learn, these features allow you to insert certain codes or Command Sequences into your titles that can communicate directly with a DVD players
native machine code letting you create highly complex and interactive titles that can be
well worth the effort.
14
Chapter 14: Using Command Sequences
14-3
Command Sequences appear in the Project Manager as a separate icon, similar to DVD
Movies and DVD Menus. You have the option to include dedicated Command Sequences
to accomplish functions not provided for directly in the Spruce authoring software interface.
Right-click on the Command Sequences folder in the Project window to create a new Command Sequence.
Command Sequences appear as targets in the Connections window. Using the Connections window, you can connect any source (e.g., First Play, Remote Key Action, Button
Action, etc.) to a Command Sequence.
Several Command Sequences shown in place in the Project Manager (left) and the Connections window.
When this occurs, the Command Sequence will execute whatever sequence of events
youve written. Once finished, title playback will return to a DVD Movie, a DVD Menu, or
another Command Sequence.
14-4
A sample Project, showing a DVD Menu that has button highlight areas that connect to three different DVD Movies.
Ordinarily, we assume the DVD player will be attended by a salesperson. But for those
times when the salesperson is not on hand, wed like the DVD player to cycle through the
three DVD Movies automatically, in a loop fashion so that nearby potential customers
will still be able to see product information.
To implement this, we could set a Timeout for the DVD Menu, such as 1 minute. This
way, if the salesperson does not make a selection within a minute, the DVD player will
execute a timeout jump, which could be linked to a Command Sequence such as this one:
14
14-5
The individual commands, as shown in the Command List section of the Command Sequence Editor (described below).
Here, the Command Sequence is scripted so that the automatic playback order of the DVD
Movies will rotate. (Well review how to enter these commands and how to view them in
the next section).
As shown below, this Command Sequence appears in the Project Manager as an icon in
the Command Sequences folder, labeled ROTATEMOVIES. It also appears in the Connections
window as the target for the source labeled MAINMENU TIMEOUT.
The Project Manager and Connections window, showing the Command Sequence in place.
14-6
As shown two screenshots above, this Command Sequence uses a memory location called
GPRM0. A GPRM is a scratch memory location available in every DVD player, which
can be used by a Command Sequence. (Well look much closer at GPRMs later in this
chapter.) Once a Command Sequence has been stored into a GPRM, it can be read later
by any other Command Sequence.
Looking at the Command Sequence instructions in the example pictured above, we can
see that each time the DVD player enters this script, the scratch memory GPRM0 is
incremented. Then the new value in GPRM0 is tested, and if is equal to or greater than
3, it is reset to 0. In this way, GPRM0 acts as a simple counter that ticks off 0, 1, 2, 0,
1, 2, 0, 1, 2 and so on.
The next three commands test the value in GPRM0 and jump to one of the three DVD Movies
available. So each time the Command Sequence is executed, it selects one of the three DVD
Movies (SOUNDTRACK #1, SOUNDTRACK #2, OR SOUNDTRACK #3). When each DVD Movie completes,
it returns to the DVD Menu (MAINMENU). If no one actuates one of the DVD Menus button
highlight areas within the Timeout period, the DVD player jumps back into the Command
Sequence, which initiates playback of the next DVD Movie, and so on.
14
The Advanced section of the Navigation Simulator offers you a way to view the increments of GPRM0.
14-7
To see this in action, you can start up the Navigation Simulator and observe the increments of GRPM0 in the Advanced area, as shown on the previous page.
Though this is a very simple example, it shows how easy scripts written in machine code
native to DVD players can be used to create titles with very advanced functions and
interactivity.
1. By default, each Project has a Command Sequences folder in the Project Manager.
Right-click on the folders icon and (from the pop-up context menu) select ADD NEW
COMMAND SEQUENCE.
2. A Command Sequence will appear in the folder labeled SEQUENCE1 by default.
3. Double-click on the Command Sequence. The Command Sequence Editor will open.
14-8
The Command Sequence Editor, before any commands have been added.
DVDMaestro and DVDConductor with the DVDPowerPack option is a complete environment for creating and
managing Command Sequences.
1. With the Command Sequence Editor open, click on the Add button (or press the
Insert key on your keyboard).
2. A command will appear in the first line of the Command List. Initially it will read
NOP, or which stands for No Operation. To perform any meaningful work, at least
one command other than NOP is required.
3. With the command selected (it will be highlighted in blue), elect one of the Command Type buttons (NOP, Set GPRM, etc.) at the top of the screen. This will set the
Command Type for the current command.
14
Chapter 14: Using Command Sequences
14-9
DVD machine commands are defined by a general Command Type, a specific selection of command within the
type, and a set of parameters.
As you choose any one of the eight different Command Types, youll notice that many of
the other settings in the Command Sequence Editor will change. Well review the Command Types and their related settings later in this chapter.
1. With the Command Sequence Editor open, click once on the command (in the
Command List) you wish to affect. It will appear highlighted in blue.
2. To modify the command, make any possible changes using the Command Sequence
Editor. The changes will be reflected immediately.
or
2. To delete the command, click the DELETE button or press the Delete key on your
keyboard.
or
2. To reorder the command within the Command Sequence, click MOVE TO TOP, MOVE UP,
MOVE DOWN, or MOVE TO BOTTOM.
14-10
Note: There is no undo function for any changes you make to a Command Sequence.
However, you can revert to the previous version of the Command Sequence by clicking
CANCEL in the Command Sequence Editor, rather than OK.
1. Double-click on its icon (within the Command Sequences folder in the Project
Manager).
or
Right-click on its icon (within the Command Sequences folder in the Project Manager) and select EDIT COMMAND SEQUENCE from the pop-up context menu.
2. The Command Sequence Editor will appear, where you can make changes as
necessary.
Note: Be sure to open the Command Sequence Editor using a new Command Sequence
in the Project Manager; otherwise, whatever Command Sequence you load will overwrite whatever commands you may have in the current Command Sequence.
14
14-11
2. A dialog will open, where you can browse to find the desired Command Sequence.
3. Click OPEN. The selected Command Sequence will appear in the Command Sequence
Editor.
4. If you wish to save this newly loaded Command Sequence as part of your current
Project, without any further changes at this time, click OK in the Command Sequence
Editor.
5. If you wish to edit the Command Sequence before saving it as part of the current
Project, first make whatever changes you wish, then click OK in the Command
Sequence Editor.
You can easily rename, delete, and duplicate any Command Sequence.
To rename, delete, or duplicate a Command Sequence:
14-12
initial deliberateness and caution since it is very easy to author titles with Command
Sequences that just dont work. Of course, as with all of your titles, you should use the
Navigation Simulator and test compilations of the Project using DVDPlayer to verify that
your title is playing back exactly as intended.
14
Chapter 14: Using Command Sequences
14-13
14-14
SPRM 0
SPRM 1
SPRM 2
SPRM 3
SPRM 4
SPRM 5
SPRM 6
SPRM 7
SPRM 8
SPRM 9
SPRM 10
SPRM 11
SPRM 12
SPRM 13
SPRM 14
SPRM 15
SPRM 16
SPRM 17
SPRM 18
SPRM 19
These system control registers provide all the status information and control capability to
the Command Sequences.
Output Statements
Command Sequences can affect a discs playback in one of two ways:
playback can jump to a new location (either a DVD Movie or DVD Menu);
a different audio stream, subtitle stream, or video (camera angle) can be selected.
These are the only output statements available.
Conditional instruction execution is where the DVD player processor tests a condition
(compare equals, not equals, etc.) between a GPRM, or between a GPRM and an SPRM, or
between a memory location and an immediate value. The command is executed or not
executed according to the result.
14
Chapter 14: Using Command Sequences
14-15
The middle pull-down field lets you set the type of comparison.
For example, in the case above, weve chosen EQUAL, which means the command in question is
executed if, and only if, the condition defined by the comparison is true. In this case, the
affected command would always execute, as GPRM0 will always be equal to itself.
The available comparison operations for conditional execution are:
Bitwise AND
Equal
Not Equal
Greater Than or Equal To (>=)
Greater Than (>)
Less Than or Equal To (<=)
Less Than (<)
The lists of GPRMs, SPRMs, and immediate values are the same as for the command
source fields.
Command Types
By choosing the Command Type, you can set whether a particular command will read and
write memory; jump to a new play location; read the status of the player: set audio/
subtitle/video (angle) streams; and control execution of the Command Sequence.
14-16
14
Chapter 14: Using Command Sequences
14-17
These fields will appear in the Command Sequences Editor once you select SET GPRM as the Command Type.
Selecting the Operation Type command functions for the Set GPRM Command Type.
Each of these operations takes one or two arguments and the result of the operation is
always stored into one of the eight available GPRM registers.
14-18
For single-argument commands such as Move or Random, the required argument may be
supplied from a GPRM register, one of the SPRM player control registers, or from an immediate value supplied by the programmer.
For commands that require two arguments, such as Add, the other argument is provided by
the same GPRM is which the result is stored.
The GPRM registers are 16 bits wide. For immediate values, a number between 0 and
65535 can be entered. The individual command functions are described on the next page.
14
14-19
Move the value in a source GPRM, SPRM, or immediate value is moved into the
GPRM destination register.
Swap the value in a source GPRM is exchanged with the contents of the GPRM
destination register. This is the only command that can write two locations at once.
Add the value in a source GRPM or an immediate value is added to and replaces
the contents of the destination SPRM.
Subtract the value in a source GRPM or an immediate value is subtracted from
and replaces the contents of the destination SPRM.
Multiply the value in a source GRPM or an immediate value is multiplied by and
replaces the contents of the destination SPRM.
Divide the value in a source GRPM or an immediate value is divided by and
replaces the contents of the destination SPRM.
Random a random number is generated whose range is determined by a source
GPRM or an immediate value. This value replaces the contents of the destination GPRM.
Bitwise AND the 16 individual bits of a source GPRM, SPRM, or immediate value
are compared with the corresponding bits in the destination GPRM. The bits that are
set (value 1) in both the source and destination register are left set. Bits that are not
set on one or the other register are reset (value 0).
Bitwise OR the 16 individual bits of a source GPRM, SPRM, or immediate value
are compared with the corresponding bits in the destination GPRM. The bits that are
set (value 1) in either the source and destination register are left set.
Exclusive OR the 16 individual bits of a source GPRM, SPRM, or immediate value
are compared with the corresponding bits in the destination GPRM. The bits that are
set (value 1) in one or the other (but not both) the source and destination register are
set. Bits that are set in neither or both of the registers are reset (value 0).
Jump
Command Sequences are usually terminated by a Jump or Resume command. The Jump
command starts play of the disc at a designated location.
The destinations of Jump commands can be a DVD Movie, a chapter within a DVD Movie,
a DVD Menu (with or without setting a button highlight), or a Command Sequence.
14-20
Setting the jump target and conditional instruction execution for the Jump Command Type.
In the case of DVD Movies, the selection of chapter can be optionally controlled by a
GPRM register. The same option is available for button selection DVD Menu targets.
Goto
Goto is used to control the execution of program by jumping execution from the current
line to a defined line number. Usually, a goto command is combined with a conditional
execution test to provide decision-making capability in the sequence.
Setting the line number and conditional instruction execution for a Goto Command Type.
14
14-21
The optional test for conditional execution is defined as for other command types. The
defined goto will take place only if the defined condition is satisfied.
Set GPRM Mode
This Command Type not to be confused with the Set GPRM Command Type, described above sets the memory or time mode.
14-22
As with other Command Types, an optional conditional execution test can be performed.
In that case, the Set System Stream command will be executed if and only if the defined
condition is satisfied.
14
Chapter 14: Using Command Sequences
14-23
In this more elaborate sample Project, the DVD Menus button highlight areas now select which audio track of a
single DVD Movie will be used as the active audio stream.
14-24
In this case, weve replaced the three DVD Movies with a single DVD Movie that has three
alternate audio tracks, any one of which can selected to be the active audio stream. The
action that we wish to achieve is as follows.
Program starts with the main DVD Menu (MAINMENU), which allows direct selection of
the audio stream.
If the DVD Menu timeout period is exceeded, then the viewer will see the button
highlight areas in rotating order, at an interval of one second.
After a random number of steps through the button highlight rotation, the movement
will stop and execute play of the DVD Movie, while randomly selecting which of the
three available audio tracks will be the active audio stream.
The desired action is realized by using two different Command Sequences. The first
Command Sequence, which well call SETLOOP, simply initializes values for use by the
second and is called whenever we wish to jump to the DVD Menu whether at First
Play, the end of a DVD Movie, a Menu Key action, or whatever.
The SetLoop Command Sequence reads as follows:
The SetLoop Command Sequence, as it appears in the Command List of the Command Sequences Editor.
The first two commands in the Command List insert values of 0 in GPRM0 and GRPM1.
These two memory locations will serve as the two loop counters that define the short
loop around the three button highlight areas and the longer count to select the random
exit.
The third command in the Command List generates a random number, whose limit is
specified as 10. Thus, a number between 1 and 10 will be stored in GPRM2. This will be
used to test whether we have incremented enough times.
The last command in the sequence jumps to MAINMENU.
14
Chapter 14: Using Command Sequences
14-25
This screenshot shows the DVD Menus Playback Control tab, which is where the Timeout value is set.
Within the Playback Control tab of mainmenu, weve set a timeout value of 20 seconds. If
none of the DVD Menu button highlight areas are activated within that time, a Timeout
connection to the second Command Sequence, called ANIMATEMENU, is executed. The
instructions in that Command Sequence are as follows:
The AnimateMenu Command Sequence, as it appears in the Command List of the Command Sequences Editor.
As you can see above, the first command in this Command Sequence increments GPRM0,
which serves as the counter for the short loop. The next command tests the value. If it
has reached as high as 4, then the value 1 is placed in the register. Thus, a value of
less than one is never seen by the rest of the program.
The third command increments PGRM1, which serves as the randomly determined count
that decides when we are finished incrementing and ready to play the DVD Movie.
The fourth command tests GPRM1 to see if it has reached the value of the random number
stored in GRPM2 by SetLoop. If so, then program execution jumps to Line 6, which is the
play DVD Movie sequence.
14-26
The Connections window, showing all the current navigational connections for the Project, including the SetLoop
and AnimateMenu Command Sequences.
If the condition GPRM1 equal to GPRM2 is not satisfied, then the program jumps
immediately to AnimateMenu, with its button highlight areas determined by the value in
GPRM0. AnimateMenu is an exact copy of mainmenu, except that its Timeout is set to one
second instead of 20 seconds. The Timeout of AnimateMenu also connects to
AnimateMenu. So when the loop starts, the DVD player will return once per second to this
sequence until the condition of GPRM1 equal to GPRM2 is satisfied.
14
Chapter 14: Using Command Sequences
14-27
When the incrementing count of GPRM1 is found to reach the randomized value in
GPRM2, then the command at Line 6 sets the audio stream according to the value in
GPRM0. The next two commands reinitialize the two loop counters (which is redundant,
as SetLoop does this), and the last command jumps out to play the DVD Movie with the
selected audio track.
14-28