DEMOGL_SoundSystemChannelScriptID2ChannelCodeID converts a channelID used in the script (a ChannelScriptID) to a ChannelCodeID
which is usable with the DemoGL API functions concerning sound channels. You can start a Sound Element, like a sample, a MOD/XM/S2M/IT
file or an MP3 file, in the script and the sound channel this element is played on can be given a name, the ChannelScriptID. This
ChannelScriptID is a friendly name for the ChannelCodeID which is used internally and which works faster. To interact with the channel
the element is playing on from code, like setting 3D position, volume etc, you need the ChannelCodeID of the channel. To convert the
ChannelScriptID into a ChannelCodeID you can use the ChannelCodeID with the DemoGL API functions concerning channels.
int
DEMOGL_SoundSystemChannelScriptID2ChannelCodeID(
const char *pszChannelScriptID
);
Parameters.
pszChannelScriptID
Pointer to a zero-terminated string which contains the ChannelScriptID to be converted.
Return values.
Returns the ChannelCodeID when the conversion was successful.
Returns DGL_SS_ERR_ILLEGALCHANNELID errorvalue when an error occurs.
Remarks.
You only need to convert the ChannelScriptID to the ChannelCodeID when you want to interact with channels of Sound Elements started
in the script. When you start a Sound Element from code, by using
DEMOGL_SoundSystemStartElement, the function returns
a ChannelCodeID automatically.