aboutsummaryrefslogtreecommitdiffstats
path: root/utils/alsoft-config
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-07-04 22:59:12 -0700
committerChris Robinson <[email protected]>2019-07-04 22:59:12 -0700
commit3edbeefdb73b650d466b76583c8dac664d4d6ee0 (patch)
tree05296857420c71da8866dcf9365018c76c6ac5ac /utils/alsoft-config
parent474073955bd76f868d97a4fb587ec4c37b29f7f7 (diff)
Add a setting for hrtf-mode to alsoft-config
Diffstat (limited to 'utils/alsoft-config')
-rw-r--r--utils/alsoft-config/mainwindow.cpp37
-rw-r--r--utils/alsoft-config/mainwindow.h1
-rw-r--r--utils/alsoft-config/mainwindow.ui71
3 files changed, 109 insertions, 0 deletions
diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp
index 4e2b2464..687f9134 100644
--- a/utils/alsoft-config/mainwindow.cpp
+++ b/utils/alsoft-config/mainwindow.cpp
@@ -124,6 +124,14 @@ static const struct NameValuePair {
{ "Furse-Malham", "fuma" },
{ "", "" }
+}, hrtfModeList[] = {
+ { "1st Order Ambisonic", "ambi1" },
+ { "2nd Order Ambisonic", "ambi2" },
+ { "3rd Order Ambisonic", "ambi3" },
+ { "Default (Full)", "" },
+ { "Full", "full" },
+
+ { "", "" }
};
static QString getDefaultConfigName()
@@ -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"));
diff --git a/utils/alsoft-config/mainwindow.h b/utils/alsoft-config/mainwindow.h
index 8b763845..ca53582b 100644
--- a/utils/alsoft-config/mainwindow.h
+++ b/utils/alsoft-config/mainwindow.h
@@ -43,6 +43,7 @@ private slots:
void updateJackBufferSizeEdit(int size);
void updateJackBufferSizeSlider();
+ void updateHrtfModeLabel(int num);
void addHrtfFile();
void removeHrtfFile();
diff --git a/utils/alsoft-config/mainwindow.ui b/utils/alsoft-config/mainwindow.ui
index 46d1b7a8..7ab27c09 100644
--- a/utils/alsoft-config/mainwindow.ui
+++ b/utils/alsoft-config/mainwindow.ui
@@ -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">