BASS.NET API for the Un4seen BASS Audio LibraryBassMixBASS_Mixer_ChannelSetPosition Method (Int32, Int64, BASSMode)BASS.NET API for the Un4seen BASS Audio Library
Sets the playback position of a mixer source channel.

Namespace: Un4seen.Bass.AddOn.Mix
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.12.0
Syntax

[DllImportAttribute("bassmix.dll", CharSet = CharSet.Unicode)]
public static bool BASS_Mixer_ChannelSetPosition(
	int handle,
	long pos,
	BASSMode mode
)

Parameters

handle
Type: SystemInt32
The mixer source channel handle (which was add via BASS_Mixer_StreamAddChannel(Int32, Int32, BASSFlag) or BASS_Mixer_StreamAddChannelEx(Int32, Int32, BASSFlag, Int64, Int64)) beforehand).
pos
Type: SystemInt64
The position, in bytes. With MOD musics, the MakeLong(Int16, Int16)(order,row) method can be used to set the position in orders and rows instead of bytes.
mode
Type: Un4seen.BassBASSMode
BASS_POS_BYTEThe position is in bytes, which will be rounded down to the nearest sample boundary.
BASS_POS_MUSIC_ORDERThe position is in orders and rows... use MakeLong(Int16, Int16). (HMUSIC only).
BASS_MUSIC_POSRESETFlag: Stop all notes. This flag is applied automatically if it has been set on the channel, eg. via BASS_ChannelFlags(Int32, BASSFlag, BASSFlag). (HMUSIC).
BASS_MUSIC_POSRESETEXFlag: Stop all notes and reset bpm/etc. This flag is applied automatically if it has been set on the channel, eg. via BASS_ChannelFlags(Int32, BASSFlag, BASSFlag). (HMUSIC).
BASS_MIXER_NORAMPINFlag: Don't ramp-in the start after seeking. This flag is applied automatically if it has been set on the channel, eg. via BASS_ChannelFlags(Int32, BASSFlag, BASSFlag). (HMUSIC).
Other modes and flags may be supported by add-ons, see the documentation.

Return Value

Type: Boolean
If successful, then is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

This function works exactly like the standard BASS_ChannelSetPosition(Int32, Int64, BASSMode), except that it also resets things for the channel in the mixer, well as supporting the BASS_MIXER_NORAMPIN flag. See BASS_Mixer_ChannelGetPosition(Int32, BASSMode) for details.

For custom looping purposes (eg. in a mixtime SYNCPROC), the standard BASS_ChannelSetPosition(Int32, Int64, BASSMode) function should be used instead of this

The playback buffer of the mixer can be flushed by using pos = 0.

ERROR CODEDescription
BASS_ERROR_HANDLEThe channel is not plugged into a mixer.
BASS_ERROR_NOTFILEThe stream is not a file stream.
BASS_ERROR_POSITIONThe requested position is illegal.
BASS_ERROR_NOTAVAILThe download has not yet reached the requested position.
BASS_ERROR_UNKNOWNSome other mystery problem!

Examples

Sets the position of a source stream to 35seconds:
VB
BassMix.BASS_Mixer_ChannelSetPosition(streamA, Bass.BASS_ChannelSeconds2Bytes(streamA, 35.0));
BassMix.BASS_Mixer_ChannelSetPosition(streamA, Bass.BASS_ChannelSeconds2Bytes(streamA, 35.0));
Reset the playback buffer of the mixer:
VB
BassMix.BASS_Mixer_ChannelSetPosition(mixer, 0L)
BassMix.BASS_Mixer_ChannelSetPosition(mixer, 0L);
See Also

Reference