Decrease Volume of Mixer's Backend - How much show we decrease by? - Name of Mixer Value
| 38 | /// <param name="amountToDecrease"> - How much show we decrease by?</param> |
| 39 | /// <param name="mixerToDecrease"> - Name of Mixer Value</param> |
| 40 | void 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. |
nothing calls this directly
no test coverage detected