Platform SDK: DirectX |
The information in this topic pertains only to applications written in C++. See Overview of DirectMusic Classes.
The following objects and interfaces are used in the playback of musical data. With a total of over 75 methods, the interfaces in this group play a major role in any DirectMusic application.
The DirectMusicPerformance object is the overall manager of music playback. Through the IDirectMusicPerformance interface, it adds and removes ports, downloads instruments, attaches graphs (collections of tools), manages event notification for multiple segments, and plays segments.
A DirectMusicSegment object represents a chunk of data, most often a piece of music, contained in one or more tracks. Typically, a segment is either loaded from a file or created at run time by a DirectMusicComposer object. To play the segment, the application passes the IDirectMusicSegment interface pointer to the IDirectMusicPerformance::PlaySegment method.
Methods of the IDirectMusicSegment interface are used to manage timing and looping, event notification, tracks, tool graphs, and various other parameters of the segment.
An instance of a segment that is playing is represented by another interface, IDirectMusicSegmentState. Methods of this interface return information about the state of playback, and a pointer to this interface is used by the performance to stop or remove the segment instance.
A chunk of timed data of a particular kind is represented by a DirectMusicTrack object, more simply referred to as a track. Methods of the IDirectMusicTrack interface can be used to set and retrieve data, play the data, and set notifications. Most applications do not use this interface directly because tracks are normally handled through the methods of the DirectMusicSegment object that contains them.
Note A DirectMusicTrack is not the same thing as an instrument track. A DirectMusicTrack represents any kind of timed data, such as MIDI messages, a chord progression, or band changes.