audio: make system own master gain semantics
This commit is contained in:
@@ -141,22 +141,6 @@ bool WaveOutBackend::SetDevice(const std::string& deviceName) {
|
||||
return false;
|
||||
}
|
||||
|
||||
float WaveOutBackend::GetMasterVolume() const {
|
||||
return m_masterVolume.load();
|
||||
}
|
||||
|
||||
void WaveOutBackend::SetMasterVolume(float volume) {
|
||||
m_masterVolume.store(std::max(0.0f, std::min(1.0f, volume)));
|
||||
}
|
||||
|
||||
bool WaveOutBackend::IsMuted() const {
|
||||
return m_muted.load();
|
||||
}
|
||||
|
||||
void WaveOutBackend::SetMuted(bool muted) {
|
||||
m_muted.store(muted);
|
||||
}
|
||||
|
||||
void WaveOutBackend::Start() {
|
||||
if (m_isRunning.load()) {
|
||||
return;
|
||||
@@ -309,7 +293,7 @@ void WaveOutBackend::AudioThread() {
|
||||
continue;
|
||||
}
|
||||
|
||||
FillPcm16Buffer(*targetBuffer, m_pendingMixBuffer, m_masterVolume.load(), m_muted.load());
|
||||
FillPcm16Buffer(*targetBuffer, m_pendingMixBuffer);
|
||||
m_hasPendingMix = false;
|
||||
lock.unlock();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user