Setting and Retrieving Track Parameters

You set and retrieve track parameters by using the SetParam and GetParam methods of either the performance, the segment, or the track.When calling one of these methods on the performance or segment, you can identify the track by setting the dwGroupBits and dwIndex parameters. However, in most cases you can let DirectMusic find the appropriate track for you. For more information, see Identifying the Track.

In some cases you need to specify the time within the track at which the change is to take effect, or for which the parameter is to be retrieved. To see whether this value is used for a particular track parameter, see Track Parameter Types.

In the case of a few parameters, a call to SetParam simply turns a feature on or off, and no data is needed. When setting other parameters, however, you also need to supply a structure or variable containing the data. Only parameters with associated data can be retrieved, so when using GetParam you must always supply a pointer to an appropriate variable or structure to receive the data.

To determine whether a particular parameter is supported by a track, use the IDirectMusicTrack::IsParamSupported method and check for an S_OK result.

More information is given in the following topics: