SoundStream: rename Clear(mute) to SetRunning(running)
This commit is contained in:
parent
d6985fc3e8
commit
b031d3316c
|
@ -78,9 +78,9 @@ void AlsaSound::SoundLoop()
|
||||||
m_thread_status.store(ALSAThreadStatus::STOPPED);
|
m_thread_status.store(ALSAThreadStatus::STOPPED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AlsaSound::Clear(bool muted)
|
void AlsaSound::SetRunning(bool running)
|
||||||
{
|
{
|
||||||
m_thread_status.store(muted ? ALSAThreadStatus::PAUSED : ALSAThreadStatus::RUNNING);
|
m_thread_status.store(running ? ALSAThreadStatus::RUNNING : ALSAThreadStatus::PAUSED);
|
||||||
cv.notify_one(); // Notify thread that status has changed
|
cv.notify_one(); // Notify thread that status has changed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
void SoundLoop() override;
|
void SoundLoop() override;
|
||||||
void Stop() override;
|
void Stop() override;
|
||||||
void Update() override;
|
void Update() override;
|
||||||
void Clear(bool) override;
|
void SetRunning(bool running) override;
|
||||||
|
|
||||||
static bool isValid() { return true; }
|
static bool isValid() { return true; }
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -162,7 +162,7 @@ void UpdateSoundStream()
|
||||||
void SetSoundStreamRunning(bool running)
|
void SetSoundStreamRunning(bool running)
|
||||||
{
|
{
|
||||||
if (g_sound_stream)
|
if (g_sound_stream)
|
||||||
g_sound_stream->Clear(running);
|
g_sound_stream->SetRunning(running);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendAIBuffer(const short* samples, unsigned int num_samples)
|
void SendAIBuffer(const short* samples, unsigned int num_samples)
|
||||||
|
|
|
@ -161,15 +161,15 @@ void OpenALStream::Update()
|
||||||
m_sound_sync_event.Set();
|
m_sound_sync_event.Set();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenALStream::Clear(bool mute)
|
void OpenALStream::SetRunning(bool running)
|
||||||
{
|
{
|
||||||
if (mute)
|
if (running)
|
||||||
{
|
{
|
||||||
palSourceStop(m_source);
|
palSourcePlay(m_source);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
palSourcePlay(m_source);
|
palSourceStop(m_source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ 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 SetRunning(bool running) override;
|
||||||
void Update() override;
|
void Update() override;
|
||||||
|
|
||||||
static bool isValid();
|
static bool isValid();
|
||||||
|
|
|
@ -24,5 +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) {}
|
virtual void SetRunning(bool running) {}
|
||||||
};
|
};
|
||||||
|
|
|
@ -210,14 +210,14 @@ void XAudio2::SetVolume(int volume)
|
||||||
m_mastering_voice->SetVolume(m_volume);
|
m_mastering_voice->SetVolume(m_volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudio2::Clear(bool mute)
|
void XAudio2::SetRunning(bool running)
|
||||||
{
|
{
|
||||||
if (m_voice_context)
|
if (m_voice_context)
|
||||||
{
|
{
|
||||||
if (mute)
|
if (running)
|
||||||
m_voice_context->Stop();
|
|
||||||
else
|
|
||||||
m_voice_context->Play();
|
m_voice_context->Play();
|
||||||
|
else
|
||||||
|
m_voice_context->Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ public:
|
||||||
bool Start() override;
|
bool Start() override;
|
||||||
void Stop() override;
|
void Stop() override;
|
||||||
|
|
||||||
void Clear(bool mute) override;
|
void SetRunning(bool running) override;
|
||||||
void SetVolume(int volume) override;
|
void SetVolume(int volume) override;
|
||||||
|
|
||||||
static bool isValid() { return InitLibrary(); }
|
static bool isValid() { return InitLibrary(); }
|
||||||
|
|
|
@ -198,14 +198,14 @@ void XAudio2_7::SetVolume(int volume)
|
||||||
m_mastering_voice->SetVolume(m_volume);
|
m_mastering_voice->SetVolume(m_volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudio2_7::Clear(bool mute)
|
void XAudio2_7::SetRunning(bool running)
|
||||||
{
|
{
|
||||||
if (m_voice_context)
|
if (m_voice_context)
|
||||||
{
|
{
|
||||||
if (mute)
|
if (running)
|
||||||
m_voice_context->Stop();
|
|
||||||
else
|
|
||||||
m_voice_context->Play();
|
m_voice_context->Play();
|
||||||
|
else
|
||||||
|
m_voice_context->Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ public:
|
||||||
bool Start() override;
|
bool Start() override;
|
||||||
void Stop() override;
|
void Stop() override;
|
||||||
|
|
||||||
void Clear(bool mute) override;
|
void SetRunning(bool running) override;
|
||||||
void SetVolume(int volume) override;
|
void SetVolume(int volume) override;
|
||||||
|
|
||||||
static bool isValid() { return InitLibrary(); }
|
static bool isValid() { return InitLibrary(); }
|
||||||
|
|
Loading…
Reference in New Issue