mirror of
https://github.com/stenzek/duckstation.git
synced 2026-02-04 05:04:33 +00:00
Qt: Fix initial state of output latency slider
This commit is contained in:
committed by
Connor McLaughlin
parent
ad01f993c8
commit
2afc6cf26e
@@ -12,7 +12,6 @@
|
||||
|
||||
#include "util/audio_stream.h"
|
||||
|
||||
#include <bit>
|
||||
#include <cmath>
|
||||
|
||||
#include "moc_audiosettingswidget.cpp"
|
||||
@@ -51,17 +50,18 @@ AudioSettingsWidget::AudioSettingsWidget(SettingsWindow* dialog, QWidget* parent
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.useAAFilter, "Audio", "StretchUseAAFilter",
|
||||
AudioStreamParameters::DEFAULT_STRETCH_USE_AA_FILTER);
|
||||
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.muteCDAudio, "CDROM", "MuteCDAudio", false);
|
||||
|
||||
connect(m_ui.audioBackend, &QComboBox::currentIndexChanged, this, &AudioSettingsWidget::updateDriverNames);
|
||||
connect(m_ui.stretchMode, &QComboBox::currentIndexChanged, this, &AudioSettingsWidget::onStretchModeChanged);
|
||||
onStretchModeChanged();
|
||||
updateDriverNames();
|
||||
|
||||
connect(m_ui.outputLatencyMS, &QSlider::valueChanged, this, &AudioSettingsWidget::updateLatencyLabel);
|
||||
connect(m_ui.outputLatencyMinimal, &QCheckBox::checkStateChanged, this,
|
||||
&AudioSettingsWidget::onMinimalOutputLatencyChecked);
|
||||
[this]() { onMinimalOutputLatencyToggled(); });
|
||||
connect(m_ui.bufferMS, &QSlider::valueChanged, this, &AudioSettingsWidget::updateMinimumLatencyLabel);
|
||||
connect(m_ui.sequenceLength, &QSlider::valueChanged, this, &AudioSettingsWidget::updateMinimumLatencyLabel);
|
||||
updateLatencyLabel();
|
||||
|
||||
updateDriverNames();
|
||||
onStretchModeChanged();
|
||||
onMinimalOutputLatencyToggled(); // also calls updateLatencyLabel()
|
||||
|
||||
// for per-game, just use the normal path, since it needs to re-read/apply
|
||||
if (!dialog->isPerGameSettings())
|
||||
@@ -350,7 +350,7 @@ void AudioSettingsWidget::updateVolumeLabel()
|
||||
m_ui.fastForwardVolumeLabel->setText(tr("%1%").arg(m_ui.fastForwardVolume->value()));
|
||||
}
|
||||
|
||||
void AudioSettingsWidget::onMinimalOutputLatencyChecked(Qt::CheckState state)
|
||||
void AudioSettingsWidget::onMinimalOutputLatencyToggled()
|
||||
{
|
||||
const bool minimal = m_dialog->getEffectiveBoolValue("Audio", "OutputLatencyMinimal", false);
|
||||
m_ui.outputLatencyMS->setEnabled(!minimal);
|
||||
|
||||
@@ -26,13 +26,12 @@ private:
|
||||
void resetVolume(bool fast_forward);
|
||||
|
||||
void onStretchModeChanged();
|
||||
|
||||
void updateDriverNames();
|
||||
void queueUpdateDeviceNames();
|
||||
void updateLatencyLabel();
|
||||
void updateMinimumLatencyLabel();
|
||||
void updateVolumeLabel();
|
||||
void onMinimalOutputLatencyChecked(Qt::CheckState state);
|
||||
void onMinimalOutputLatencyToggled();
|
||||
void onOutputVolumeChanged(int new_value);
|
||||
void onFastForwardVolumeChanged(int new_value);
|
||||
void onOutputMutedChanged(int new_state);
|
||||
|
||||
Reference in New Issue
Block a user