Initial commit

added libraries:
opus
flac
libsndfile

updated:
libvorbis
libogg
openal

- Everything works as expected for now. Bare in mind libsndfile needed the check for whether or not it could find the xiph libraries removed in order for this to work.
This commit is contained in:
marauder2k7 2024-03-21 17:33:47 +00:00
parent 05a083ca6f
commit a745fc3757
1954 changed files with 431332 additions and 21037 deletions

View file

@ -21,7 +21,7 @@
namespace {
static const struct {
const struct {
char backend_name[16];
char full_string[32];
} backendList[] = {
@ -75,7 +75,7 @@ static const struct {
{ "", "" }
};
static const struct NameValuePair {
const struct NameValuePair {
const char name[64];
const char value[16];
} speakerModeList[] = {
@ -86,6 +86,7 @@ static const struct NameValuePair {
{ "5.1 Surround", "surround51" },
{ "6.1 Surround", "surround61" },
{ "7.1 Surround", "surround71" },
{ "3D7.1 Surround", "surround3d71" },
{ "Ambisonic, 1st Order", "ambi1" },
{ "Ambisonic, 2nd Order", "ambi2" },
@ -106,8 +107,8 @@ static const struct NameValuePair {
}, resamplerList[] = {
{ "Point", "point" },
{ "Linear", "linear" },
{ "Default (Linear)", "" },
{ "Cubic Spline", "cubic" },
{ "Default (Cubic Spline)", "" },
{ "11th order Sinc (fast)", "fast_bsinc12" },
{ "11th order Sinc", "bsinc12" },
{ "23rd order Sinc (fast)", "fast_bsinc24" },
@ -122,7 +123,7 @@ static const struct NameValuePair {
{ "", "" }
}, stereoEncList[] = {
{ "Default", "" },
{ "Pan Pot", "panpot" },
{ "Basic", "panpot" },
{ "UHJ", "uhj" },
{ "Binaural", "hrtf" },
@ -145,7 +146,7 @@ static const struct NameValuePair {
{ "", "" }
};
static QString getDefaultConfigName()
QString getDefaultConfigName()
{
#ifdef Q_OS_WIN32
static const char fname[] = "alsoft.ini";
@ -172,7 +173,7 @@ static QString getDefaultConfigName()
return fname;
}
static QString getBaseDataPath()
QString getBaseDataPath()
{
#ifdef Q_OS_WIN32
auto get_appdata_path = []() noexcept -> QString
@ -195,7 +196,7 @@ static QString getBaseDataPath()
return base;
}
static QStringList getAllDataPaths(const QString &append)
QStringList getAllDataPaths(const QString &append)
{
QStringList list;
list.append(getBaseDataPath());
@ -226,7 +227,7 @@ static QStringList getAllDataPaths(const QString &append)
}
template<size_t N>
static QString getValueFromName(const NameValuePair (&list)[N], const QString &str)
QString getValueFromName(const NameValuePair (&list)[N], const QString &str)
{
for(size_t i = 0;i < N-1;i++)
{
@ -237,7 +238,7 @@ static QString getValueFromName(const NameValuePair (&list)[N], const QString &s
}
template<size_t N>
static QString getNameFromValue(const NameValuePair (&list)[N], const QString &str)
QString getNameFromValue(const NameValuePair (&list)[N], const QString &str)
{
for(size_t i = 0;i < N-1;i++)
{
@ -307,7 +308,6 @@ MainWindow::MainWindow(QWidget *parent) :
for(count = 0;hrtfModeList[count].name[0];count++) {
}
ui->hrtfmodeSlider->setRange(0, count-1);
ui->hrtfStateComboBox->adjustSize();
#if !defined(HAVE_NEON) && !defined(HAVE_SSE)
ui->cpuExtDisabledLabel->move(ui->cpuExtDisabledLabel->x(), ui->cpuExtDisabledLabel->y() - 60);
@ -347,6 +347,12 @@ MainWindow::MainWindow(QWidget *parent) :
ui->enableSSE41CheckBox->setVisible(false);
#endif /* !SSE4.1 */
#endif
#ifndef ALSOFT_EAX
ui->enableEaxCheck->setChecked(Qt::Unchecked);
ui->enableEaxCheck->setEnabled(false);
ui->enableEaxCheck->setVisible(false);
#endif
mPeriodSizeValidator = new QIntValidator{64, 8192, this};
@ -397,7 +403,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->decoderDistCompCheckBox, &QCheckBox::stateChanged, this, &MainWindow::enableApplyButton);
connect(ui->decoderNFEffectsCheckBox, &QCheckBox::stateChanged, this, &MainWindow::enableApplyButton);
auto qdsb_vcd = static_cast<void(QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged);
connect(ui->decoderNFRefDelaySpinBox, qdsb_vcd, this, &MainWindow::enableApplyButton);
connect(ui->decoderSpeakerDistSpinBox, qdsb_vcd, this, &MainWindow::enableApplyButton);
connect(ui->decoderQuadLineEdit, &QLineEdit::textChanged, this, &MainWindow::enableApplyButton);
connect(ui->decoderQuadButton, &QPushButton::clicked, this, &MainWindow::selectQuadDecoderFile);
connect(ui->decoder51LineEdit, &QLineEdit::textChanged, this, &MainWindow::enableApplyButton);
@ -406,9 +412,10 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->decoder61Button, &QPushButton::clicked, this, &MainWindow::select61DecoderFile);
connect(ui->decoder71LineEdit, &QLineEdit::textChanged, this, &MainWindow::enableApplyButton);
connect(ui->decoder71Button, &QPushButton::clicked, this, &MainWindow::select71DecoderFile);
connect(ui->decoder3D71LineEdit, &QLineEdit::textChanged, this, &MainWindow::enableApplyButton);
connect(ui->decoder3D71Button, &QPushButton::clicked, this, &MainWindow::select3D71DecoderFile);
connect(ui->preferredHrtfComboBox, qcb_cicint, this, &MainWindow::enableApplyButton);
connect(ui->hrtfStateComboBox, qcb_cicint, this, &MainWindow::enableApplyButton);
connect(ui->hrtfmodeSlider, &QSlider::valueChanged, this, &MainWindow::updateHrtfModeLabel);
connect(ui->hrtfAddButton, &QPushButton::clicked, this, &MainWindow::addHrtfFile);
@ -448,6 +455,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->enableDedicatedCheck, &QCheckBox::stateChanged, this, &MainWindow::enableApplyButton);
connect(ui->enablePitchShifterCheck, &QCheckBox::stateChanged, this, &MainWindow::enableApplyButton);
connect(ui->enableVocalMorpherCheck, &QCheckBox::stateChanged, this, &MainWindow::enableApplyButton);
connect(ui->enableEaxCheck, &QCheckBox::stateChanged, this, &MainWindow::enableApplyButton);
connect(ui->pulseAutospawnCheckBox, &QCheckBox::stateChanged, this, &MainWindow::enableApplyButton);
connect(ui->pulseAllowMovesCheckBox, &QCheckBox::stateChanged, this, &MainWindow::enableApplyButton);
@ -455,6 +463,9 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->pulseAdjLatencyCheckBox, &QCheckBox::stateChanged, this, &MainWindow::enableApplyButton);
connect(ui->pwireAssumeAudioCheckBox, &QCheckBox::stateChanged, this, &MainWindow::enableApplyButton);
connect(ui->pwireRtMixCheckBox, &QCheckBox::stateChanged, this, &MainWindow::enableApplyButton);
connect(ui->wasapiResamplerCheckBox, &QCheckBox::stateChanged, this, &MainWindow::enableApplyButton);
connect(ui->jackAutospawnCheckBox, &QCheckBox::stateChanged, this, &MainWindow::enableApplyButton);
connect(ui->jackConnectPortsCheckBox, &QCheckBox::stateChanged, this, &MainWindow::enableApplyButton);
@ -752,13 +763,14 @@ void MainWindow::loadConfig(const QString &fname)
ui->decoderHQModeCheckBox->setChecked(getCheckState(settings.value("decoder/hq-mode")));
ui->decoderDistCompCheckBox->setCheckState(getCheckState(settings.value("decoder/distance-comp")));
ui->decoderNFEffectsCheckBox->setCheckState(getCheckState(settings.value("decoder/nfc")));
double refdelay{settings.value("decoder/nfc-ref-delay", 0.0).toDouble()};
ui->decoderNFRefDelaySpinBox->setValue(refdelay);
double speakerdist{settings.value("decoder/speaker-dist", 1.0).toDouble()};
ui->decoderSpeakerDistSpinBox->setValue(speakerdist);
ui->decoderQuadLineEdit->setText(settings.value("decoder/quad").toString());
ui->decoder51LineEdit->setText(settings.value("decoder/surround51").toString());
ui->decoder61LineEdit->setText(settings.value("decoder/surround61").toString());
ui->decoder71LineEdit->setText(settings.value("decoder/surround71").toString());
ui->decoder3D71LineEdit->setText(settings.value("decoder/surround3d71").toString());
QStringList disabledCpuExts{settings.value("disable-cpu-exts").toStringList()};
if(disabledCpuExts.size() == 1)
@ -804,14 +816,6 @@ void MainWindow::loadConfig(const QString &fname)
ui->hrtfFileList->addItems(hrtf_paths);
updateHrtfRemoveButton();
QString hrtfstate{settings.value("hrtf").toString().toLower()};
if(hrtfstate == "true")
ui->hrtfStateComboBox->setCurrentIndex(1);
else if(hrtfstate == "false")
ui->hrtfStateComboBox->setCurrentIndex(2);
else
ui->hrtfStateComboBox->setCurrentIndex(0);
ui->preferredHrtfComboBox->clear();
ui->preferredHrtfComboBox->addItem("- Any -");
if(ui->defaultHrtfPathsCheckBox->isChecked())
@ -840,7 +844,7 @@ void MainWindow::loadConfig(const QString &fname)
ui->enabledBackendList->clear();
ui->disabledBackendList->clear();
QStringList drivers{settings.value("drivers").toStringList()};
if(drivers.size() == 0)
if(drivers.empty())
ui->backendCheckBox->setChecked(true);
else
{
@ -922,14 +926,18 @@ void MainWindow::loadConfig(const QString &fname)
ui->enableDedicatedCheck->setChecked(!excludefx.contains("dedicated", Qt::CaseInsensitive));
ui->enablePitchShifterCheck->setChecked(!excludefx.contains("pshifter", Qt::CaseInsensitive));
ui->enableVocalMorpherCheck->setChecked(!excludefx.contains("vmorpher", Qt::CaseInsensitive));
if(ui->enableEaxCheck->isEnabled())
ui->enableEaxCheck->setChecked(getCheckState(settings.value("eax/enable")) != Qt::Unchecked);
ui->pulseAutospawnCheckBox->setCheckState(getCheckState(settings.value("pulse/spawn-server")));
ui->pulseAllowMovesCheckBox->setCheckState(getCheckState(settings.value("pulse/allow-moves")));
ui->pulseFixRateCheckBox->setCheckState(getCheckState(settings.value("pulse/fix-rate")));
ui->pulseAdjLatencyCheckBox->setCheckState(getCheckState(settings.value("pulse/adjust-latency")));
ui->pwireAssumeAudioCheckBox->setCheckState(settings.value("pipewire/assume-audio").toBool()
? Qt::Checked : Qt::Unchecked);
ui->pwireAssumeAudioCheckBox->setCheckState(getCheckState(settings.value("pipewire/assume-audio")));
ui->pwireRtMixCheckBox->setCheckState(getCheckState(settings.value("pipewire/rt-mix")));
ui->wasapiResamplerCheckBox->setCheckState(getCheckState(settings.value("wasapi/allow-resampler")));
ui->jackAutospawnCheckBox->setCheckState(getCheckState(settings.value("jack/spawn-server")));
ui->jackConnectPortsCheckBox->setCheckState(getCheckState(settings.value("jack/connect-ports")));
@ -1016,15 +1024,16 @@ void MainWindow::saveConfig(const QString &fname) const
settings.setValue("decoder/hq-mode", getCheckValue(ui->decoderHQModeCheckBox));
settings.setValue("decoder/distance-comp", getCheckValue(ui->decoderDistCompCheckBox));
settings.setValue("decoder/nfc", getCheckValue(ui->decoderNFEffectsCheckBox));
double refdelay = ui->decoderNFRefDelaySpinBox->value();
settings.setValue("decoder/nfc-ref-delay",
(refdelay > 0.0) ? QString::number(refdelay) : QString{}
double speakerdist{ui->decoderSpeakerDistSpinBox->value()};
settings.setValue("decoder/speaker-dist",
(speakerdist != 1.0) ? QString::number(speakerdist) : QString{}
);
settings.setValue("decoder/quad", ui->decoderQuadLineEdit->text());
settings.setValue("decoder/surround51", ui->decoder51LineEdit->text());
settings.setValue("decoder/surround61", ui->decoder61LineEdit->text());
settings.setValue("decoder/surround71", ui->decoder71LineEdit->text());
settings.setValue("decoder/surround3d71", ui->decoder3D71LineEdit->text());
QStringList strlist;
if(!ui->enableSSECheckBox->isChecked())
@ -1041,13 +1050,6 @@ void MainWindow::saveConfig(const QString &fname) const
settings.setValue("hrtf-mode", hrtfModeList[ui->hrtfmodeSlider->value()].value);
if(ui->hrtfStateComboBox->currentIndex() == 1)
settings.setValue("hrtf", "true");
else if(ui->hrtfStateComboBox->currentIndex() == 2)
settings.setValue("hrtf", "false");
else
settings.setValue("hrtf", QString{});
if(ui->preferredHrtfComboBox->currentIndex() == 0)
settings.setValue("default-hrtf", QString{});
else
@ -1089,7 +1091,7 @@ void MainWindow::saveConfig(const QString &fname) const
}
}
}
if(strlist.size() == 0 && !ui->backendCheckBox->isChecked())
if(strlist.empty() && !ui->backendCheckBox->isChecked())
strlist.append("-all");
else if(ui->backendCheckBox->isChecked())
strlist.append(QString{});
@ -1134,15 +1136,20 @@ void MainWindow::saveConfig(const QString &fname) const
if(!ui->enableVocalMorpherCheck->isChecked())
strlist.append("vmorpher");
settings.setValue("excludefx", strlist.join(QChar{','}));
settings.setValue("eax/enable",
(!ui->enableEaxCheck->isEnabled() || ui->enableEaxCheck->isChecked())
? QString{/*"true"*/} : QString{"false"});
settings.setValue("pipewire/assume-audio", getCheckValue(ui->pwireAssumeAudioCheckBox));
settings.setValue("pipewire/rt-mix", getCheckValue(ui->pwireRtMixCheckBox));
settings.setValue("wasapi/allow-resampler", getCheckValue(ui->wasapiResamplerCheckBox));
settings.setValue("pulse/spawn-server", getCheckValue(ui->pulseAutospawnCheckBox));
settings.setValue("pulse/allow-moves", getCheckValue(ui->pulseAllowMovesCheckBox));
settings.setValue("pulse/fix-rate", getCheckValue(ui->pulseFixRateCheckBox));
settings.setValue("pulse/adjust-latency", getCheckValue(ui->pulseAdjLatencyCheckBox));
settings.setValue("pipewire/assume-audio", ui->pwireAssumeAudioCheckBox->isChecked()
? QString{"true"} : QString{/*"false"*/});
settings.setValue("jack/spawn-server", getCheckValue(ui->jackAutospawnCheckBox));
settings.setValue("jack/connect-ports", getCheckValue(ui->jackConnectPortsCheckBox));
settings.setValue("jack/rt-mix", getCheckValue(ui->jackRtMixCheckBox));
@ -1240,6 +1247,8 @@ void MainWindow::select61DecoderFile()
{ selectDecoderFile(ui->decoder61LineEdit, "Select 6.1 Surround Decoder");}
void MainWindow::select71DecoderFile()
{ selectDecoderFile(ui->decoder71LineEdit, "Select 7.1 Surround Decoder");}
void MainWindow::select3D71DecoderFile()
{ selectDecoderFile(ui->decoder3D71LineEdit, "Select 3D7.1 Surround Decoder");}
void MainWindow::selectDecoderFile(QLineEdit *line, const char *caption)
{
QString dir{line->text()};
@ -1313,7 +1322,7 @@ void MainWindow::removeHrtfFile()
void MainWindow::updateHrtfRemoveButton()
{
ui->hrtfRemoveButton->setEnabled(ui->hrtfFileList->selectedItems().size() != 0);
ui->hrtfRemoveButton->setEnabled(!ui->hrtfFileList->selectedItems().empty());
}
void MainWindow::showEnabledBackendMenu(QPoint pt)
@ -1324,7 +1333,7 @@ void MainWindow::showEnabledBackendMenu(QPoint pt)
QMenu ctxmenu;
QAction *removeAction{ctxmenu.addAction(QIcon::fromTheme("list-remove"), "Remove")};
if(ui->enabledBackendList->selectedItems().size() == 0)
if(ui->enabledBackendList->selectedItems().empty())
removeAction->setEnabled(false);
ctxmenu.addSeparator();
for(size_t i = 0;backendList[i].backend_name[0];i++)
@ -1332,8 +1341,8 @@ void MainWindow::showEnabledBackendMenu(QPoint pt)
QString backend{backendList[i].full_string};
QAction *action{ctxmenu.addAction(QString("Add ")+backend)};
actionMap[action] = backend;
if(ui->enabledBackendList->findItems(backend, Qt::MatchFixedString).size() != 0 ||
ui->disabledBackendList->findItems(backend, Qt::MatchFixedString).size() != 0)
if(!ui->enabledBackendList->findItems(backend, Qt::MatchFixedString).empty() ||
!ui->disabledBackendList->findItems(backend, Qt::MatchFixedString).empty())
action->setEnabled(false);
}
@ -1362,7 +1371,7 @@ void MainWindow::showDisabledBackendMenu(QPoint pt)
QMenu ctxmenu;
QAction *removeAction{ctxmenu.addAction(QIcon::fromTheme("list-remove"), "Remove")};
if(ui->disabledBackendList->selectedItems().size() == 0)
if(ui->disabledBackendList->selectedItems().empty())
removeAction->setEnabled(false);
ctxmenu.addSeparator();
for(size_t i = 0;backendList[i].backend_name[0];i++)
@ -1370,8 +1379,8 @@ void MainWindow::showDisabledBackendMenu(QPoint pt)
QString backend{backendList[i].full_string};
QAction *action{ctxmenu.addAction(QString("Add ")+backend)};
actionMap[action] = backend;
if(ui->disabledBackendList->findItems(backend, Qt::MatchFixedString).size() != 0 ||
ui->enabledBackendList->findItems(backend, Qt::MatchFixedString).size() != 0)
if(!ui->disabledBackendList->findItems(backend, Qt::MatchFixedString).empty() ||
!ui->enabledBackendList->findItems(backend, Qt::MatchFixedString).empty())
action->setEnabled(false);
}