Android: Implement OpenSLESStream::SetRunning

This commit is contained in:
JosJuice 2024-06-04 19:32:04 +02:00
parent 2b386cdcdc
commit a3c23353c0
2 changed files with 7 additions and 1 deletions

View File

@ -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) void OpenSLESStream::SetVolume(int volume)
{ {
const SLmillibel attenuation = const SLmillibel attenuation =

View File

@ -14,7 +14,7 @@ class OpenSLESStream final : public SoundStream
public: public:
~OpenSLESStream() override; ~OpenSLESStream() override;
bool Init() override; bool Init() override;
bool SetRunning(bool running) override { return true; } bool SetRunning(bool running) override;
void SetVolume(int volume) override; void SetVolume(int volume) override;
static bool IsValid() { return true; } static bool IsValid() { return true; }