BASS_ChannelSetAttributeEx
Sets the value of a channel's attribute.
BOOL BASS_ChannelSetAttributeEx(
DWORD handle,
DWORD attrib,
void *value,
DWORD typesize
);
Parameters
handle | The channel handle... a HCHANNEL, HMUSIC, HSTREAM, or HRECORD.
|
attrib | The attribute to set the value of. One of the following.
Other attributes may be supported by add-ons.
|
value | Pointer to the new attribute data.
|
typesize | The type/size of the attribute data. This can be one of the following types, or the size in bytes if the type is undefined.
BASS_ATTRIBTYPE_FLOAT | 32-bit floating-point.
| BASS_ATTRIBTYPE_INT | 32-bit integer.
|
|
Return value
If successful, 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_ILLTYPE | The channel does not have the requested attribute.
|
BASS_ERROR_ILLPARAM | value or typesize is not valid.
|
BASS_ERROR_DENIED | The attribute is read-only.
|
some attributes may have additional error codes, see the documentation.
Remarks
Natively floating-point attributes can be set as integers and vice versa. A floating-point value (typesize=BASS_ATTRIBTYPE_FLOAT) used to set an integer attribute will be truncated (fractional part removed) and capped to integer range.
If the attribute is currently sliding from a BASS_ChannelSlideAttribute call then that will be stopped before applying the new value. BASS_SYNC_SLIDE syncs will be triggered by this.
Example
Set a channel's DSP chain volume priority to 20.
int priority = 20;
BASS_ChannelSetAttributeEx(handle, BASS_ATTRIB_VOLDSP_PRIORITY, &priority, BASS_ATTRIBTYPE_INT);
See also
BASS_ChannelGetAttributeEx, BASS_ChannelSetAttribute