2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 10:37:41 -04:00

Add check of sound's current volume before sending subtitles

This commit is contained in:
ZarothYe
2023-02-27 21:56:28 -06:00
parent 4b0ab75a79
commit fb96b2b03c

View File

@ -117,7 +117,8 @@ void plWin32Sound::Update()
uint32_t currentTimeMs = (uint32_t)(GetActualTimeSec() * 1000.0f); uint32_t currentTimeMs = (uint32_t)(GetActualTimeSec() * 1000.0f);
if (currentTimeMs <= srtReader->GetLastEntryEndTime()) { if (currentTimeMs <= srtReader->GetLastEntryEndTime()) {
while (plSrtEntry* nextEntry = srtReader->GetNextEntryStartingBeforeTime(currentTimeMs)) { while (plSrtEntry* nextEntry = srtReader->GetNextEntryStartingBeforeTime(currentTimeMs)) {
if (plgAudioSys::AreSubtitlesEnabled()) { float currVol = QueryCurrVolume();
if (plgAudioSys::AreSubtitlesEnabled() && currVol > 0.01f) {
// add a plSubtitleMsg to go... to whoever is listening (probably the KI) // add a plSubtitleMsg to go... to whoever is listening (probably the KI)
plSubtitleMsg* msg = new plSubtitleMsg(nextEntry->GetSubtitleText(), nextEntry->GetSpeakerName()); plSubtitleMsg* msg = new plSubtitleMsg(nextEntry->GetSubtitleText(), nextEntry->GetSpeakerName());
msg->Send(); msg->Send();