SoundStream: remove unused m_muted and IsMuted
This commit is contained in:
parent
78d5dbe032
commit
7bcdd1a46a
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -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; }
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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; }
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue