Microsoft DirectX 8.1 (C++) |
When you play a segment, parameters for that segment such as the audiopath, repetitions, and start point are stored in a segment state, represented by an IDirectMusicSegmentState8 interface. The parameters are valid only for that instance of the segment. Changes subsequently made to the segment by using methods of IDirectMusicSegment8 are reflected in new segment states created by calls to IDirectMusicPerformance8::PlaySegment or IDirectMusicPerformance8::PlaySegmentEx.
When different instances of a segment are being played on different audiopaths, you can use the segment state to retrieve a 3-D sound buffer or an effect, and make changes that apply only to that instance. For example, you might use the same engine sound for different cars in a race game, playing the sound for each car on its own audiopath. You can use either IDirectMusicAudioPath8::GetObjectInPath or IDirectMusicSegmentState8::GetObjectInPath to retrieve an IDirectSound3DBuffer8 interface from each audiopath, allowing you to set the 3-D parameters for each car individually.