SoundStream: remove unused m_muted and IsMuted

This commit is contained in:
Michael M 2017-10-21 12:34:51 -07:00
parent 78d5dbe032
commit 7bcdd1a46a
7 changed files with 5 additions and 20 deletions

View File

@ -80,7 +80,6 @@ void AlsaSound::SoundLoop()
void AlsaSound::Clear(bool muted) void AlsaSound::Clear(bool muted)
{ {
m_muted = muted;
m_thread_status.store(muted ? ALSAThreadStatus::PAUSED : ALSAThreadStatus::RUNNING); m_thread_status.store(muted ? ALSAThreadStatus::PAUSED : ALSAThreadStatus::RUNNING);
cv.notify_one(); // Notify thread that status has changed cv.notify_one(); // Notify thread that status has changed
} }

View File

@ -35,11 +35,6 @@ void NullSound::Update()
m_mixer->Mix(m_realtime_buffer.data(), (unsigned int)num_samples_to_render); m_mixer->Mix(m_realtime_buffer.data(), (unsigned int)num_samples_to_render);
} }
void NullSound::Clear(bool mute)
{
m_muted = mute;
}
void NullSound::Stop() void NullSound::Stop()
{ {
} }

View File

@ -14,7 +14,6 @@ public:
void SoundLoop() override; void SoundLoop() override;
void SetVolume(int volume) override; void SetVolume(int volume) override;
void Stop() override; void Stop() override;
void Clear(bool mute) override;
void Update() override; void Update() override;
static bool isValid() { return true; } static bool isValid() { return true; }

View File

@ -163,9 +163,7 @@ void OpenALStream::Update()
void OpenALStream::Clear(bool mute) void OpenALStream::Clear(bool mute)
{ {
m_muted = mute; if (mute)
if (m_muted)
{ {
palSourceStop(m_source); palSourceStop(m_source);
} }

View File

@ -13,10 +13,9 @@ class SoundStream
{ {
protected: protected:
std::unique_ptr<Mixer> m_mixer; std::unique_ptr<Mixer> m_mixer;
bool m_muted;
public: public:
SoundStream() : m_mixer(new Mixer(48000)), m_muted(false) {} SoundStream() : m_mixer(new Mixer(48000)) {}
virtual ~SoundStream() {} virtual ~SoundStream() {}
static bool isValid() { return false; } static bool isValid() { return false; }
Mixer* GetMixer() const { return m_mixer.get(); } Mixer* GetMixer() const { return m_mixer.get(); }
@ -25,6 +24,5 @@ public:
virtual void SoundLoop() {} virtual void SoundLoop() {}
virtual void Stop() {} virtual void Stop() {}
virtual void Update() {} virtual void Update() {}
virtual void Clear(bool mute) { m_muted = mute; } virtual void Clear(bool mute) {}
bool IsMuted() const { return m_muted; }
}; };

View File

@ -212,11 +212,9 @@ void XAudio2::SetVolume(int volume)
void XAudio2::Clear(bool mute) void XAudio2::Clear(bool mute)
{ {
m_muted = mute;
if (m_voice_context) if (m_voice_context)
{ {
if (m_muted) if (mute)
m_voice_context->Stop(); m_voice_context->Stop();
else else
m_voice_context->Play(); m_voice_context->Play();

View File

@ -200,11 +200,9 @@ void XAudio2_7::SetVolume(int volume)
void XAudio2_7::Clear(bool mute) void XAudio2_7::Clear(bool mute)
{ {
m_muted = mute;
if (m_voice_context) if (m_voice_context)
{ {
if (m_muted) if (mute)
m_voice_context->Stop(); m_voice_context->Stop();
else else
m_voice_context->Play(); m_voice_context->Play();