Platform SDK: DirectX

IDirectMusicTrack

The IDirectMusicTrack interface represents a track object. Almost everything that has to do with the definition of a segment is stored in its tracks. The track mechanism allows segments to be infinitely extensible, and the segment does not need any knowledge of any of the music and audio technologies that it employs.

If you plan to install your own music playback mechanism in DirectMusic, you need to create a DirectMusicTrack object to represent it. Otherwise, the methods of this interface are typically not called directly from the application.

Note  When implementing methods of the IDirectMusicTrack interface, be sure not to hold onto references to objects passed in. For example, if IDirectMusicTrack::Init adds a reference to the IDirectMusicSegment interface that it receives as a parameter, ensure that this reference is released.

The IDirectMusicTrack interface has the following methods:

Initialization Init
Playback EndPlay
  InitPlay
Play
Notification AddNotificationType
  RemoveNotificationType
Parameters GetParam
  IsParamSupported
SetParam
Miscellaneous Clone

All COM interfaces inherit the IUnknown interface methods. This interface supports the following three methods:

IUnknown AddRef
  QueryInterface
Release

The DirectMusicTrack object also supports the IDirectMusicObject and IPersistStream interfaces for loading its data.

The following table shows which methods are supported by the standard track types. For a general description of the standard types, see Tracks.

Track IDirectMusicTrack
methods
IPersistStream
methods
Band (CLSID_DirectMusicBandTrack)
  AddNotificationType No IsDirty Yes
Clone Yes GetSizeMax No
EndPlay Yes Load Yes
GetParam No Save Yes
Init Yes    
InitPlay Yes
IsParamSupported Yes
Play Yes
SetParam Yes
RemoveNotificationType No
Chord (CLSID_DirectMusicChordTrack)
  AddNotificationType Yes IsDirty Yes
Clone Yes GetSizeMax No
EndPlay Yes Load Yes
GetParam Yes Save Yes
Init Yes    
InitPlay Yes
IsParamSupported Yes
Play Yes
SetParam Yes
RemoveNotificationType Yes
Chord map (CLSID_DirectMusicChordMapTrack)
  AddNotificationType No IsDirty No
Clone Yes GetSizeMax No
EndPlay Yes* Load Yes
GetParam Yes Save No
Init Yes*    
InitPlay Yes*
IsParamSupported Yes
Play Yes*
SetParam Yes
RemoveNotificationType No
Command (CLSID_DirectMusicCommandTrack)
  AddNotificationType Yes IsDirty Yes
Clone Yes GetSizeMax No
EndPlay Yes Load Yes
GetParam Yes Save Yes
Init Yes    
InitPlay Yes
IsParamSupported Yes
Play Yes
SetParam Yes
RemoveNotificationType Yes
Motif (CLSID_DirectMusicMotifTrack)
  AddNotificationType Yes IsDirty No
Clone Yes GetSizeMax No
EndPlay Yes Load No
GetParam No Save No
Init Yes    
InitPlay Yes
IsParamSupported Yes
Play Yes
SetParam Yes
RemoveNotificationType Yes
Mute (CLSID_DirectMusicMuteTrack)
  AddNotificationType No IsDirty Yes
Clone Yes GetSizeMax No
EndPlay Yes* Load Yes
GetParam Yes Save Yes
Init Yes*    
InitPlay Yes*
IsParamSupported Yes
Play Yes*
SetParam Yes
RemoveNotificationType No
Sequence (CLSID_DirectMusicSeqTrack)
  AddNotificationType No IsDirty No
Clone Yes GetSizeMax No
EndPlay Yes Load Yes
GetParam No Save No
Init Yes    
InitPlay Yes
IsParamSupported No
Play Yes
SetParam No
RemoveNotificationType No
Signpost (CLSID_DirectMusicSignPostTrack)
  AddNotificationType No IsDirty Yes
Clone Yes GetSizeMax No
EndPlay Yes* Load Yes
GetParam No Save Yes
Init Yes*    
InitPlay Yes*
IsParamSupported No
Play Yes*
SetParam No
RemoveNotificationType No
Style (CLSID_DirectMusicStyleTrack)
  AddNotificationType Yes IsDirty No
Clone Yes GetSizeMax No
EndPlay Yes Load Yes
GetParam Yes Save No
Init Yes    
InitPlay Yes
IsParamSupported Yes
Play Yes
SetParam Yes
RemoveNotificationType Yes
SysEx (CLSID_DirectMusicSysExTrack)
  AddNotificationType No IsDirty No
Clone Yes GetSizeMax No
EndPlay Yes Load Yes
GetParam No Save No
Init Yes    
InitPlay Yes
IsParamSupported No
Play Yes
SetParam No
RemoveNotificationType No
Tempo (CLSID_DirectMusicTempoTrack)
  AddNotificationType No IsDirty No
Clone Yes GetSizeMax No
EndPlay Yes Load Yes
GetParam Yes Save No
Init Yes    
InitPlay Yes
IsParamSupported Yes
Play Yes
SetParam Yes
RemoveNotificationType No
Time signature** (CLSID_DirectMusicTimeSigTrack)
  AddNotificationType Yes IsDirty No
Clone Yes GetSizeMax No
EndPlay Yes Load Yes
GetParam Yes Save No
Init Yes    
InitPlay Yes
IsParamSupported Yes
Play Yes
SetParam Yes
RemoveNotificationType Yes

Notes  

* The method returns a value other than E_NOTIMPL but does not do anything else.

** The time-signature track exists in imported MIDI files and DirectMusic Producer segments specifically created with one. In most cases, the style track implements the time-signature track's functionality, so it is not necessary for a segment that contains a style track to contain a time-signature track, as well.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dmusici.h.

See Also

Tracks, Setting and Retrieving Track Parameters