From 6e1d29fe861ef5a81c5458cd8ae68d09f36e28c3 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 18 Jul 2023 17:36:51 +1000 Subject: Provide speaker info to HUD indicators --- source/frontend/StarVoice.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/frontend/StarVoice.hpp') diff --git a/source/frontend/StarVoice.hpp b/source/frontend/StarVoice.hpp index 38964b0..d6bc467 100644 --- a/source/frontend/StarVoice.hpp +++ b/source/frontend/StarVoice.hpp @@ -81,9 +81,10 @@ public: Mutex mutex; int64_t lastReceiveTime = 0; + int64_t lastPlayTime = 0; atomic muted = false; - atomic playing = false; + atomic playing = 0; atomic decibelLevel = 0.0f; atomic> channelVolumes = Array::filled(1.0f); @@ -118,7 +119,9 @@ public: // Sets the local speaker ID and returns the local speaker. Must be called upon loading into a world. SpeakerPtr setLocalSpeaker(SpeakerId speakerId); + SpeakerPtr localSpeaker(); SpeakerPtr speaker(SpeakerId speakerId); + List speakers(bool onlyPlaying); // Called when receiving input audio data from SDL, on its own thread. void readAudioData(uint8_t* stream, int len); -- cgit v1.2.3