BASS_ChannelGetPosition

Retrieves the current position of a channel.

QWORD BASS_ChannelGetPosition(
    DWORD handle,
    DWORD mode
);

Parameters

handleThe channel handle... a HCHANNEL, HMUSIC, HSTREAM, or HRECORD.
modeHow to retrieve the position. One of the following, with optional flags.
BASS_POS_BYTEGet the position in bytes. This is the default if none is specified.
BASS_POS_RAWGet the raw position in bytes. This is a monotonic count (never goes backwards) that is unaffected by seeking/looping.
BASS_POS_MUSIC_ORDERGet the position in orders and rows... LOWORD = order, HIWORD = row * scaler (BASS_ATTRIB_MUSIC_PSCALER). (HMUSIC only)
BASS_POS_ENDGet the end position in bytes... 0 = normal end position.
BASS_POS_LOOPGet the loop start position in bytes.
BASS_POS_DECODEFlag: Get the decoding position, which may be ahead of the playback position due to buffering. This flag is unnecessary with decoding channels because the decoding position will always be given for them anyway, as they do not have playback buffers.
BASS_POS_DSPFlag: Get the DSP processing position, for use within a DSPPROC callback function.
Other modes may be supported by add-ons.

Return value

If successful, then the channel's position is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_HANDLEhandle is not a valid channel.
BASS_ERROR_NOTAVAILThe requested position is not available.
BASS_ERROR_UNKNOWNSome other mystery problem!

See also

BASS_ChannelBytes2Seconds, BASS_ChannelGetLength, BASS_ChannelIsActive, BASS_ChannelSetPosition, BASS_ChannelSetSync, BASS_StreamGetFilePosition