Microsoft DirectX 8.1 (C++)

IDirectMusicLoader8

The IDirectMusicLoader8 interface is used for finding, enumerating, caching, and loading objects. For an overview, see Loading Audio Data.

This interface supersedes IDirectMusicLoader and adds support for garbage collection.

In addition to the methods inherited from IUnknown, the IDirectMusicLoader8 interface exposes the following methods.

Cache and memory management

Method Description
CacheObject Creates a reference to an object for later use.
ClearCache Removes all saved references to a specified object type.
CollectGarbage Removes from the cache objects that are no longer in use.
EnableCache Enables or disables automatic caching of all objects loaded.
ReleaseObject Releases the loader's reference to the object.
ReleaseObjectByUnknown Releases the loader's reference to the object.

Finding objects

Method Description
EnumObject Enumerates all available objects of the requested type.
ScanDirectory Searches a directory or disk for all files of a requested class type and file name extension.
SetSearchDirectory Sets a search path for finding object files.
SetObject Tells the loader where to find an object when it is later referenced by another object being loaded, and adds attributes to an object so that it can be referred to by those attributes.

Loading objects

Method Description
GetObject Retrieves the specified object from a file or resource and returns the desired interface.
LoadObjectFromFile Retrieves the specified object from a file and returns the desired interface.

The LPDMUS_LOADER type is defined as a pointer to the IDirectMusicLoader interface.

typedef IDirectMusicLoader __RPC_FAR *LPDMUS_LOADER;

The following table lists the standard types of loadable objects, together with their class identifiers (the rguidClass parameter of various methods that deal with objects) and the usual file name extension.

Object type Class Extension
Audiopath CLSID_DirectMusicAudioPathConfig aud
Band CLSID_DirectMusicBand bnd
Container CLSID_DirectMusicContainer con
DLS collection CLSID_DirectMusicCollection dls
Chordmap CLSID_DirectMusicChordMap cdm
Segment CLSID_DirectMusicSegment sgt
Script CLSID_DirectMusicScript spt
Song* CLSID_DirectMusicSong sng
Style CLSID_DirectMusicStyle sty
Template CLSID_DirectMusicSegment tpl
Toolgraph CLSID_DirectMusicGraph tgr
Wave CLSID_DirectSoundWave wav

* Not implemented in DirectX 8.1.

Requirements

  Header: Declared in dmusici.h.