BASS_Mixer_ChannelSetPosition
Sets the playback position of a mixer source channel.
BOOL BASS_Mixer_ChannelSetPosition(
DWORD handle,
QWORD pos,
DWORD mode
);
Parameters
handle | The channel handle.
|
pos | The position, in units determined by the mode.
|
mode | How to set the position. One of the following, with optional flags.
BASS_POS_BYTE | The position is in bytes, which will be rounded down to the nearest sample boundary.
| BASS_POS_MUSIC_ORDER | The position is in orders and rows... use MAKELONG(order,row). (HMUSIC only)
| BASS_POS_DECODETO | Flag: Decode/render up to the position rather than seeking to it. This is useful for streams that are unseekable or that have inexact seeking, but it is generally slower than normal seeking and the requested position cannot be behind the current decoding position. This flag can only be used with the BASS_POS_BYTE mode.
| BASS_MUSIC_POSRESET | Flag: Stop all notes. This flag is applied automatically if it has been set on the channel, eg. via BASS_ChannelFlags. (HMUSIC)
| BASS_MUSIC_POSRESETEX | Flag: Stop all notes and reset bpm/etc. This flag is applied automatically if it has been set on the channel, eg. via BASS_ChannelFlags. (HMUSIC)
| BASS_MIXER_NORAMPIN | Flag: Do not ramp-in the start after seeking. This flag is applied automatically if it has been set on the channel, eg. via BASS_Mixer_ChannelFlags.
| BASS_POS_MIXER_RESET | Flag: Flush the mixer's playback buffer, so that the new position is heard immediately in the mixer output. This generally should not be used when the mixer is playing multiple sources, as it will cause a skip in the sound of the other sources. This flag has no effect if the mixer has the BASS_STREAM_DECODE flag set, as the mixer does not have a playback buffer then.
|
other modes & flags may be supported by add-ons, see the documentation.
|
Return value
If successful, then TRUE is returned, else FALSE is returned. Use
BASS_ErrorGetCode to get the error code.
Error codes
BASS_ERROR_HANDLE | handle is not plugged into a mixer.
|
BASS_ERROR_NOTFILE | The stream is not a file stream.
|
BASS_ERROR_POSITION | The requested position is invalid, eg. it is beyond the end or the download has not yet reached it.
|
BASS_ERROR_NOTAVAIL | The requested mode is not available. Invalid flags are ignored and do not result in this error.
|
BASS_ERROR_UNKNOWN | Some other mystery problem!
|
Remarks
This function works exactly like the standard
BASS_ChannelSetPosition, except that it also resets things for the channel in the mixer, as well as supporting the BASS_MIXER_NORAMPIN and BASS_POS_MIXER_RESET flags.
For custom looping purposes (eg. in a mixtime SYNCPROC), the standard BASS_ChannelSetPosition function should be used instead of this.
See also
BASS_Mixer_ChannelGetPosition
BASS_ChannelSetPosition