Version 1.1

This commit is contained in:
jthedering committed 2015-11-26 19:20:48 +00:00
1 parent 57e8158efd
commit 2d4995f0d8
7 files changed
+70 -39

No files matched your search

+8
View File
@@ -46,6 +46,14 @@ void AnalysisPlotView::drawBackground(QPainter* painter, const QRectF& rect)
double hz = s->xToHz(x);
double db = gainIterator.gainAt(hz);
double y = s->dbToY(db);
if (y == -1)
{
if (db < 0)
y = sceneRect().bottom() + 1;
else
y = sceneRect().top() - 1;
}
if (db == lastDb)
y = floor(y) + 0.5;
lastDb = db;
+38 -10
View File
@@ -89,7 +89,7 @@ MainWindow::MainWindow(QDir configDir, QWidget* parent)
ui->mainToolBar->addWidget(new QLabel(tr("Device: ")));
deviceComboBox = new QComboBox;
connect(deviceComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(deviceSelected(int)));
connect(deviceComboBox, SIGNAL(activated(int)), this, SLOT(deviceSelected(int)));
ui->mainToolBar->addWidget(deviceComboBox);
spacer = new QWidget;
@@ -297,9 +297,7 @@ void MainWindow::load(QString path)
}
QFileInfo fileInfo(path);
FilterTable* filterTable = addTab(fileInfo.fileName(), QDir::toNativeSeparators(fileInfo.absoluteFilePath()));
filterTable->setLines(path, lines);
FilterTable* filterTable = addTab(fileInfo.fileName(), QDir::toNativeSeparators(fileInfo.absoluteFilePath()), path, lines);
connect(filterTable, SIGNAL(linesChanged()), this, SLOT(linesChanged()));
@@ -600,8 +598,7 @@ void MainWindow::on_actionSaveAs_triggered()
void MainWindow::on_actionNew_triggered()
{
FilterTable* filterTable = addTab(tr("Unsaved"), "");
filterTable->setLines("", QList<QString>());
FilterTable* filterTable = addTab(tr("Unsaved"), "", "", QList<QString>());
connect(filterTable, SIGNAL(linesChanged()), this, SLOT(linesChanged()));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
@@ -808,7 +805,7 @@ void MainWindow::on_actionResetAllFileSpecificPreferences_triggered()
}
}
FilterTable* MainWindow::addTab(QString title, QString tooltip)
FilterTable* MainWindow::addTab(QString title, QString tooltip, QString configPath, QList<QString> lines)
{
QScrollArea* scrollArea = new QScrollArea(ui->tabWidget);
scrollArea->setWidgetResizable(true);
@@ -817,14 +814,15 @@ FilterTable* MainWindow::addTab(QString title, QString tooltip)
filterTable->setAcceptDrops(true);
filterTable->setFocusPolicy(Qt::WheelFocus);
int tabIndex = ui->tabWidget->addTab(scrollArea, title);
ui->tabWidget->setTabToolTip(tabIndex, tooltip);
DeviceAPOInfo* selectedDevice;
int channelMask;
getDeviceAndChannelMask(&selectedDevice, &channelMask);
filterTable->updateDeviceAndChannelMask(selectedDevice, channelMask);
filterTable->initialize(scrollArea, outputDevices, inputDevices);
filterTable->setLines(configPath, lines);
int tabIndex = ui->tabWidget->addTab(scrollArea, title);
ui->tabWidget->setTabToolTip(tabIndex, tooltip);
return filterTable;
}
@@ -933,6 +931,32 @@ void MainWindow::loadPreferences()
if (stateValue.isValid())
restoreState(stateValue.toByteArray());
instantModeCheckBox->setChecked(settings.value("instantMode", true).toBool());
QString selectedDeviceGuid = settings.value("selectedDeviceGuid").toString();
if (!selectedDeviceGuid.isEmpty())
{
for (int i = 0; i < deviceComboBox->count(); i++)
{
DeviceAPOInfo* apoInfo = deviceComboBox->itemData(i).value<DeviceAPOInfo*>();
if (apoInfo != NULL)
{
if (QString::fromStdWString(apoInfo->deviceGuid).compare(selectedDeviceGuid, Qt::CaseInsensitive) == 0)
{
deviceComboBox->setCurrentIndex(i);
break;
}
}
}
}
deviceSelected(deviceComboBox->currentIndex());
int selectedChannelMask = settings.value("selectedChannelMask").toInt();
if (selectedChannelMask != 0)
{
int index = channelConfigurationComboBox->findData(selectedChannelMask);
if (index != -1)
channelConfigurationComboBox->setCurrentIndex(index);
}
channelConfigurationSelected(channelConfigurationComboBox->currentIndex());
ui->startFromComboBox->setCurrentIndex(settings.value("analysis/startFrom").toInt());
ui->analysisChannelComboBox->setCurrentText(settings.value("analysis/channel").toString());
@@ -981,6 +1005,10 @@ void MainWindow::savePreferences()
settings.setValue("geometry", saveGeometry());
settings.setValue("windowState", saveState());
settings.setValue("instantMode", instantModeCheckBox->isChecked());
DeviceAPOInfo* selectedDevice = deviceComboBox->currentData().value<DeviceAPOInfo*>();
settings.setValue("selectedDeviceGuid", selectedDevice != NULL ? QString::fromStdWString(selectedDevice->deviceGuid) : "");
int channelMask = channelConfigurationComboBox->currentData().toInt();
settings.setValue("selectedChannelMask", channelMask);
settings.setValue("analysis/startFrom", ui->startFromComboBox->currentIndex());
settings.setValue("analysis/channel", ui->analysisChannelComboBox->currentText());
+1 -1
View File
@@ -90,7 +90,7 @@ private slots:
void on_actionResetAllFileSpecificPreferences_triggered();
private:
FilterTable* addTab(QString title, QString tooltip);
FilterTable* addTab(QString title, QString tooltip, QString configPath, QList<QString> lines);
void getDeviceAndChannelMask(DeviceAPOInfo** selectedDevice, int* channelMask);
bool askForClose(int tabIndex);
void startAnalysis();
+10 -8
View File
@@ -27,15 +27,17 @@ BiQuadFilterGUIFactory::BiQuadFilterGUIFactory()
QList<FilterTemplate> BiQuadFilterGUIFactory::createFilterTemplates()
{
QStringList path(tr("Parametric filters"));
QList<FilterTemplate> list;
list.append(FilterTemplate(tr("Peaking filter"), "Filter: ON PK Fc 100 Hz Gain 0 dB Q 10.0", QStringList(tr("Parametric filters"))));
list.append(FilterTemplate(tr("Low-pass filter"), "Filter: ON LP Fc 100 Hz", QStringList(tr("Parametric filters"))));
list.append(FilterTemplate(tr("High-pass filter"), "Filter: ON LP Fc 100 Hz", QStringList(tr("Parametric filters"))));
list.append(FilterTemplate(tr("Band-pass filter"), "Filter: ON BP Fc 100 Hz Q 10.0", QStringList(tr("Parametric filters"))));
list.append(FilterTemplate(tr("Low-shelf filter"), "Filter: ON LS Fc 100 Hz Gain 0 dB", QStringList(tr("Parametric filters"))));
list.append(FilterTemplate(tr("High-shelf filter"), "Filter: ON HS Fc 100 Hz Gain 0 dB", QStringList(tr("Parametric filters"))));
list.append(FilterTemplate(tr("Notch filter"), "Filter: ON NO Fc 100 Hz", QStringList(tr("Parametric filters"))));
list.append(FilterTemplate(tr("All-pass filter"), "Filter: ON AP Fc 100 Hz Q 10.0", QStringList(tr("Parametric filters"))));
list.append(FilterTemplate(tr("Peaking filter"), "Filter: ON PK Fc 100 Hz Gain 0 dB Q 10", path));
list.append(FilterTemplate(tr("Low-pass filter"), "Filter: ON LP Fc 100 Hz", path));
list.append(FilterTemplate(tr("High-pass filter"), "Filter: ON LP Fc 100 Hz", path));
list.append(FilterTemplate(tr("Band-pass filter"), "Filter: ON BP Fc 100 Hz Q 10", path));
list.append(FilterTemplate(tr("Low-shelf filter"), "Filter: ON LS Fc 100 Hz Gain 0 dB", path));
list.append(FilterTemplate(tr("High-shelf filter"), "Filter: ON HS Fc 100 Hz Gain 0 dB", path));
list.append(FilterTemplate(tr("Notch filter"), "Filter: ON NO Fc 100 Hz", path));
list.append(FilterTemplate(tr("All-pass filter"), "Filter: ON AP Fc 100 Hz Q 10", path));
return list;
}
+10 -17
View File
@@ -99,54 +99,47 @@
<context>
<name>BiQuadFilterGUIFactory</name>
<message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="31"/>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="33"/>
<source>Peaking filter</source>
<translation>Peaking-Filter</translation>
</message>
<message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="31"/>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="32"/>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="33"/>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="34"/>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="35"/>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="36"/>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="37"/>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="38"/>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="30"/>
<source>Parametric filters</source>
<translation>Parametrische Filter</translation>
</message>
<message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="32"/>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="34"/>
<source>Low-pass filter</source>
<translation>Tiefpassfilter</translation>
</message>
<message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="33"/>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="35"/>
<source>High-pass filter</source>
<translation>Hochpassfilter</translation>
</message>
<message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="34"/>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="36"/>
<source>Band-pass filter</source>
<translation>Bandpassfilter</translation>
</message>
<message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="35"/>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="37"/>
<source>Low-shelf filter</source>
<translation>Low Shelf-Filter</translation>
</message>
<message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="36"/>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="38"/>
<source>High-shelf filter</source>
<translation>High Shelf-Filter</translation>
</message>
<message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="37"/>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="39"/>
<source>Notch filter</source>
<translation>Notchfilter</translation>
</message>
<message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="38"/>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="40"/>
<source>All-pass filter</source>
<translation>Allpassfilter</translation>
</message>
@@ -647,7 +640,7 @@ Wählen Sie eine andere Datei or ändern Sie die Konfiguration des Geräts.</tra
<context>
<name>FilterTable</name>
<message>
<location filename="../FilterTable.cpp" line="203"/>
<location filename="../FilterTable.cpp" line="204"/>
<source>Add filter</source>
<translation>Filter hinzufügen</translation>
</message>