diff options
Diffstat (limited to 'utils/alsoft-config/mainwindow.cpp')
-rw-r--r-- | utils/alsoft-config/mainwindow.cpp | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp index 382520af..498be083 100644 --- a/utils/alsoft-config/mainwindow.cpp +++ b/utils/alsoft-config/mainwindow.cpp @@ -346,13 +346,13 @@ void MainWindow::cancelCloseAction() } -QStringList MainWindow::collectDefaultHrtfs() +QStringList MainWindow::collectHrtfs() { QStringList ret; - QStringList paths = getAllDataPaths("/openal/hrtf"); - foreach(const QString &name, paths) + + for(int i = 0;i < ui->hrtfFileList->count();i++) { - QDir dir(name); + QDir dir(ui->hrtfFileList->item(i)->text()); QStringList fnames = dir.entryList(QDir::Files | QDir::Readable); foreach(const QString &fname, fnames) { @@ -376,6 +376,37 @@ QStringList MainWindow::collectDefaultHrtfs() } } } + + if(ui->defaultHrtfPathsCheckBox->isChecked()) + { + QStringList paths = getAllDataPaths("/openal/hrtf"); + foreach(const QString &name, paths) + { + QDir dir(name); + QStringList fnames = dir.entryList(QDir::Files | QDir::Readable); + foreach(const QString &fname, fnames) + { + if(fname.endsWith(".mhr", Qt::CaseInsensitive)) + { + if(!ret.contains(fname)) + ret.push_back(fname); + else + { + size_t i = 1; + do { + QString s = fname+" #"+QString::number(i); + if(!ret.contains(s)) + { + ret.push_back(s); + break; + } + ++i; + } while(1); + } + } + } + } + } return ret; } @@ -523,7 +554,7 @@ void MainWindow::loadConfig(const QString &fname) ui->preferredHrtfComboBox->addItem("- Any -"); if(ui->defaultHrtfPathsCheckBox->isChecked()) { - QStringList hrtfs = collectDefaultHrtfs(); + QStringList hrtfs = collectHrtfs(); foreach(const QString &name, hrtfs) ui->preferredHrtfComboBox->addItem(name); } |