MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / setGain

Method setGain

framework/sound/sdlraw_backend.cpp:401–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399 return reqGain;
400 }
401 void setGain(Gain g, float f) override
402 {
403 // Clamp to 0..1
404 f = std::min(1.0f, std::max(0.0f, f));
405 switch (g)
406 {
407 case Gain::Global:
408 overall_volume = f;
409 break;
410 case Gain::Sample:
411 sound_volume = f;
412 break;
413 case Gain::Music:
414 music_volume = f;
415 break;
416 }
417 }
418};
419
420void unwrap_callback(void *userdata, Uint8 *stream, int len)

Callers 2

eventOccurredMethod · 0.45
audioInitialiseMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected