MCPcopy Create free account
hub / github.com/Lovrom8/RSMods / DecreaseVolume

Method DecreaseVolume

DLL/Mods/VolumeControl.cpp:40–64  ·  view source on GitHub ↗

Decrease Volume of Mixer's Backend - How much show we decrease by? - Name of Mixer Value

Source from the content-addressed store, hash-verified

38/// <param name="amountToDecrease"> - How much show we decrease by?</param>
39/// <param name="mixerToDecrease"> - Name of Mixer Value</param>
40void VolumeControl::DecreaseVolume(int amountToDecrease, std::string mixerToDecrease) {
41 float volume = 0;
42 RTPCValue_type type = RTPCValue_GameObject;
43
44 // Mixer sent is not a valid mixer.
45 if (!Contains(mixerToDecrease, mixerNames)) {
46 LOG_ERROR("That mixer doesn't exist" << std::endl);
47 return;
48 }
49
50 // Fill Volume Variable With Current Volume
51 Wwise::SoundEngine::Query::GetRTPCValue(mixerToDecrease.c_str(), AK_INVALID_GAME_OBJECT, &volume, &type);
52
53 // Decrease the volume by the amountToDecrease.
54 if (volume >= (0.0f + amountToDecrease))
55 volume -= amountToDecrease;
56 else
57 volume = 0.0f; // Incase the volume is within the amountToDecrease we can't throw it below 0.
58
59 // Set Volume
60 Wwise::SoundEngine::SetRTPCValue(mixerToDecrease.c_str(), (float)volume, AK_INVALID_GAME_OBJECT, 0, AkCurveInterpolation_Linear);
61 Wwise::SoundEngine::SetRTPCValue(mixerToDecrease.c_str(), (float)volume, 0x1234, 0, AkCurveInterpolation_Linear);
62
63 LOG_INFO("Decrease volume of " << mixerToDecrease << " by " << amountToDecrease << " with a new volume of " << volume << std::endl);
64}
65
66/// <summary>
67/// Disables the song previews when hovering over a song.

Callers

nothing calls this directly

Calls 4

GetRTPCValueFunction · 0.85
SetRTPCValueFunction · 0.85
c_strMethod · 0.80
ContainsFunction · 0.50

Tested by

no test coverage detected