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 hz = s->xToHz(x);
double db = gainIterator.gainAt(hz); double db = gainIterator.gainAt(hz);
double y = s->dbToY(db); double y = s->dbToY(db);
if (y == -1)
{
if (db < 0)
y = sceneRect().bottom() + 1;
else
y = sceneRect().top() - 1;
}
if (db == lastDb) if (db == lastDb)
y = floor(y) + 0.5; y = floor(y) + 0.5;
lastDb = db; lastDb = db;
+38 -10
View File
@@ -89,7 +89,7 @@ MainWindow::MainWindow(QDir configDir, QWidget* parent)
ui->mainToolBar->addWidget(new QLabel(tr("Device: "))); ui->mainToolBar->addWidget(new QLabel(tr("Device: ")));
deviceComboBox = new QComboBox; 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); ui->mainToolBar->addWidget(deviceComboBox);
spacer = new QWidget; spacer = new QWidget;
@@ -297,9 +297,7 @@ void MainWindow::load(QString path)
} }
QFileInfo fileInfo(path); QFileInfo fileInfo(path);
FilterTable* filterTable = addTab(fileInfo.fileName(), QDir::toNativeSeparators(fileInfo.absoluteFilePath())); FilterTable* filterTable = addTab(fileInfo.fileName(), QDir::toNativeSeparators(fileInfo.absoluteFilePath()), path, lines);
filterTable->setLines(path, lines);
connect(filterTable, SIGNAL(linesChanged()), this, SLOT(linesChanged())); connect(filterTable, SIGNAL(linesChanged()), this, SLOT(linesChanged()));
@@ -600,8 +598,7 @@ void MainWindow::on_actionSaveAs_triggered()
void MainWindow::on_actionNew_triggered() void MainWindow::on_actionNew_triggered()
{ {
FilterTable* filterTable = addTab(tr("Unsaved"), ""); FilterTable* filterTable = addTab(tr("Unsaved"), "", "", QList<QString>());
filterTable->setLines("", QList<QString>());
connect(filterTable, SIGNAL(linesChanged()), this, SLOT(linesChanged())); connect(filterTable, SIGNAL(linesChanged()), this, SLOT(linesChanged()));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1); 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); QScrollArea* scrollArea = new QScrollArea(ui->tabWidget);
scrollArea->setWidgetResizable(true); scrollArea->setWidgetResizable(true);
@@ -817,14 +814,15 @@ FilterTable* MainWindow::addTab(QString title, QString tooltip)
filterTable->setAcceptDrops(true); filterTable->setAcceptDrops(true);
filterTable->setFocusPolicy(Qt::WheelFocus); filterTable->setFocusPolicy(Qt::WheelFocus);
int tabIndex = ui->tabWidget->addTab(scrollArea, title);
ui->tabWidget->setTabToolTip(tabIndex, tooltip);
DeviceAPOInfo* selectedDevice; DeviceAPOInfo* selectedDevice;
int channelMask; int channelMask;
getDeviceAndChannelMask(&selectedDevice, &channelMask); getDeviceAndChannelMask(&selectedDevice, &channelMask);
filterTable->updateDeviceAndChannelMask(selectedDevice, channelMask); filterTable->updateDeviceAndChannelMask(selectedDevice, channelMask);
filterTable->initialize(scrollArea, outputDevices, inputDevices); filterTable->initialize(scrollArea, outputDevices, inputDevices);
filterTable->setLines(configPath, lines);
int tabIndex = ui->tabWidget->addTab(scrollArea, title);
ui->tabWidget->setTabToolTip(tabIndex, tooltip);
return filterTable; return filterTable;
} }
@@ -933,6 +931,32 @@ void MainWindow::loadPreferences()
if (stateValue.isValid()) if (stateValue.isValid())
restoreState(stateValue.toByteArray()); restoreState(stateValue.toByteArray());
instantModeCheckBox->setChecked(settings.value("instantMode", true).toBool()); 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->startFromComboBox->setCurrentIndex(settings.value("analysis/startFrom").toInt());
ui->analysisChannelComboBox->setCurrentText(settings.value("analysis/channel").toString()); ui->analysisChannelComboBox->setCurrentText(settings.value("analysis/channel").toString());
@@ -981,6 +1005,10 @@ void MainWindow::savePreferences()
settings.setValue("geometry", saveGeometry()); settings.setValue("geometry", saveGeometry());
settings.setValue("windowState", saveState()); settings.setValue("windowState", saveState());
settings.setValue("instantMode", instantModeCheckBox->isChecked()); 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/startFrom", ui->startFromComboBox->currentIndex());
settings.setValue("analysis/channel", ui->analysisChannelComboBox->currentText()); settings.setValue("analysis/channel", ui->analysisChannelComboBox->currentText());
+1 -1
View File
@@ -90,7 +90,7 @@ private slots:
void on_actionResetAllFileSpecificPreferences_triggered(); void on_actionResetAllFileSpecificPreferences_triggered();
private: private:
FilterTable* addTab(QString title, QString tooltip); FilterTable* addTab(QString title, QString tooltip, QString configPath, QList<QString> lines);
void getDeviceAndChannelMask(DeviceAPOInfo** selectedDevice, int* channelMask); void getDeviceAndChannelMask(DeviceAPOInfo** selectedDevice, int* channelMask);
bool askForClose(int tabIndex); bool askForClose(int tabIndex);
void startAnalysis(); void startAnalysis();
+10 -8
View File
@@ -27,15 +27,17 @@ BiQuadFilterGUIFactory::BiQuadFilterGUIFactory()
QList<FilterTemplate> BiQuadFilterGUIFactory::createFilterTemplates() QList<FilterTemplate> BiQuadFilterGUIFactory::createFilterTemplates()
{ {
QStringList path(tr("Parametric filters"));
QList<FilterTemplate> list; 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("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", QStringList(tr("Parametric filters")))); 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", QStringList(tr("Parametric filters")))); 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.0", QStringList(tr("Parametric filters")))); 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", QStringList(tr("Parametric filters")))); 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", QStringList(tr("Parametric filters")))); 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", QStringList(tr("Parametric filters")))); 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.0", QStringList(tr("Parametric filters")))); list.append(FilterTemplate(tr("All-pass filter"), "Filter: ON AP Fc 100 Hz Q 10", path));
return list; return list;
} }
+10 -17
View File
@@ -99,54 +99,47 @@
<context> <context>
<name>BiQuadFilterGUIFactory</name> <name>BiQuadFilterGUIFactory</name>
<message> <message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="31"/> <location filename="../guis/BiQuadFilterGUIFactory.cpp" line="33"/>
<source>Peaking filter</source> <source>Peaking filter</source>
<translation>Peaking-Filter</translation> <translation>Peaking-Filter</translation>
</message> </message>
<message> <message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="31"/> <location filename="../guis/BiQuadFilterGUIFactory.cpp" line="30"/>
<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"/>
<source>Parametric filters</source> <source>Parametric filters</source>
<translation>Parametrische Filter</translation> <translation>Parametrische Filter</translation>
</message> </message>
<message> <message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="32"/> <location filename="../guis/BiQuadFilterGUIFactory.cpp" line="34"/>
<source>Low-pass filter</source> <source>Low-pass filter</source>
<translation>Tiefpassfilter</translation> <translation>Tiefpassfilter</translation>
</message> </message>
<message> <message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="33"/> <location filename="../guis/BiQuadFilterGUIFactory.cpp" line="35"/>
<source>High-pass filter</source> <source>High-pass filter</source>
<translation>Hochpassfilter</translation> <translation>Hochpassfilter</translation>
</message> </message>
<message> <message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="34"/> <location filename="../guis/BiQuadFilterGUIFactory.cpp" line="36"/>
<source>Band-pass filter</source> <source>Band-pass filter</source>
<translation>Bandpassfilter</translation> <translation>Bandpassfilter</translation>
</message> </message>
<message> <message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="35"/> <location filename="../guis/BiQuadFilterGUIFactory.cpp" line="37"/>
<source>Low-shelf filter</source> <source>Low-shelf filter</source>
<translation>Low Shelf-Filter</translation> <translation>Low Shelf-Filter</translation>
</message> </message>
<message> <message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="36"/> <location filename="../guis/BiQuadFilterGUIFactory.cpp" line="38"/>
<source>High-shelf filter</source> <source>High-shelf filter</source>
<translation>High Shelf-Filter</translation> <translation>High Shelf-Filter</translation>
</message> </message>
<message> <message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="37"/> <location filename="../guis/BiQuadFilterGUIFactory.cpp" line="39"/>
<source>Notch filter</source> <source>Notch filter</source>
<translation>Notchfilter</translation> <translation>Notchfilter</translation>
</message> </message>
<message> <message>
<location filename="../guis/BiQuadFilterGUIFactory.cpp" line="38"/> <location filename="../guis/BiQuadFilterGUIFactory.cpp" line="40"/>
<source>All-pass filter</source> <source>All-pass filter</source>
<translation>Allpassfilter</translation> <translation>Allpassfilter</translation>
</message> </message>
@@ -647,7 +640,7 @@ Wählen Sie eine andere Datei or ändern Sie die Konfiguration des Geräts.</tra
<context> <context>
<name>FilterTable</name> <name>FilterTable</name>
<message> <message>
<location filename="../FilterTable.cpp" line="203"/> <location filename="../FilterTable.cpp" line="204"/>
<source>Add filter</source> <source>Add filter</source>
<translation>Filter hinzufügen</translation> <translation>Filter hinzufügen</translation>
</message> </message>
+2 -2
View File
@@ -96,8 +96,8 @@ ls_for_split_full=false
ls_func_split_full=false ls_func_split_full=false
ls_code_width=false ls_code_width=false
nl_after_multiline_comment=false nl_after_multiline_comment=false
eat_blanks_after_open_brace=false eat_blanks_after_open_brace=true
eat_blanks_before_close_brace=false eat_blanks_before_close_brace=true
nl_before_return=false nl_before_return=false
nl_after_return=false nl_after_return=false
mod_full_brace_if_chain=false mod_full_brace_if_chain=false
+1 -1
View File
@@ -1,3 +1,3 @@
#define MAJOR 1 #define MAJOR 1
#define MINOR 0 #define MINOR 1
#define REVISION 0 #define REVISION 0