BASS_ChannelSlideAttribute

Slides a channel's attribute from its current value to a new value.

BOOL BASS_ChannelSlideAttribute(
    DWORD handle,
    DWORD attrib,
    float value,
    DWORD time
);

Parameters

handleThe channel handle... a HCHANNEL, HSTREAM, HMUSIC, or HRECORD.
attribThe attribute to slide the value of. One of the following, with optional flags.
BASS_ATTRIB_FREQSample rate.
BASS_ATTRIB_MUSIC_AMPLIFYAmplification level. (HMUSIC only)
BASS_ATTRIB_MUSIC_BPMBPM. (HMUSIC)
BASS_ATTRIB_MUSIC_PANSEPPan separation level. (HMUSIC)
BASS_ATTRIB_MUSIC_PSCALERPosition scaler. (HMUSIC)
BASS_ATTRIB_MUSIC_SPEEDSpeed. (HMUSIC)
BASS_ATTRIB_MUSIC_VOL_CHANA channel volume level. (HMUSIC)
BASS_ATTRIB_MUSIC_VOL_GLOBALGlobal volume level. (HMUSIC)
BASS_ATTRIB_MUSIC_VOL_INSTAn instrument/sample volume level. (HMUSIC)
BASS_ATTRIB_PANPanning/balance position.
BASS_ATTRIB_VOLVolume level.
BASS_SLIDE_LOGFlag: Slide the attribute's value logarithmically rather than linearly. This cannot be used when going from positive to negative or vice versa. An exception is when using a negative value with BASS_ATTRIB_VOL to fade-out and stop.
other attributes may be supported by add-ons, see the documentation.
valueThe new attribute value. See the attribute's documentation for details on the possible values.
timeThe length of time (in milliseconds) that it should take for the attribute to reach the value.

Return value

If successful, then TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_HANDLEhandle is not a valid channel.
BASS_ERROR_ILLTYPEattrib is not valid.
BASS_ERROR_ILLPARAMThe attribute's value cannot go from positive to negative or vice versa when the BASS_SLIDE_LOG flag is used.
some attributes may have additional error codes, see the documentation.

Remarks

This function is similar to BASS_ChannelSetAttribute, except that the attribute is ramped to the value over the specified period of time. Another difference is that the value is not pre-checked. If it is invalid, the slide will simply end early.

If an attribute is already sliding, then the old slide is stopped and replaced by the new one.

BASS_ChannelIsSliding can be used to check if an attribute is currently sliding. A BASS_SYNC_SLIDE sync can also be set via BASS_ChannelSetSync, to be triggered at the end of a slide. The sync will not be triggered in the case of an existing slide being replaced by a new one.

Attribute slides are unaffected by whether the channel is playing, paused or stopped; they carry on regardless.

Example

Fadeout a channel's volume over a period of 1 second.
BASS_ChannelSlideAttribute(channel, BASS_ATTRIB_VOL, 0, 1000);

Fadeout a channel's volume logarithmically over a period of 2 seconds.

BASS_ChannelSlideAttribute(channel, BASS_ATTRIB_VOL | BASS_SLIDE_LOG, 0, 2000);

See also

BASS_ChannelGetAttribute, BASS_ChannelIsSliding, BASS_ChannelSetAttribute, BASS_ChannelSetSync