From a3c23353c05c6455e47889dc5338fe6ee494d813 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 4 Jun 2024 19:32:04 +0200 Subject: [PATCH] Android: Implement OpenSLESStream::SetRunning --- Source/Core/AudioCommon/OpenSLESStream.cpp | 6 ++++++ Source/Core/AudioCommon/OpenSLESStream.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Core/AudioCommon/OpenSLESStream.cpp b/Source/Core/AudioCommon/OpenSLESStream.cpp index a35b981017..a3f6308187 100644 --- a/Source/Core/AudioCommon/OpenSLESStream.cpp +++ b/Source/Core/AudioCommon/OpenSLESStream.cpp @@ -137,6 +137,12 @@ OpenSLESStream::~OpenSLESStream() } } +bool OpenSLESStream::SetRunning(bool running) +{ + SLuint32 new_state = running ? SL_PLAYSTATE_PLAYING : SL_PLAYSTATE_PAUSED; + return (*bqPlayerPlay)->SetPlayState(bqPlayerPlay, new_state) == SL_RESULT_SUCCESS; +} + void OpenSLESStream::SetVolume(int volume) { const SLmillibel attenuation = diff --git a/Source/Core/AudioCommon/OpenSLESStream.h b/Source/Core/AudioCommon/OpenSLESStream.h index 0aae560ce6..f22aaf9a0f 100644 --- a/Source/Core/AudioCommon/OpenSLESStream.h +++ b/Source/Core/AudioCommon/OpenSLESStream.h @@ -14,7 +14,7 @@ class OpenSLESStream final : public SoundStream public: ~OpenSLESStream() override; bool Init() override; - bool SetRunning(bool running) override { return true; } + bool SetRunning(bool running) override; void SetVolume(int volume) override; static bool IsValid() { return true; }