Sets the playback position of a sample, MOD music, file stream, or CD channel.
BOOL WINAPI BASS_ChannelSetPosition( |
Parameters
handle | The channel handle... a HCHANNEL, HMUSIC, HSTREAM, or CDCHANNEL. | ||||||||
pos | The position, as follows.
|
Return value
If succesful, then TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.
Error codes
BASS_ERROR_HANDLE | handle is not a valid channel. |
BASS_ERROR_CDINIT | BASS_CDInit has not been successfully called. |
BASS_ERROR_POSITION | The requested position is illegal. |
BASS_ERROR_NOTFILE | The stream is not a file stream... it was not created by using BASS_StreamCreateFile. |
BASS_ERROR_UNKNOWN | Some other mystery problem! |
Remarks
Streams are usually encoded in blocks, so it will usually not be possible to seek to the exact byte position requested (positions are rounded down to the beginning of a block). The number of bytes per block can be retrieved with BASS_StreamGetBlockLength.
When changing the position of a MOD music, and the BASS_MUSIC_POSRESET flag is active on the channel, all notes that were playing before the position changed will be stopped. Otherwise, the notes will continue playing until they are stopped in the MOD music.
Example
To set the position of a MOD music to row 20 of order 10.
BASS_ChannelSetPosition(a_music,MAKELONG(10,20)); |
See also
BASS_ChannelGetPosition, BASS_ChannelIsActive, BASS_MusicGetLength, BASS_StreamGetLength