MODM_CACHEPATCHES

Sent to a MIDI output driver to request that it cache or uncache the specified patches. This allows internal synthesizer drivers to load the patches needed by a client application.

MMSYSERR_NOTENABLED

The driver failed to load or initialize.

MMSYSERR_NOTSUPPORTED

Function isn't supported.


dwParam1

Specifies a far pointer to a PATCHARRAY array indicating which patches should be cached or uncached.

dwParam2

The high-order word specifies which bank of patches the array is referring to. The low-order word specifies whether the patches should be cached or uncached according to one of the following flags:

MIDI_CACHE_ALL

All patches specified in the array should be cached. If the synthesizer cannot cache all the patches, it should cache none at all, clear the PATCHARRAY and return MMSYSERR_NOMEM.

MIDI_CACHE_BESTFIT

If the driver can cache all of the patches specified in the array, it should do so. Otherwise, it should cache as many as it can (selection of which patches to cache is at the discretion of the driver), alter the PATCHARRAY to reflect what it has actually cached, and return MMSYSERR_NOMEM.

MIDI_CACHE_QUERY

The PATCHARRAY should be changed to reflect which patches the driver actually has cached.

MIDI_UNCACHE

Patches specified in the array should be uncached and the PATCHARRAY should be cleared.


Only drivers for internal synthesizer devices can support patch caching. Drivers for MIDI output ports should return a MMSYSERR_NOTSUPPORTED error for this message. Support for patch caching is optional for internal synthesizer devices. When a driver receives a MODM_GETDEVCAPS message, it should indicate support for patch caching by setting or clearing the MIDICAPS_CACHE bit in the dwSupport field of the MIDIOUTCAPS data structure.