Add a setting for hrtf-mode to alsoft-config

This commit is contained in:
Chris Robinson
2019-07-04 22:59:12 -07:00
parent 474073955b
commit 3edbeefdb7
3 changed files with 109 additions and 0 deletions
+37
View File
@@ -123,6 +123,14 @@ static const struct NameValuePair {
{ "ACN, N3D", "acn+n3d" },
{ "Furse-Malham", "fuma" },
{ "", "" }
}, hrtfModeList[] = {
{ "1st Order Ambisonic", "ambi1" },
{ "2nd Order Ambisonic", "ambi2" },
{ "3rd Order Ambisonic", "ambi3" },
{ "Default (Full)", "" },
{ "Full", "full" },
{ "", "" }
};
@@ -267,6 +275,9 @@ MainWindow::MainWindow(QWidget *parent) :
}
ui->resamplerSlider->setRange(0, count-1);
for(count = 0;hrtfModeList[count].name[0];count++) {
}
ui->hrtfqualitySlider->setRange(0, count-1);
ui->hrtfStateComboBox->adjustSize();
#if !defined(HAVE_NEON) && !defined(HAVE_SSE)
@@ -367,6 +378,8 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->preferredHrtfComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(enableApplyButton()));
connect(ui->hrtfStateComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(enableApplyButton()));
connect(ui->hrtfqualitySlider, SIGNAL(valueChanged(int)), this, SLOT(updateHrtfModeLabel(int)));
connect(ui->hrtfAddButton, SIGNAL(clicked()), this, SLOT(addHrtfFile()));
connect(ui->hrtfRemoveButton, SIGNAL(clicked()), this, SLOT(removeHrtfFile()));
connect(ui->hrtfFileList, SIGNAL(itemSelectionChanged()), this, SLOT(updateHrtfRemoveButton()));
@@ -725,6 +738,21 @@ void MainWindow::loadConfig(const QString &fname)
ui->enableSSE41CheckBox->setChecked(!disabledCpuExts.contains("sse4.1", Qt::CaseInsensitive));
ui->enableNeonCheckBox->setChecked(!disabledCpuExts.contains("neon", Qt::CaseInsensitive));
QString hrtfmode = settings.value("hrtf-mode").toString().trimmed();
ui->hrtfqualitySlider->setValue(3);
ui->hrtfqualityLabel->setText(hrtfModeList[3].name);
/* The "basic" mode name is no longer supported. Use "ambi2" instead. */
if(hrtfmode == "basic") hrtfmode = "ambi2";
for(int i = 0;hrtfModeList[i].name[0];i++)
{
if(hrtfmode == hrtfModeList[i].value)
{
ui->hrtfqualitySlider->setValue(i);
ui->hrtfqualityLabel->setText(hrtfModeList[i].name);
break;
}
}
QStringList hrtf_paths = settings.value("hrtf-paths").toStringList();
if(hrtf_paths.size() == 1)
hrtf_paths = hrtf_paths[0].split(QChar(','));
@@ -973,6 +1001,8 @@ void MainWindow::saveConfig(const QString &fname) const
strlist.append("neon");
settings.setValue("disable-cpu-exts", strlist.join(QChar(',')));
settings.setValue("hrtf-mode", hrtfModeList[ui->hrtfqualitySlider->value()].value);
if(ui->hrtfStateComboBox->currentIndex() == 1)
settings.setValue("hrtf", "true");
else if(ui->hrtfStateComboBox->currentIndex() == 2)
@@ -1208,6 +1238,13 @@ void MainWindow::updateJackBufferSizeSlider()
}
void MainWindow::updateHrtfModeLabel(int num)
{
ui->hrtfqualityLabel->setText(hrtfModeList[num].name);
enableApplyButton();
}
void MainWindow::addHrtfFile()
{
QString path = QFileDialog::getExistingDirectory(this, tr("Select HRTF Path"));
+1
View File
@@ -43,6 +43,7 @@ private slots:
void updateJackBufferSizeEdit(int size);
void updateJackBufferSizeSlider();
void updateHrtfModeLabel(int num);
void addHrtfFile();
void removeHrtfFile();
+71
View File
@@ -1122,6 +1122,77 @@ application or system to determine if it should be used.</string>
<string>The default HRTF to use if the application doesn't request one.</string>
</property>
</widget>
<widget class="QGroupBox" name="groupBox_9">
<property name="geometry">
<rect>
<x>50</x>
<y>90</y>
<width>441</width>
<height>81</height>
</rect>
</property>
<property name="title">
<string>HRTF Quality</string>
</property>
<widget class="QLabel" name="label_31">
<property name="geometry">
<rect>
<x>20</x>
<y>30</y>
<width>51</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Speed</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_32">
<property name="geometry">
<rect>
<x>340</x>
<y>30</y>
<width>51</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Quality</string>
</property>
</widget>
<widget class="QSlider" name="hrtfqualitySlider">
<property name="geometry">
<rect>
<x>80</x>
<y>30</y>
<width>251</width>
<height>21</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QLabel" name="hrtfqualityLabel">
<property name="geometry">
<rect>
<x>50</x>
<y>50</y>
<width>321</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Default</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</widget>
</widget>
<widget class="QWidget" name="tab">
<attribute name="title">