Author Topic: Question about BASS_Mixer_ChannelFlags  (Read 157 times)

rdkartono

  • Posts: 58
Question about BASS_Mixer_ChannelFlags
« on: 13 Dec '22 - 06:11 »
a bit confused with explanation of BASS_Mixer_ChannelFlags function.
A first time to use it .

Supposedly I already have a mixer handle (mixerhandle)
And I already have a stream handle (handle)
And I want to add handle to mixerhandle, in specific Speaker setting and in paused condition, i need to use
Code: [Select]
    int flag = BASS_SPEAKER_FRONTRIGHT | BASS_MIXER_CHAN_PAUSE
    BASS_Mixer_StreamAddChannel(mixerhandle, handle, flag);

Then if I want to resume (un-pause) the handle, and retaining speaker condition, what command should I use ?
Code: [Select]
BASS_Mixer_ChannelFlags(handle, 0, BASS_MIXER_CHAN_PAUSE); // remove PAUSE flag
... OR ....
Code: [Select]
BASS_Mixer_ChannelFlags(handle, BASS_SPEAKER_FRONTRIGHT | BASS_MIXER_CHAN_PAUSE , BASS_MIXER_CHAN_PAUSE); // remove PAUSE flag
... OR ....
Code: [Select]
BASS_Mixer_ChannelFlags(handle, BASS_SPEAKER_FRONTRIGHT  , BASS_MIXER_CHAN_PAUSE); // remove PAUSE flag

Also please explain if I want to Pause the handle again, while retaining speaker configuration.

Ian @ un4seen

  • Administrator
  • Posts: 25054
Re: Question about BASS_Mixer_ChannelFlags
« Reply #1 on: 13 Dec '22 - 13:17 »
The BASS_Mixer_ChannelFlags "mask" parameter determines which flags are changed (and which are left as they are). Your 1st call is the correct way to remove the BASS_MIXER_CHAN_PAUSE flag but the 3rd will also work (BASS_SPEAKER_FRONTRIGHT is ignored), while the 2nd call keeps BASS_MIXER_CHAN_PAUSE set.

If a flag is present in both "flags" and "mask" then it is set. If a flag is only present in "mask" then it is unset. If a flag is only present in "flags" then it is ignored.

Code: [Select]
BASS_Mixer_ChannelFlags(handle, BASS_MIXER_CHAN_PAUSE, BASS_MIXER_CHAN_PAUSE); // set PAUSE flag
BASS_Mixer_ChannelFlags(handle, 0, BASS_MIXER_CHAN_PAUSE); // unset PAUSE flag
BASS_Mixer_ChannelFlags(handle, BASS_MIXER_CHAN_PAUSE, 0); // do nothing

rdkartono

  • Posts: 58
Re: Question about BASS_Mixer_ChannelFlags
« Reply #2 on: 14 Dec '22 - 03:10 »
Then correct me if these statements are wrong :

1. This code will resume (or un-pause) the channel, but Speaker setting still remaining BASS_SPEAKER_FRONTRIGHT
Code: [Select]
BASS_Mixer_ChannelFlags(handle, 0, BASS_MIXER_CHAN_PAUSE); // unset PAUSE flag

2. And This code will pause the channel, but Speaker setting still remaining BASS_SPEAKER_FRONTRIGHT
Code: [Select]
BASS_Mixer_ChannelFlags(handle, BASS_MIXER_CHAN_PAUSE, BASS_MIXER_CHAN_PAUSE);  // set PAUSE flag

3. So the speaker flag set on BASS_Mixer_StreamAddChannel will remain intact regardless pause / resume.

4. Also if I want to get current PAUSE status, I can use this code
Code: [Select]
int stat = BASS_Mixer_ChannelFlags(handle, 0, 0);
boolean paused = (stat & BASS_MIXER_CHAN_PAUSE)>0 ? true : false;

 
I will try them now .

Thank you Ian .

Ian @ un4seen

  • Administrator
  • Posts: 25054
Re: Question about BASS_Mixer_ChannelFlags
« Reply #3 on: 14 Dec '22 - 11:58 »
Those statements are all correct.