BASS_ChannelFlags
Modifies and retrieves a channel's flags.
DWORD BASS_ChannelFlags( DWORD handle, DWORD flags, DWORD mask );
Parameters
handle | The channel handle... a HCHANNEL, HMUSIC, HSTREAM. | ||||||||||||||||||||||||||||||||
flags | A combination of these flags.
| ||||||||||||||||||||||||||||||||
mask | The flags (as above) to modify. Flags that are not included in this are left as they are, so it can be set to 0 in order to just retrieve the current flags. To modify the speaker flags, any of the BASS_SPEAKER_xxx flags can be used in the mask (no need to include all of them). |
Return value
If successful, the channel's updated flags are returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.Error codes
BASS_ERROR_HANDLE | handle is not a valid channel. |
Remarks
Some flags may not be adjustable in some circumstances, so the return value should be checked to confirm any changes. The flags listed above are just the flags that can be modified, and there may be additional flags present in the return value. See the BASS_CHANNELINFO documentation for a full list of flags.Streams that are created by add-ons may have additional flags available. There is a limited number of possible flag values though, so some add-ons may use the same flag value for different things. This means that when using add-on specific flags with a stream created via the plugin system, it is a good idea to first confirm that the add-on is handling the stream, by checking its ctype via BASS_ChannelGetInfo.
During playback, the effects of flag changes are not heard instantaneously, due to buffering. To reduce the delay, use the BASS_CONFIG_BUFFER config option to reduce the buffer length.
Example
Toggle looping on a channel.if (BASS_ChannelFlags(channel, 0, 0)&BASS;_SAMPLE_LOOP) { // looping is enabled, so... BASS_ChannelFlags(channel, 0, BASS_SAMPLE_LOOP); // remove the LOOP flag } else { // looping is disabled, so... BASS_ChannelFlags(channel, BASS_SAMPLE_LOOP, BASS_SAMPLE_LOOP); // set the LOOP flag }