Microsoft DirectX 9.0 SDK Update (Summer 2004) |
Automatically Downloading Bands
When automatic downloading is on, the instruments in the band are downloaded when the segment containing the band is cued. The instruments are automatically unloaded when the segment is stopped, unless another segment using the same instruments is cued to play immediately or is currently playing.
Automatic downloading should be used only when the timing of segment starts is not critical. Repeated loading and unloading of instruments is time-consuming and can cause serious degradation of performance in complex audio environments.
Automatic unloading, which is part of the automatic downloading mechanism, can also lead to undesired results. For example, suppose you play a short secondary segment that changes the instrument on a channel. The instrument is automatically downloaded when the secondary segment starts, replacing the existing instrument. When the secondary segment ends, the instrument is automatically unloaded, with the result that there is no instrument on that channel, and the channel plays silence.
You can turn on automatic downloading of bands in one of the following ways:
- Call the IDirectMusicPerformance8::SetGlobalParam method for the GUID_PerfAutoDownload parameter.
- Enable automatic downloading for a single segment by calling the IDirectMusicSegment8::SetParam method for the GUID_Enable_Auto_Download parameter.
In the following example function, the global parameter for the performance is set to enable automatic downloading of bands in all segments:
HRESULT TurnOnDownload(IDirectMusicPerformance8* pPerf)
{
BOOL fAuto = TRUE;
HRESULT hr = pPerf->SetGlobalParam(
GUID_PerfAutoDownload, &fAuto, sizeof(BOOL));
return hr;
}
See Also
© 2004 Microsoft Corporation. All rights reserved.