mixSetMasterGain function mixer

bool mixSetMasterGain(
  1. Pointer<MixMixer> mixer,
  2. double gain
)

Set a mixer's master gain control.

Each mixer has a master gain, to adjust the volume of the entire mix. Each sample passing through the pipeline is modulated by this gain value. A gain of zero will generate silence, 1.0f will not change the mixed volume, and larger than 1.0f will increase the volume. Negative values are illegal. There is no maximum gain specified, but this can quickly get extremely loud, so please be careful with this setting.

A mixer's master gain defaults to 1.0f.

This value can be changed at any time to adjust the future mix.

\param mixer the mixer to adjust. \param gain the new gain value. \returns true on success or false on failure; call SDL_GetError() for more information.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL_mixer 3.0.0.

\sa MIX_GetMasterGain \sa MIX_SetTrackGain

extern SDL_DECLSPEC bool SDLCALL MIX_SetMasterGain(MIX_Mixer *mixer, float gain)

Implementation

bool mixSetMasterGain(Pointer<MixMixer> mixer, double gain) {
  final mixSetMasterGainLookupFunction = _libMixer
      .lookupFunction<
        Uint8 Function(Pointer<MixMixer> mixer, Float gain),
        int Function(Pointer<MixMixer> mixer, double gain)
      >('MIX_SetMasterGain');
  return mixSetMasterGainLookupFunction(mixer, gain) == 1;
}