Qt: Fix audio volume/mute being lost when restarting emulation
This commit is contained in:
parent
4a3e5ed644
commit
5a955a4fdc
|
@ -79,5 +79,5 @@ void AudioSettingsWidget::onOutputMutedChanged(int new_state)
|
||||||
{
|
{
|
||||||
const bool muted = (new_state != 0);
|
const bool muted = (new_state != 0);
|
||||||
m_host_interface->SetBoolSettingValue("Audio", "OutputMuted", muted);
|
m_host_interface->SetBoolSettingValue("Audio", "OutputMuted", muted);
|
||||||
m_host_interface->setAudioOutputVolume(muted ? 0 : m_ui.volume->value());
|
m_host_interface->setAudioOutputMuted(muted);
|
||||||
}
|
}
|
|
@ -897,6 +897,22 @@ void QtHostInterface::setAudioOutputVolume(int value)
|
||||||
|
|
||||||
if (m_audio_stream)
|
if (m_audio_stream)
|
||||||
m_audio_stream->SetOutputVolume(value);
|
m_audio_stream->SetOutputVolume(value);
|
||||||
|
|
||||||
|
m_settings.audio_output_volume = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtHostInterface::setAudioOutputMuted(bool muted)
|
||||||
|
{
|
||||||
|
if (!isOnWorkerThread())
|
||||||
|
{
|
||||||
|
QMetaObject::invokeMethod(this, "setAudioOutputMuted", Q_ARG(bool, muted));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_audio_stream)
|
||||||
|
m_audio_stream->SetOutputVolume(muted ? 0 : m_settings.audio_output_volume);
|
||||||
|
|
||||||
|
m_settings.audio_output_muted = muted;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtHostInterface::startDumpingAudio()
|
void QtHostInterface::startDumpingAudio()
|
||||||
|
|
|
@ -136,6 +136,7 @@ public Q_SLOTS:
|
||||||
void loadState(bool global, qint32 slot);
|
void loadState(bool global, qint32 slot);
|
||||||
void saveState(bool global, qint32 slot, bool block_until_done = false);
|
void saveState(bool global, qint32 slot, bool block_until_done = false);
|
||||||
void setAudioOutputVolume(int value);
|
void setAudioOutputVolume(int value);
|
||||||
|
void setAudioOutputMuted(bool muted);
|
||||||
void startDumpingAudio();
|
void startDumpingAudio();
|
||||||
void stopDumpingAudio();
|
void stopDumpingAudio();
|
||||||
void saveScreenshot();
|
void saveScreenshot();
|
||||||
|
|
Loading…
Reference in New Issue