MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / onVdcDatabaseSelected

Method onVdcDatabaseSelected

src/MainWindow.cpp:1066–1097  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1064}
1065
1066void MainWindow::onVdcDatabaseSelected(const QItemSelection &, const QItemSelection &) {
1067 QItemSelectionModel *select = ui->ddcTable->selectionModel();
1068
1069 if (select->hasSelection())
1070 {
1071 ui->ddc_files->clearCurrentFile();
1072
1073 int index = select->selectedRows().first().row();
1074 auto* model = static_cast<VdcDatabaseModel*>(ui->ddcTable->model());
1075
1076 QFile file(AppConfig::instance().getPath("temp.vdc"));
1077 if (file.open(QIODevice::WriteOnly | QIODevice::Text))
1078 {
1079 file.write(model->composeVdcFile(index).toUtf8().constData());
1080 }
1081 file.close();
1082
1083 auto newId = model->id(index);
1084 if (newId != "0")
1085 {
1086 AppConfig::instance().set(AppConfig::VdcLastDatabaseId, newId);
1087 }
1088
1089 /* Workaround: Load different file to make sure the config parser notices a change and reloads the DDC engine */
1090 DspConfig::instance().set(DspConfig::ddc_file, "");
1091 DspConfig::instance().commit();
1092
1093 _currentVdc = AppConfig::instance().getPath("temp.vdc");
1094 }
1095
1096 applyConfig();
1097}
1098
1099// IRS
1100void MainWindow::setIrsFile(const QString& path)

Callers

nothing calls this directly

Calls 7

clearCurrentFileMethod · 0.80
composeVdcFileMethod · 0.80
getPathMethod · 0.45
writeMethod · 0.45
idMethod · 0.45
setMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected