Migrating from Ports to Audiopaths
If you have written applications using versions of DirectMusic prior to DirectX 8.0, you will find that the recommended way of creating a route for audio output has changed. You can still use DirectMusic the old way, but in order to take advantage of features such as effects processing, individual control of segment states, and custom audiopath configurations in DirectMusic Producer segments, you must do things in a new way.
Important differences between the old and new models for audio output include the following:
- Applications no longer deal directly with ports. DirectMusic handles the creation of the port and the mapping of . The IDirectMusicPerformance8::Init, IDirectMusicPerformance8::AddPort, IDirectMusicPerformance8::AssignPChannel and IDirectMusicPerformance8::AssignPChannelBlock methods are not used in the audiopath model.
- To play sounds through a 3-D buffer, an application no longer needs to create the buffer explicitly and assign it to a port by using IDirectMusicPort8::SetDirectSound. The buffer is now created as part of the audiopath, and the application obtains access to it by using one of the GetObjectInPath methods.
- Deactivating an audiopath has a different effect than deactivating a port. When an port is deactivated, it no longer produces sound, but the performance can continue playing segments. When an audiopath is deactivated, all playback on that audiopath stops and any attempt to play a segment on it will fail.