mirror of
https://github.com/love2d/megasource.git
synced 2026-08-17 11:11:35 +02:00
Added missing changes to the OpenAL-Soft update.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QSettings>
|
||||
@@ -10,26 +13,92 @@ static const struct {
|
||||
char backend_name[16];
|
||||
char menu_string[32];
|
||||
} backendMenuList[] = {
|
||||
#ifdef Q_OS_WIN32
|
||||
{ "mmdevapi", "Add MMDevAPI" },
|
||||
{ "dsound", "Add DirectSound" },
|
||||
{ "winmm", "Add Windows Multimedia" },
|
||||
#ifdef HAVE_JACK
|
||||
{ "jack", "Add JACK" },
|
||||
#endif
|
||||
#ifdef Q_OS_MAC
|
||||
#ifdef HAVE_PULSEAUDIO
|
||||
{ "pulse", "Add PulseAudio" },
|
||||
#endif
|
||||
#ifdef HAVE_ALSA
|
||||
{ "alsa", "Add ALSA" },
|
||||
#endif
|
||||
#ifdef HAVE_COREAUDIO
|
||||
{ "core", "Add CoreAudio" },
|
||||
#endif
|
||||
{ "pulse", "Add PulseAudio" },
|
||||
#ifdef Q_OS_UNIX
|
||||
{ "alsa", "Add ALSA" },
|
||||
#ifdef HAVE_OSS
|
||||
{ "oss", "Add OSS" },
|
||||
#endif
|
||||
#ifdef HAVE_SOLARIS
|
||||
{ "solaris", "Add Solaris" },
|
||||
#endif
|
||||
#ifdef HAVE_SNDIO
|
||||
{ "sndio", "Add SndIO" },
|
||||
#endif
|
||||
#ifdef HAVE_QSA
|
||||
{ "qsa", "Add QSA" },
|
||||
#endif
|
||||
#ifdef HAVE_MMDEVAPI
|
||||
{ "mmdevapi", "Add MMDevAPI" },
|
||||
#endif
|
||||
#ifdef HAVE_DSOUND
|
||||
{ "dsound", "Add DirectSound" },
|
||||
#endif
|
||||
#ifdef HAVE_WINMM
|
||||
{ "winmm", "Add Windows Multimedia" },
|
||||
#endif
|
||||
#ifdef HAVE_PORTAUDIO
|
||||
{ "port", "Add PortAudio" },
|
||||
#endif
|
||||
#ifdef HAVE_OPENSL
|
||||
{ "opensl", "Add OpenSL" },
|
||||
#endif
|
||||
|
||||
{ "null", "Add Null Output" },
|
||||
#ifdef HAVE_WAVE
|
||||
{ "wave", "Add Wave Writer" },
|
||||
#endif
|
||||
{ "", "" }
|
||||
};
|
||||
|
||||
static const struct {
|
||||
const char name[64];
|
||||
const char value[16];
|
||||
} speakerModeList[] = {
|
||||
{ "Autodetect", "" },
|
||||
{ "Mono", "mono" },
|
||||
{ "Stereo", "stereo" },
|
||||
{ "Quadrophonic", "quad" },
|
||||
{ "5.1 Surround (Side)", "surround51" },
|
||||
{ "5.1 Surround (Rear)", "surround51rear" },
|
||||
{ "6.1 Surround", "surround61" },
|
||||
{ "7.1 Surround", "surround71" },
|
||||
|
||||
{ "", "" }
|
||||
}, sampleTypeList[] = {
|
||||
{ "Autodetect", "" },
|
||||
{ "8-bit int", "int8" },
|
||||
{ "8-bit uint", "uint8" },
|
||||
{ "16-bit int", "int16" },
|
||||
{ "16-bit uint", "uint16" },
|
||||
{ "32-bit int", "int32" },
|
||||
{ "32-bit uint", "uint32" },
|
||||
{ "32-bit float", "float32" },
|
||||
|
||||
{ "", "" }
|
||||
}, resamplerList[] = {
|
||||
{ "Default", "" },
|
||||
{ "Point (low quality, very fast)", "point" },
|
||||
{ "Linear (basic quality, fast)", "linear" },
|
||||
{ "4-Point Sinc (good quality)", "sinc4" },
|
||||
{ "8-Point Sinc (high quality, slow)", "sinc8" },
|
||||
{ "Band-limited Sinc (very high quality, very slow)", "bsinc" },
|
||||
|
||||
{ "", "" }
|
||||
}, stereoModeList[] = {
|
||||
{ "Autodetect", "" },
|
||||
{ "Speakers", "speakers" },
|
||||
{ "Headphones", "headphones" },
|
||||
|
||||
{ "", "" }
|
||||
};
|
||||
|
||||
@@ -104,11 +173,65 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
mSourceCountValidator(NULL),
|
||||
mEffectSlotValidator(NULL),
|
||||
mSourceSendValidator(NULL),
|
||||
mSampleRateValidator(NULL),
|
||||
mReverbBoostValidator(NULL)
|
||||
mSampleRateValidator(NULL)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
for(int i = 0;speakerModeList[i].name[0];i++)
|
||||
ui->channelConfigCombo->addItem(speakerModeList[i].name);
|
||||
ui->channelConfigCombo->adjustSize();
|
||||
for(int i = 0;sampleTypeList[i].name[0];i++)
|
||||
ui->sampleFormatCombo->addItem(sampleTypeList[i].name);
|
||||
ui->sampleFormatCombo->adjustSize();
|
||||
for(int i = 0;resamplerList[i].name[0];i++)
|
||||
ui->resamplerComboBox->addItem(resamplerList[i].name);
|
||||
ui->resamplerComboBox->adjustSize();
|
||||
for(int i = 0;stereoModeList[i].name[0];i++)
|
||||
ui->stereoModeCombo->addItem(stereoModeList[i].name);
|
||||
ui->stereoModeCombo->adjustSize();
|
||||
|
||||
ui->hrtfStateComboBox->adjustSize();
|
||||
|
||||
#if !defined(HAVE_NEON) && !defined(HAVE_SSE)
|
||||
ui->cpuExtDisabledLabel->move(ui->cpuExtDisabledLabel->x(), ui->cpuExtDisabledLabel->y() - 60);
|
||||
#else
|
||||
ui->cpuExtDisabledLabel->setVisible(false);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_NEON
|
||||
|
||||
#ifndef HAVE_SSE4_1
|
||||
#ifndef HAVE_SSE3
|
||||
#ifndef HAVE_SSE2
|
||||
#ifndef HAVE_SSE
|
||||
ui->enableSSECheckBox->setVisible(false);
|
||||
#endif /* !SSE */
|
||||
ui->enableSSE2CheckBox->setVisible(false);
|
||||
#endif /* !SSE2 */
|
||||
ui->enableSSE3CheckBox->setVisible(false);
|
||||
#endif /* !SSE3 */
|
||||
ui->enableSSE41CheckBox->setVisible(false);
|
||||
#endif /* !SSE4.1 */
|
||||
ui->enableNeonCheckBox->setVisible(false);
|
||||
|
||||
#else /* !Neon */
|
||||
|
||||
#ifndef HAVE_SSE4_1
|
||||
#ifndef HAVE_SSE3
|
||||
#ifndef HAVE_SSE2
|
||||
#ifndef HAVE_SSE
|
||||
ui->enableNeonCheckBox->move(ui->enableNeonCheckBox->x(), ui->enableNeonCheckBox->y() - 30);
|
||||
ui->enableSSECheckBox->setVisible(false);
|
||||
#endif /* !SSE */
|
||||
ui->enableSSE2CheckBox->setVisible(false);
|
||||
#endif /* !SSE2 */
|
||||
ui->enableSSE3CheckBox->setVisible(false);
|
||||
#endif /* !SSE3 */
|
||||
ui->enableSSE41CheckBox->setVisible(false);
|
||||
#endif /* !SSE4.1 */
|
||||
|
||||
#endif
|
||||
|
||||
mPeriodSizeValidator = new QIntValidator(64, 8192, this);
|
||||
ui->periodSizeEdit->setValidator(mPeriodSizeValidator);
|
||||
mPeriodCountValidator = new QIntValidator(2, 16, this);
|
||||
@@ -123,9 +246,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
mSampleRateValidator = new QIntValidator(8000, 192000, this);
|
||||
ui->sampleRateCombo->lineEdit()->setValidator(mSampleRateValidator);
|
||||
|
||||
mReverbBoostValidator = new QDoubleValidator(-12.0, +12.0, 1, this);
|
||||
ui->reverbBoostEdit->setValidator(mReverbBoostValidator);
|
||||
|
||||
connect(ui->actionLoad, SIGNAL(triggered()), this, SLOT(loadConfigFromFile()));
|
||||
connect(ui->actionSave_As, SIGNAL(triggered()), this, SLOT(saveConfigAsFile()));
|
||||
|
||||
@@ -146,9 +266,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
ui->disabledBackendList->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(ui->disabledBackendList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showDisabledBackendMenu(QPoint)));
|
||||
|
||||
connect(ui->reverbBoostSlider, SIGNAL(valueChanged(int)), this, SLOT(updateReverbBoostEdit(int)));
|
||||
connect(ui->reverbBoostEdit, SIGNAL(textEdited(QString)), this, SLOT(updateReverbBoostSlider(QString)));
|
||||
|
||||
loadConfig(getDefaultConfigName());
|
||||
}
|
||||
|
||||
@@ -161,7 +278,6 @@ MainWindow::~MainWindow()
|
||||
delete mEffectSlotValidator;
|
||||
delete mSourceSendValidator;
|
||||
delete mSampleRateValidator;
|
||||
delete mReverbBoostValidator;
|
||||
}
|
||||
|
||||
void MainWindow::loadConfigFromFile()
|
||||
@@ -179,12 +295,19 @@ void MainWindow::loadConfig(const QString &fname)
|
||||
ui->sampleFormatCombo->setCurrentIndex(0);
|
||||
if(sampletype.isEmpty() == false)
|
||||
{
|
||||
for(int i = 1;i < ui->sampleFormatCombo->count();i++)
|
||||
for(int i = 0;sampleTypeList[i].name[i];i++)
|
||||
{
|
||||
QString item = ui->sampleFormatCombo->itemText(i);
|
||||
if(item.startsWith(sampletype))
|
||||
if(sampletype == sampleTypeList[i].value)
|
||||
{
|
||||
ui->sampleFormatCombo->setCurrentIndex(i);
|
||||
for(int j = 1;j < ui->sampleFormatCombo->count();j++)
|
||||
{
|
||||
QString item = ui->sampleFormatCombo->itemText(j);
|
||||
if(item == sampleTypeList[i].name)
|
||||
{
|
||||
ui->sampleFormatCombo->setCurrentIndex(j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -194,12 +317,19 @@ void MainWindow::loadConfig(const QString &fname)
|
||||
ui->channelConfigCombo->setCurrentIndex(0);
|
||||
if(channelconfig.isEmpty() == false)
|
||||
{
|
||||
for(int i = 1;i < ui->channelConfigCombo->count();i++)
|
||||
for(int i = 0;speakerModeList[i].name[i];i++)
|
||||
{
|
||||
QString item = ui->channelConfigCombo->itemText(i);
|
||||
if(item.startsWith(channelconfig))
|
||||
if(channelconfig == speakerModeList[i].value)
|
||||
{
|
||||
ui->channelConfigCombo->setCurrentIndex(i);
|
||||
for(int j = 1;j < ui->channelConfigCombo->count();j++)
|
||||
{
|
||||
QString item = ui->channelConfigCombo->itemText(j);
|
||||
if(item == speakerModeList[i].name)
|
||||
{
|
||||
ui->channelConfigCombo->setCurrentIndex(j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -222,18 +352,49 @@ void MainWindow::loadConfig(const QString &fname)
|
||||
ui->srcSendLineEdit->insert(settings.value("sends").toString());
|
||||
|
||||
QString resampler = settings.value("resampler").toString().trimmed();
|
||||
if(resampler.isEmpty())
|
||||
ui->resamplerComboBox->setCurrentIndex(0);
|
||||
else
|
||||
ui->resamplerComboBox->setCurrentIndex(0);
|
||||
if(resampler.isEmpty() == false)
|
||||
{
|
||||
for(int i = 1;i < ui->resamplerComboBox->count();i++)
|
||||
/* The "cubic" resampler is no longer supported. It's been replaced by
|
||||
* "sinc4". */
|
||||
if(resampler == "cubic")
|
||||
resampler = "sinc4";
|
||||
|
||||
for(int i = 0;resamplerList[i].name[i];i++)
|
||||
{
|
||||
QString item = ui->resamplerComboBox->itemText(i);
|
||||
int end = item.indexOf(' ');
|
||||
if(end < 0) end = item.size();
|
||||
if(resampler.size() == end && resampler.compare(item.leftRef(end), Qt::CaseInsensitive) == 0)
|
||||
if(resampler == resamplerList[i].value)
|
||||
{
|
||||
ui->resamplerComboBox->setCurrentIndex(i);
|
||||
for(int j = 1;j < ui->resamplerComboBox->count();j++)
|
||||
{
|
||||
QString item = ui->resamplerComboBox->itemText(j);
|
||||
if(item == resamplerList[i].name)
|
||||
{
|
||||
ui->resamplerComboBox->setCurrentIndex(j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString stereomode = settings.value("stereo-mode").toString().trimmed();
|
||||
ui->stereoModeCombo->setCurrentIndex(0);
|
||||
if(stereomode.isEmpty() == false)
|
||||
{
|
||||
for(int i = 0;stereoModeList[i].name[i];i++)
|
||||
{
|
||||
if(stereomode == stereoModeList[i].value)
|
||||
{
|
||||
for(int j = 1;j < ui->stereoModeCombo->count();j++)
|
||||
{
|
||||
QString item = ui->stereoModeCombo->itemText(j);
|
||||
if(item == stereoModeList[i].name)
|
||||
{
|
||||
ui->stereoModeCombo->setCurrentIndex(j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -262,17 +423,18 @@ void MainWindow::loadConfig(const QString &fname)
|
||||
disabledCpuExts.begin(), std::mem_fun_ref(&QString::trimmed));
|
||||
ui->enableSSECheckBox->setChecked(!disabledCpuExts.contains("sse", Qt::CaseInsensitive));
|
||||
ui->enableSSE2CheckBox->setChecked(!disabledCpuExts.contains("sse2", Qt::CaseInsensitive));
|
||||
ui->enableSSE3CheckBox->setChecked(!disabledCpuExts.contains("sse3", Qt::CaseInsensitive));
|
||||
ui->enableSSE41CheckBox->setChecked(!disabledCpuExts.contains("sse4.1", Qt::CaseInsensitive));
|
||||
ui->enableNeonCheckBox->setChecked(!disabledCpuExts.contains("neon", Qt::CaseInsensitive));
|
||||
|
||||
if(settings.value("hrtf").toString() == QString())
|
||||
ui->hrtfEnableButton->setChecked(true);
|
||||
ui->hrtfStateComboBox->setCurrentIndex(0);
|
||||
else
|
||||
{
|
||||
if(settings.value("hrtf", true).toBool())
|
||||
ui->hrtfForceButton->setChecked(true);
|
||||
ui->hrtfStateComboBox->setCurrentIndex(1);
|
||||
else
|
||||
ui->hrtfDisableButton->setChecked(true);
|
||||
ui->hrtfStateComboBox->setCurrentIndex(2);
|
||||
}
|
||||
|
||||
QStringList hrtf_tables = settings.value("hrtf_tables").toStringList();
|
||||
@@ -323,8 +485,6 @@ void MainWindow::loadConfig(const QString &fname)
|
||||
}
|
||||
|
||||
ui->emulateEaxCheckBox->setChecked(settings.value("reverb/emulate-eax", false).toBool());
|
||||
ui->reverbBoostEdit->clear();
|
||||
ui->reverbBoostEdit->insert(settings.value("reverb/boost").toString());
|
||||
|
||||
QStringList excludefx = settings.value("excludefx").toStringList();
|
||||
if(excludefx.size() == 1)
|
||||
@@ -371,15 +531,27 @@ void MainWindow::saveConfig(const QString &fname) const
|
||||
}
|
||||
|
||||
QString str = ui->sampleFormatCombo->currentText();
|
||||
str.truncate(str.indexOf('-'));
|
||||
settings.setValue("sample-type", str.trimmed());
|
||||
for(int i = 0;sampleTypeList[i].name[0];i++)
|
||||
{
|
||||
if(str == sampleTypeList[i].name)
|
||||
{
|
||||
settings.setValue("sample-type", sampleTypeList[i].value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
str = ui->channelConfigCombo->currentText();
|
||||
str.truncate(str.indexOf('-'));
|
||||
settings.setValue("channels", str.trimmed());
|
||||
for(int i = 0;speakerModeList[i].name[0];i++)
|
||||
{
|
||||
if(str == speakerModeList[i].name)
|
||||
{
|
||||
settings.setValue("channels", speakerModeList[i].value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint rate = ui->sampleRateCombo->currentText().toUInt();
|
||||
if(rate == 0)
|
||||
if(!(rate > 0))
|
||||
settings.setValue("frequency", QString());
|
||||
else
|
||||
settings.setValue("frequency", rate);
|
||||
@@ -390,12 +562,24 @@ void MainWindow::saveConfig(const QString &fname) const
|
||||
settings.setValue("sources", ui->srcCountLineEdit->text());
|
||||
settings.setValue("slots", ui->effectSlotLineEdit->text());
|
||||
|
||||
if(ui->resamplerComboBox->currentIndex() == 0)
|
||||
settings.setValue("resampler", QString());
|
||||
else
|
||||
str = ui->resamplerComboBox->currentText();
|
||||
for(int i = 0;resamplerList[i].name[0];i++)
|
||||
{
|
||||
str = ui->resamplerComboBox->currentText();
|
||||
settings.setValue("resampler", str.split(' ').first().toLower());
|
||||
if(str == resamplerList[i].name)
|
||||
{
|
||||
settings.setValue("resampler", resamplerList[i].value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
str = ui->stereoModeCombo->currentText();
|
||||
for(int i = 0;stereoModeList[i].name[0];i++)
|
||||
{
|
||||
if(str == stereoModeList[i].name)
|
||||
{
|
||||
settings.setValue("stereo-mode", stereoModeList[i].value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QStringList strlist;
|
||||
@@ -403,15 +587,17 @@ void MainWindow::saveConfig(const QString &fname) const
|
||||
strlist.append("sse");
|
||||
if(!ui->enableSSE2CheckBox->isChecked())
|
||||
strlist.append("sse2");
|
||||
if(!ui->enableSSE3CheckBox->isChecked())
|
||||
strlist.append("sse3");
|
||||
if(!ui->enableSSE41CheckBox->isChecked())
|
||||
strlist.append("sse4.1");
|
||||
if(!ui->enableNeonCheckBox->isChecked())
|
||||
strlist.append("neon");
|
||||
settings.setValue("disable-cpu-exts", strlist.join(QChar(',')));
|
||||
|
||||
if(ui->hrtfForceButton->isChecked())
|
||||
if(ui->hrtfStateComboBox->currentIndex() == 1)
|
||||
settings.setValue("hrtf", "true");
|
||||
else if(ui->hrtfDisableButton->isChecked())
|
||||
else if(ui->hrtfStateComboBox->currentIndex() == 2)
|
||||
settings.setValue("hrtf", "false");
|
||||
else
|
||||
settings.setValue("hrtf", QString());
|
||||
@@ -449,12 +635,6 @@ void MainWindow::saveConfig(const QString &fname) const
|
||||
else
|
||||
settings.setValue("reverb/emulate-eax", QString()/*"false"*/);
|
||||
|
||||
// TODO: Remove check when we can properly match global values.
|
||||
if(ui->reverbBoostSlider->sliderPosition() == 0)
|
||||
settings.setValue("reverb/boost", QString());
|
||||
else
|
||||
settings.setValue("reverb/boost", ui->reverbBoostEdit->text());
|
||||
|
||||
strlist.clear();
|
||||
if(!ui->enableEaxReverbCheck->isChecked())
|
||||
strlist.append("eaxreverb");
|
||||
@@ -645,16 +825,3 @@ void MainWindow::showDisabledBackendMenu(QPoint pt)
|
||||
ui->disabledBackendList->addItem(iter.value());
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::updateReverbBoostEdit(int value)
|
||||
{
|
||||
ui->reverbBoostEdit->clear();
|
||||
if(value != 0)
|
||||
ui->reverbBoostEdit->insert(QString::number(value/10.0, 'f', 1));
|
||||
}
|
||||
|
||||
void MainWindow::updateReverbBoostSlider(QString value)
|
||||
{
|
||||
int pos = int(value.toFloat()*10.0f);
|
||||
ui->reverbBoostSlider->setSliderPosition(pos);
|
||||
}
|
||||
|
||||
@@ -35,9 +35,6 @@ private slots:
|
||||
void showEnabledBackendMenu(QPoint pt);
|
||||
void showDisabledBackendMenu(QPoint pt);
|
||||
|
||||
void updateReverbBoostEdit(int size);
|
||||
void updateReverbBoostSlider(QString value);
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
|
||||
@@ -47,7 +44,6 @@ private:
|
||||
QValidator *mEffectSlotValidator;
|
||||
QValidator *mSourceSendValidator;
|
||||
QValidator *mSampleRateValidator;
|
||||
QValidator *mReverbBoostValidator;
|
||||
|
||||
void loadConfig(const QString &fname);
|
||||
void saveConfig(const QString &fname) const;
|
||||
|
||||
@@ -57,8 +57,8 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>20</y>
|
||||
<width>188</width>
|
||||
<y>50</y>
|
||||
<width>78</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -69,52 +69,12 @@ float and converted to the output sample type as needed.</string>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>- Autodetect -</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>int8 - signed 8-bit int</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>uint8 - unsigned 8-bit int</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>int16 - signed 16-bit int</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>uint16 - unsigned 16-bit int</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>int32 - signed 32-bit int</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>uint32 - unsigned 32-bit int</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>float32 - 32-bit float</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<y>50</y>
|
||||
<width>101</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
@@ -130,7 +90,7 @@ float and converted to the output sample type as needed.</string>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>50</y>
|
||||
<y>20</y>
|
||||
<width>101</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
@@ -146,8 +106,8 @@ float and converted to the output sample type as needed.</string>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>50</y>
|
||||
<width>227</width>
|
||||
<y>20</y>
|
||||
<width>78</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -159,48 +119,13 @@ to stereo output.</string>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>- Autodetect -</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>mono - 1-channel Mono</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>stereo - 2-channel Stereo</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>quad - 4-channel Quadraphonic</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>surround51 - 5.1 Surround Sound</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>surround61 - 6.1 Surround Sound</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>surround71 - 7.1 Surround Sound</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="sampleRateCombo">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>80</y>
|
||||
<width>111</width>
|
||||
<x>370</x>
|
||||
<y>20</y>
|
||||
<width>96</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -218,37 +143,12 @@ to stereo output.</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>- Autodetect -</string>
|
||||
<string>Autodetect</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>96000</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>48000</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>44100</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>32000</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>22050</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>16000</string>
|
||||
<string>8000</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
@@ -258,16 +158,36 @@ to stereo output.</string>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>8000</string>
|
||||
<string>16000</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>22050</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>32000</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>44100</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>48000</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>80</y>
|
||||
<width>101</width>
|
||||
<x>280</x>
|
||||
<y>20</y>
|
||||
<width>81</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -282,73 +202,20 @@ to stereo output.</string>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>200</y>
|
||||
<y>180</y>
|
||||
<width>511</width>
|
||||
<height>161</height>
|
||||
<height>191</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>HRTF (Stereo only)</string>
|
||||
</property>
|
||||
<widget class="QRadioButton" name="hrtfEnableButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>30</y>
|
||||
<width>71</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Allows applications to request HRTF mixing.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="hrtfDisableButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>50</y>
|
||||
<width>71</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Does not allow HRTF mixing, even when requested.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Disable</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="hrtfForceButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>70</y>
|
||||
<width>71</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Attempts to force HRTF mixing, even if applications request not
|
||||
to do it. This may override the channel configuration and
|
||||
sample rate.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Force</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QListWidget" name="hrtfFileList">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<x>20</x>
|
||||
<y>30</y>
|
||||
<width>301</width>
|
||||
<width>391</width>
|
||||
<height>121</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -378,7 +245,7 @@ contain these markers, which will be replaced as needed:
|
||||
<widget class="QPushButton" name="hrtfAddButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>419</x>
|
||||
<x>420</x>
|
||||
<y>30</y>
|
||||
<width>81</width>
|
||||
<height>25</height>
|
||||
@@ -399,7 +266,7 @@ contain these markers, which will be replaced as needed:
|
||||
<widget class="QPushButton" name="hrtfRemoveButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>419</x>
|
||||
<x>420</x>
|
||||
<y>60</y>
|
||||
<width>81</width>
|
||||
<height>25</height>
|
||||
@@ -414,12 +281,56 @@ contain these markers, which will be replaced as needed:
|
||||
</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="hrtfStateComboBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>160</y>
|
||||
<width>161</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Application preference</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Force on</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Force off</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>30</x>
|
||||
<y>160</y>
|
||||
<width>71</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>HRTF Mode:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>110</y>
|
||||
<y>90</y>
|
||||
<width>511</width>
|
||||
<height>91</height>
|
||||
</rect>
|
||||
@@ -590,6 +501,37 @@ frames needed for each mixing update.</string>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>280</x>
|
||||
<y>50</y>
|
||||
<width>81</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Stereo Mode:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="stereoModeCombo">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>370</x>
|
||||
<y>50</y>
|
||||
<width>78</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>How to treat stereo output. As headphones, HRTF or crossfeed
|
||||
filters may be used to improve binaural quality, which may not
|
||||
otherwise be suitable for speakers.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
@@ -737,7 +679,7 @@ value currently possible is 4.</string>
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>120</y>
|
||||
<width>185</width>
|
||||
<width>78</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -747,34 +689,14 @@ value currently possible is 4.</string>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>- Default -</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Point (low quality, fast)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Linear (basic quality, fast)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Cubic Spline (good quality)</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<widget class="QGroupBox" name="cpuExtGroupBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>150</y>
|
||||
<width>511</width>
|
||||
<height>91</height>
|
||||
<height>121</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
@@ -788,7 +710,7 @@ be useful for preventing those extensions from being used.</string>
|
||||
<widget class="QCheckBox" name="enableSSECheckBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<x>100</x>
|
||||
<y>20</y>
|
||||
<width>71</width>
|
||||
<height>31</height>
|
||||
@@ -805,7 +727,7 @@ be useful for preventing those extensions from being used.</string>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>50</y>
|
||||
<y>20</y>
|
||||
<width>71</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
@@ -820,7 +742,7 @@ be useful for preventing those extensions from being used.</string>
|
||||
<widget class="QCheckBox" name="enableNeonCheckBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
<x>100</x>
|
||||
<y>50</y>
|
||||
<width>71</width>
|
||||
<height>31</height>
|
||||
@@ -836,7 +758,7 @@ be useful for preventing those extensions from being used.</string>
|
||||
<widget class="QCheckBox" name="enableSSE41CheckBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
<x>340</x>
|
||||
<y>20</y>
|
||||
<width>71</width>
|
||||
<height>31</height>
|
||||
@@ -849,6 +771,35 @@ be useful for preventing those extensions from being used.</string>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="enableSSE3CheckBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
<y>20</y>
|
||||
<width>71</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>SSE3</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="cpuExtDisabledLabel">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>101</x>
|
||||
<y>80</y>
|
||||
<width>311</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p align="center"><span style=" font-style:italic;">No support enabled for CPU Extensions</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab">
|
||||
@@ -956,87 +907,11 @@ some quality.</string>
|
||||
<string>Emulate EAX Reverb:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>100</y>
|
||||
<width>511</width>
|
||||
<height>61</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Global amplification for reverb output, expressed in decibels.
|
||||
+6 will be a scale of (approximately) 2x, +12 will be a scale of
|
||||
4x, etc. Similarly, -6 will be about half, and -12 about 1/4th. A
|
||||
value of 0 means no change.</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Reverb Boost</string>
|
||||
</property>
|
||||
<widget class="QSlider" name="reverbBoostSlider">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>30</y>
|
||||
<width>391</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-120</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>120</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TicksBelow</enum>
|
||||
</property>
|
||||
<property name="tickInterval">
|
||||
<number>10</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="reverbBoostEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>410</x>
|
||||
<y>30</y>
|
||||
<width>51</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>0.0</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>460</x>
|
||||
<y>30</y>
|
||||
<width>31</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>dB</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_5">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>170</y>
|
||||
<y>100</y>
|
||||
<width>511</width>
|
||||
<height>191</height>
|
||||
</rect>
|
||||
|
||||
@@ -227,8 +227,7 @@ enum HeadModelT {
|
||||
// Desired output format from the command line.
|
||||
enum OutputFormatT {
|
||||
OF_NONE = 0,
|
||||
OF_MHR , // OpenAL Soft MHR data set file.
|
||||
OF_TABLE // OpenAL Soft built-in table file (used when compiling).
|
||||
OF_MHR // OpenAL Soft MHR data set file.
|
||||
};
|
||||
|
||||
// Unsigned integer type.
|
||||
@@ -2089,84 +2088,6 @@ static int StoreMhr (const HrirDataT * hData, const char * filename) {
|
||||
return (1);
|
||||
}
|
||||
|
||||
// Store the OpenAL Soft built-in table.
|
||||
static int StoreTable (const HrirDataT * hData, const char * filename) {
|
||||
FILE * fp = NULL;
|
||||
uint step, end, n, j, i;
|
||||
int hpHist, v;
|
||||
char text [128 + 1];
|
||||
|
||||
if ((fp = fopen (filename, "wb")) == NULL) {
|
||||
fprintf (stderr, "Error: Could not open table file '%s'.\n", filename);
|
||||
return (0);
|
||||
}
|
||||
snprintf (text, 128, "/* Elevation metrics */\n"
|
||||
"static const ALubyte defaultAzCount[%u] = { ", hData -> mEvCount);
|
||||
if (! WriteAscii (text, fp, filename))
|
||||
return (0);
|
||||
for (i = 0; i < hData -> mEvCount; i ++) {
|
||||
snprintf (text, 128, "%u, ", hData -> mAzCount [i]);
|
||||
if (! WriteAscii (text, fp, filename))
|
||||
return (0);
|
||||
}
|
||||
snprintf (text, 128, "};\n"
|
||||
"static const ALushort defaultEvOffset[%u] = { ", hData -> mEvCount);
|
||||
if (! WriteAscii (text, fp, filename))
|
||||
return (0);
|
||||
for (i = 0; i < hData -> mEvCount; i ++) {
|
||||
snprintf (text, 128, "%u, ", hData -> mEvOffset [i]);
|
||||
if (! WriteAscii (text, fp, filename))
|
||||
return (0);
|
||||
}
|
||||
step = hData -> mIrSize;
|
||||
end = hData -> mIrCount * step;
|
||||
n = hData -> mIrPoints;
|
||||
snprintf (text, 128, "};\n\n"
|
||||
"/* HRIR Coefficients */\n"
|
||||
"static const ALshort defaultCoeffs[%u] =\n{\n", hData -> mIrCount * n);
|
||||
if (! WriteAscii (text, fp, filename))
|
||||
return (0);
|
||||
srand (0x31DF840C);
|
||||
for (j = 0; j < end; j += step) {
|
||||
if (! WriteAscii (" ", fp, filename))
|
||||
return (0);
|
||||
hpHist = 0;
|
||||
for (i = 0; i < n; i ++) {
|
||||
v = HpTpdfDither (32767.0 * hData -> mHrirs [j + i], & hpHist);
|
||||
snprintf (text, 128, " %+d,", v);
|
||||
if (! WriteAscii (text, fp, filename))
|
||||
return (0);
|
||||
}
|
||||
if (! WriteAscii ("\n", fp, filename))
|
||||
return (0);
|
||||
}
|
||||
snprintf (text, 128, "};\n\n"
|
||||
"/* HRIR Delays */\n"
|
||||
"static const ALubyte defaultDelays[%u] =\n{\n"
|
||||
" ", hData -> mIrCount);
|
||||
if (! WriteAscii (text, fp, filename))
|
||||
return (0);
|
||||
for (j = 0; j < hData -> mIrCount; j ++) {
|
||||
v = (int) fmin (round (hData -> mIrRate * hData -> mHrtds [j]), MAX_HRTD);
|
||||
snprintf (text, 128, " %d,", v);
|
||||
if (! WriteAscii (text, fp, filename))
|
||||
return (0);
|
||||
}
|
||||
if (! WriteAscii ("\n};\n\n"
|
||||
"/* Default HRTF Definition */\n", fp, filename))
|
||||
return (0);
|
||||
snprintf (text, 128, "static const struct Hrtf DefaultHrtf = {\n"
|
||||
" %u, %u, %u, defaultAzCount, defaultEvOffset,\n",
|
||||
hData -> mIrRate, hData -> mIrPoints, hData -> mEvCount);
|
||||
if (! WriteAscii (text, fp, filename))
|
||||
return (0);
|
||||
if (! WriteAscii (" defaultCoeffs, defaultDelays, NULL\n"
|
||||
"};\n", fp, filename))
|
||||
return (0);
|
||||
fclose (fp);
|
||||
return (1);
|
||||
}
|
||||
|
||||
// Process the data set definition to read and validate the data set metrics.
|
||||
static int ProcessMetrics (TokenReaderT * tr, const uint fftSize, const uint truncSize, HrirDataT * hData) {
|
||||
char ident [MAX_IDENT_LEN + 1];
|
||||
@@ -2583,11 +2504,6 @@ static int ProcessDefinition (const char * inName, const uint outRate, const uin
|
||||
if (! StoreMhr (& hData, expName))
|
||||
return (0);
|
||||
break;
|
||||
case OF_TABLE :
|
||||
fprintf (stderr, "Creating OpenAL Soft table file...\n");
|
||||
if (! StoreTable (& hData, expName))
|
||||
return (0);
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
@@ -2619,8 +2535,6 @@ int main (const int argc, const char * argv []) {
|
||||
fprintf (stdout, "Commands:\n");
|
||||
fprintf (stdout, " -m, --make-mhr Makes an OpenAL Soft compatible HRTF data set.\n");
|
||||
fprintf (stdout, " Defaults output to: ./oalsoft_hrtf_%%r.mhr\n");
|
||||
fprintf (stdout, " -t, --make-tab Makes the built-in table used when compiling OpenAL Soft.\n");
|
||||
fprintf (stdout, " Defaults output to: ./hrtf_tables.inc\n");
|
||||
fprintf (stdout, " -h, --help Displays this help information.\n\n");
|
||||
fprintf (stdout, "Options:\n");
|
||||
fprintf (stdout, " -r=<rate> Change the data set sample rate to the specified value and\n");
|
||||
@@ -2647,12 +2561,6 @@ int main (const int argc, const char * argv []) {
|
||||
else
|
||||
outName = "./oalsoft_hrtf_%r.mhr";
|
||||
outFormat = OF_MHR;
|
||||
} else if ((strcmp (argv [1], "--make-tab") == 0) || (strcmp (argv [1], "-t") == 0)) {
|
||||
if (argc > 3)
|
||||
outName = argv [3];
|
||||
else
|
||||
outName = "./hrtf_tables.inc";
|
||||
outFormat = OF_TABLE;
|
||||
} else {
|
||||
fprintf (stderr, "Error: Invalid command '%s'.\n", argv [1]);
|
||||
return (-1);
|
||||
|
||||
@@ -147,6 +147,35 @@ static void printALCInfo(ALCdevice *device)
|
||||
}
|
||||
}
|
||||
|
||||
static void printHRTFInfo(ALCdevice *device)
|
||||
{
|
||||
LPALCGETSTRINGISOFT alcGetStringiSOFT;
|
||||
ALCint num_hrtfs;
|
||||
|
||||
if(alcIsExtensionPresent(device, "ALC_SOFT_HRTF") == ALC_FALSE)
|
||||
{
|
||||
printf("HRTF extension not available\n");
|
||||
return;
|
||||
}
|
||||
|
||||
alcGetStringiSOFT = alcGetProcAddress(device, "alcGetStringiSOFT");
|
||||
|
||||
alcGetIntegerv(device, ALC_NUM_HRTF_SPECIFIERS_SOFT, 1, &num_hrtfs);
|
||||
if(!num_hrtfs)
|
||||
printf("No HRTFs found\n");
|
||||
else
|
||||
{
|
||||
ALCint i;
|
||||
printf("Available HRTFs:\n");
|
||||
for(i = 0;i < num_hrtfs;++i)
|
||||
{
|
||||
const ALCchar *name = alcGetStringiSOFT(device, ALC_HRTF_SPECIFIER_SOFT, i);
|
||||
printf(" %s\n", name);
|
||||
}
|
||||
}
|
||||
checkALCErrors(device);
|
||||
}
|
||||
|
||||
static void printALInfo(void)
|
||||
{
|
||||
printf("OpenAL vendor string: %s\n", alGetString(AL_VENDOR));
|
||||
@@ -287,6 +316,7 @@ int main(int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
printALCInfo(device);
|
||||
printHRTFInfo(device);
|
||||
|
||||
context = alcCreateContext(device, NULL);
|
||||
if(!context || alcMakeContextCurrent(context) == ALC_FALSE)
|
||||
|
||||
Reference in New Issue
Block a user