Certain types of objects, such as DirectMusicCollection and DirectMusicStyle, have to be loaded (typically from a file) before they can be incorporated into a music performance. Others, such as DirectMusicSegment, may be either loaded or constructed on the fly. The interfaces introduced in this section are essential for loading.
The DirectMusicLoader object, through its IDirectMusicLoader interface, manages the enumeration, caching, and loading of objects.
Data being read from a file or resource is represented by a stream object. Most applications do not have to deal directly with streams, which are created and managed by the loader. The stream object implements the following two interfaces:
For a closer look at the use of these interfaces in the loading process, see DirectMusic Loader.
Every object in DirectMusic that represents a file or resource supports the IDirectMusicObject interface, which is used as a generic pointer by the loader. When an application has obtained a pointer to this interface, the IDirectMusicObject::QueryInterface method can be used to obtain a pointer to the object's own unique interface, such as IDirectMusicCollection or IDirectMusicStyle. However, you will usually obtain the interface you need from the call to IDirectMusicLoader::GetObject.
The methods of IDirectMusicObject are used internally by the loader for identifying objects.