Platform SDK: DirectX

Loader Objects and Interfaces

[Visual Basic]

The information in this topic pertains only to applications written in C++. See Overview of DirectMusic Classes.

[C++]

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, can be either loaded or constructed at run time. The interfaces introduced in this section are essential for loading.

Loader

The DirectMusicLoader object, through its IDirectMusicLoader interface, manages the enumeration, caching, and loading of objects.

Stream

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.

Object

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 can usually obtain the interface that you need from the call to IDirectMusicLoader::GetObject.

The methods of IDirectMusicObject are used internally by the loader for identifying objects.