Platform SDK: DirectX

Performance Classes

[C++]

The information in this topic pertains only to applications written in Visual Basic. For C++ applications, see Overview of DirectMusic Objects and Interfaces.

[Visual Basic]

The DirectMusicPerformance class is at the heart of any DirectMusic application. Most applications have a single object of this class, which is responsible for managing timing and ports, changing global musical parameters such as the master tempo, and playing musical segments.

Each individual piece of music, such as a MIDI file or a segment authored in an application such as DirectMusic Producer, is represented by an object of the DirectMusicSegment class. Methods of this class can be used to set or retrieve musical parameters for the segment and to manage the DLS instruments associated with it. A special kind of DirectMusicSegment, the template, is used in run-time composition of playable segments.

When a DirectMusicSegment object is passed to DirectMusicPerformance.PlaySegment, the method returns an object of the DirectMusicSegmentState class that represents the playing instance of the segment. Methods of this object can be used to obtain information such as the time at which it started playing. The DirectMusicSegmentState is also passed to DirectMusicPerformance to determine whether the segment is currently playing or to stop playback.