Share via


Script Track

Windows Media Encoder SDK banner art

The script track contains calls to routines in Scripts. Scripts work directly with the Microsoft DirectMusic DLLs to control playback of performances, including playback of the segment containing the script, and other segments named within the scripts.

Before you can insert a script in the script track, you must use Script Designer to create a script containing at least one routine. For example, the script shown in the following figure contains two very simple routines/procedures:

  • SetMasterTempo50

    Uses the Performance.SetMasterTempo method to set the tempo of the segment to 50 percent of its original state.

  • ResetMasterTempo100

    Uses the SetMasterTempo method to set the tempo back to its original state.

    Routines in Script Editor

The following figure shows a segment with the SetMasterTempo50 routine in measure 2, and the ResetMasterTempo100 routine in measure 4.

If a routine in a script track plays a new primary segment by calling Segment.Play without the IsSecondary or IsControlling flags, that segment becomes the primary segment. This means that the current primary segment will stop, and script routines that had not yet been reached in it will not be run.

When you enter a script routine call in the script track, you must select a script and routine in the Script Routine Properties window. Until you do, the reference in the script track is displayed as <None> and has no effect.

For general information on entering and editing data in a track, see the following topics: