DemoGL::Reference::Functions::DEMOGL_SoundSystemPauseChannel

DEMOGL_SoundSystemSeekInChannel

DEMOGL_SoundSystemSeekInChannel moves the current position of a given channel in its sounddata to a new position and continues play from there.

int
DEMOGL_SoundSystemSeekInChannel(
	const int iChannelCodeID,
	const long lStartPos
);
	
Parameters.
iChannelCodeID
Specifies the ChannelCodeID of the channel which should be paused.
lStartPos
Specifies the new position where to restart the play from. For channels playing DGL_SS_SAMPLEELEMENT sound elements, lStartPos is a position in bytes. For channels playing DGL_SS_MP3ELEMENT sound elements, lStartPos is a new position in milliseconds from the start. For channels playing DGL_SS_MODELEMENT sound elements, lStartPos is a new value calculated using the macro MAKELONG: MAKELONG(order,row). This will result in a longword with LOWORD=order in the music module and HIWORD=row in that pattern.

Return values.
If the function succeeds, it returns SYS_OK.
If the function fails, it returns one of the following error codes:

Error code Description
DGL_SS_ERR_CHANNELACTIONFAILED The underlying sound library reported an error while processing the seek. Probably the lStartPos parameter is not a valid value.
DGL_SS_ERR_CHANNELNOTINUSE The iChannelCodeID value is not found as an active channel.
DGL_SS_ERR_ILLEGALELEMENTTYPE The channel specified is playing data belonging to an element of an unknown type. This is caused by an implementation error. Should not happen.

Remarks.
When lStartPos is set to a value beyond the scope of the data of the sound element, an error occures. Seeking in a DGL_SS_MP3ELEMENT sound element will not be that accurate because MP3's work with frames and seeking can only be done by frames, so the best matching frame is chosen as starting point internally.

Example.

Requirements.
DemoGL v1.3 (build 0112 or higher)

See also.
DEMOGL_SoundSystemChannelScriptID2ChannelCodeID, _SOUNDSYSTEM commands

Last changed on 18-jan-2001

©1999-2001 Solutions Design