|
|
@ -111,17 +111,19 @@ void plWin32Sound::IFreeBuffers( void ) |
|
|
|
void plWin32Sound::Update() |
|
|
|
void plWin32Sound::Update() |
|
|
|
{ |
|
|
|
{ |
|
|
|
plSoundBuffer* buf = GetDataBuffer(); |
|
|
|
plSoundBuffer* buf = GetDataBuffer(); |
|
|
|
if (plgAudioSys::AreSubtitlesEnabled() && buf != nullptr) { |
|
|
|
if (buf != nullptr) { |
|
|
|
plSrtFileReader* srtReader = buf->GetSrtReader(); |
|
|
|
plSrtFileReader* srtReader = buf->GetSrtReader(); |
|
|
|
if (srtReader != nullptr) { |
|
|
|
if (srtReader != nullptr) { |
|
|
|
uint32_t currentTimeMs = (uint32_t)(GetActualTimeSec() * 1000.0f); |
|
|
|
uint32_t currentTimeMs = (uint32_t)(GetActualTimeSec() * 1000.0f); |
|
|
|
while (plSrtEntry* nextEntry = srtReader->GetNextEntryStartingBeforeTime(currentTimeMs)) { |
|
|
|
while (plSrtEntry* nextEntry = srtReader->GetNextEntryStartingBeforeTime(currentTimeMs)) { |
|
|
|
|
|
|
|
if (plgAudioSys::AreSubtitlesEnabled()) { |
|
|
|
// 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(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
plSound::Update(); |
|
|
|
plSound::Update(); |
|
|
|
} |
|
|
|
} |
|
|
|