actually rename that setting

This commit is contained in:
Nadia Holmquist Pedersen 2023-06-24 16:34:23 +02:00
parent 74b166cba3
commit 4b32fb802c
9 changed files with 26 additions and 26 deletions

View File

@ -674,10 +674,10 @@ void Reset()
degradeAudio = false;
}
int bitrate = Platform::GetConfigInt(Platform::AudioBitrate);
if (bitrate == 1) // Always 10-bit
int bitDepth = Platform::GetConfigInt(Platform::AudioBitDepth);
if (bitDepth == 1) // Always 10-bit
degradeAudio = true;
else if (bitrate == 2) // Always 16-bit
else if (bitDepth == 2) // Always 16-bit
degradeAudio = false;
SPU::SetDegrade10Bit(degradeAudio);

View File

@ -82,7 +82,7 @@ enum ConfigEntry
Firm_Message,
Firm_MAC,
AudioBitrate,
AudioBitDepth,
};
int GetConfigInt(ConfigEntry entry);

View File

@ -40,7 +40,7 @@ AudioSettingsDialog::AudioSettingsDialog(QWidget* parent, bool emuActive) : QDia
setAttribute(Qt::WA_DeleteOnClose);
oldInterp = Config::AudioInterp;
oldBitrate = Config::AudioBitrate;
oldBitDepth = Config::AudioBitDepth;
oldVolume = Config::AudioVolume;
oldDSiSync = Config::DSiVolumeSync;
@ -50,10 +50,10 @@ AudioSettingsDialog::AudioSettingsDialog(QWidget* parent, bool emuActive) : QDia
ui->cbInterpolation->addItem("Cubic");
ui->cbInterpolation->setCurrentIndex(Config::AudioInterp);
ui->cbBitrate->addItem("Automatic");
ui->cbBitrate->addItem("10-bit");
ui->cbBitrate->addItem("16-bit");
ui->cbBitrate->setCurrentIndex(Config::AudioBitrate);
ui->cbBitDepth->addItem("Automatic");
ui->cbBitDepth->addItem("10-bit");
ui->cbBitDepth->addItem("16-bit");
ui->cbBitDepth->setCurrentIndex(Config::AudioBitDepth);
bool state = ui->slVolume->blockSignals(true);
ui->slVolume->setValue(Config::AudioVolume);
@ -90,7 +90,7 @@ AudioSettingsDialog::AudioSettingsDialog(QWidget* parent, bool emuActive) : QDia
{
ui->lblInstanceNum->setText(QString("Configuring settings for instance %1").arg(inst+1));
ui->cbInterpolation->setEnabled(false);
ui->cbBitrate->setEnabled(false);
ui->cbBitDepth->setEnabled(false);
for (QAbstractButton* btn : grpMicMode->buttons())
btn->setEnabled(false);
ui->txtMicWavPath->setEnabled(false);
@ -133,19 +133,19 @@ void AudioSettingsDialog::on_AudioSettingsDialog_accepted()
void AudioSettingsDialog::on_AudioSettingsDialog_rejected()
{
Config::AudioInterp = oldInterp;
Config::AudioBitrate = oldBitrate;
Config::AudioBitDepth = oldBitDepth;
Config::AudioVolume = oldVolume;
Config::DSiVolumeSync = oldDSiSync;
closeDlg();
}
void AudioSettingsDialog::on_cbBitrate_currentIndexChanged(int idx)
void AudioSettingsDialog::on_cbBitDepth_currentIndexChanged(int idx)
{
// prevent a spurious change
if (ui->cbBitrate->count() < 3) return;
if (ui->cbBitDepth->count() < 3) return;
Config::AudioBitrate = ui->cbBitrate->currentIndex();
Config::AudioBitDepth = ui->cbBitDepth->currentIndex();
emit updateAudioSettings();
}

View File

@ -62,7 +62,7 @@ private slots:
void on_AudioSettingsDialog_rejected();
void on_cbInterpolation_currentIndexChanged(int idx);
void on_cbBitrate_currentIndexChanged(int idx);
void on_cbBitDepth_currentIndexChanged(int idx);
void on_slVolume_valueChanged(int val);
void on_chkSyncDSiVolume_clicked(bool checked);
void onChangeMicMode(int mode);
@ -72,7 +72,7 @@ private:
Ui::AudioSettingsDialog* ui;
int oldInterp;
int oldBitrate;
int oldBitDepth;
int oldVolume;
bool oldDSiSync;
QButtonGroup* grpMicMode;

View File

@ -86,14 +86,14 @@
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Bitrate:</string>
<string>Bit depth:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="cbBitrate">
<widget class="QComboBox" name="cbBitDepth">
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The bitrate of audio playback. If set to &quot;Automatic&quot; this will be 10-bit for DS mode and 16-bit for DSi mode.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The bit depth of audio playback. If set to &quot;Automatic&quot; this will be 10-bit for DS mode and 16-bit for DSi mode.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@ -190,7 +190,7 @@
</customwidgets>
<tabstops>
<tabstop>cbInterpolation</tabstop>
<tabstop>cbBitrate</tabstop>
<tabstop>cbBitDepth</tabstop>
<tabstop>slVolume</tabstop>
<tabstop>chkSyncDSiVolume</tabstop>
<tabstop>rbMicNone</tabstop>

View File

@ -116,7 +116,7 @@ bool DirectLAN;
bool SavestateRelocSRAM;
int AudioInterp;
int AudioBitrate;
int AudioBitDepth;
int AudioVolume;
bool DSiVolumeSync;
int MicInputType;
@ -296,7 +296,7 @@ ConfigEntry ConfigFile[] =
{"SavStaRelocSRAM", 1, &SavestateRelocSRAM, false, false},
{"AudioInterp", 0, &AudioInterp, 0, false},
{"AudioBitrate", 0, &AudioBitrate, 0, false},
{"AudioBitDepth", 0, &AudioBitDepth, 0, false},
{"AudioVolume", 0, &AudioVolume, 256, true},
{"DSiVolumeSync", 0, &DSiVolumeSync, 0, true},
{"MicInputType", 0, &MicInputType, 1, false},

View File

@ -173,7 +173,7 @@ extern bool DirectLAN;
extern bool SavestateRelocSRAM;
extern int AudioInterp;
extern int AudioBitrate;
extern int AudioBitDepth;
extern int AudioVolume;
extern bool DSiVolumeSync;
extern int MicInputType;

View File

@ -191,7 +191,7 @@ int GetConfigInt(ConfigEntry entry)
case Firm_BirthdayDay: return Config::FirmwareBirthdayDay;
case Firm_Color: return Config::FirmwareFavouriteColour;
case AudioBitrate: return Config::AudioBitrate;
case AudioBitDepth: return Config::AudioBitDepth;
}
return 0;

View File

@ -2905,10 +2905,10 @@ void MainWindow::onUpdateAudioSettings()
{
SPU::SetInterpolation(Config::AudioInterp);
if (Config::AudioBitrate == 0)
if (Config::AudioBitDepth == 0)
SPU::SetDegrade10Bit(NDS::ConsoleType == 0);
else
SPU::SetDegrade10Bit(Config::AudioBitrate == 1);
SPU::SetDegrade10Bit(Config::AudioBitDepth == 1);
}
void MainWindow::onAudioSettingsFinished(int res)