Namespace: Un4seen.Bass
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
[DllImportAttribute("bass")] public static BASSFlag BASS_ChannelFlags( int handle, BASSFlag flags, BASSFlag mask )
Parameters
- handle
- Type: SystemInt32
The channel handle... a HCHANNEL, HMUSIC, HSTREAM. - flags
- Type: Un4seen.BassBASSFlag
A combination of these flags (see BASSFlag):Other attributes may be supported by add-ons, see the documentationBASS_SAMPLE_LOOP Loop the channel. BASS_SAMPLE_MUTEMAX Mute the channel when it is at (or beyond) its max distance. BASS_STREAM_AUTOFREE Automatically free the channel when playback ends. Note that the BASS_MUSIC_AUTOFREE flag is identical to this flag. (HSTREAM/HMUSIC) BASS_STREAM_RESTRATE Restrict the download rate. (HSTREAM) BASS_MUSIC_NONINTER Use non-interpolated mixing. (HMUSIC) BASS_MUSIC_SINCINTER Use sinc interpolated sample mixing. (HMUSIC) BASS_MUSIC_RAMP Use "normal" ramping. (HMUSIC) BASS_MUSIC_RAMPS Use "sensitive" ramping. (HMUSIC) BASS_MUSIC_SURROUND Use surround sound. (HMUSIC) BASS_MUSIC_SURROUND2 Use surround sound mode 2. (HMUSIC) BASS_MUSIC_FT2MOD Use FastTracker 2 .MOD playback. (HMUSIC) BASS_MUSIC_PT1MOD Use ProTracker 1 .MOD playback. (HMUSIC) BASS_MUSIC_POSRESET Stop all notes when seeking. (HMUSIC) BASS_MUSIC_POSRESETEX Stop all notes and reset BPM/etc when seeking. (HMUSIC) BASS_MUSIC_STOPBACK Stop when a backward jump effect is played. (HMUSIC) BASS_SPEAKER_xxx Speaker assignment flags. (HSTREAM/HMUSIC) - mask
- Type: Un4seen.BassBASSFlag
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
Type: BASSFlagIf successful, the channel's updated flags are returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.
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(Int32, BASS_CHANNELINFO).
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.
ERROR CODE | Description |
---|---|
BASS_ERROR_HANDLE | handle is not a valid channel. |
if ((Bass.BASS_ChannelFlags(channel, BASSFlag.BASS_DEFAULT, BASSFlag.BASS_DEFAULT) & BASSFlag.BASS_SAMPLE_LOOP) == BASSFlag.BASS_SAMPLE_LOOP) { // loop flag was set, so remove it Bass.BASS_ChannelFlags(channel, BASSFlag.BASS_DEFAULT, BASSFlag.BASS_SAMPLE_LOOP); } else { // loop flag was not set, so set it Bass.BASS_ChannelFlags(channel, BASSFlag.BASS_SAMPLE_LOOP, BASSFlag.BASS_SAMPLE_LOOP); }