Skip to content

Commit a0b1715

Browse files
committed
Add better explanation for advanced waveform editing
1 parent 6b304e9 commit a0b1715

File tree

3 files changed

+13
-476
lines changed

3 files changed

+13
-476
lines changed

src/MainWindow.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,17 @@ void MainWindow::onConvolverWaveformEdit()
11021102
{
11031103
bool ok;
11041104
QString text = QInputDialog::getText(this, tr("Advanced waveform editing"),
1105-
tr("Advanced waveform editing (6 semicolon-separated values; default: -80;-100;0;0;0;0)"), QLineEdit::Normal,
1105+
tr("Advanced waveform editing (default: -80;-100;0;0;0;0)\n"
1106+
"\n"
1107+
"Set threshold of auto-IR-cropping and add delay to a chopped/minimum phase transformed IR.\n"
1108+
"This setting is only in effect if IR optimization is enabled.\n"
1109+
"\n"
1110+
"1st value: Start threshold cropping (dB)\n"
1111+
"2nd value: End threshold cropping (dB)\n"
1112+
"3rd value: Channel 1 delay (samples)\n"
1113+
"4th value: Channel 2 delay (samples)\n"
1114+
"5th value: Channel 3 delay (samples)\n"
1115+
"6th value: Channel 4 delay (samples)\n"), QLineEdit::Normal,
11061116
_currentConvWaveformEdit, &ok,
11071117
Qt::WindowFlags(), Qt::ImhFormattedNumbersOnly);
11081118

src/interface/fragment/SettingsFragment.cpp

Lines changed: 1 addition & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,10 @@ SettingsFragment::SettingsFragment(TrayIcon *trayIcon,
5656
switch (toplevel_index)
5757
{
5858
case -1:
59-
6059
if (cur->text(0) == "Context menu")
6160
{
6261
ui->stackedWidget->setCurrentIndex(4);
6362
}
64-
65-
if (cur->text(0) == "Advanced")
66-
{
67-
ui->stackedWidget->setCurrentIndex(6);
68-
}
69-
70-
break;
71-
case 4:
72-
// -- SA/ROOT
73-
//ui->stackedWidget->setCurrentIndex(5);
7463
break;
7564
default:
7665
ui->stackedWidget->setCurrentIndex(toplevel_index);
@@ -82,7 +71,6 @@ SettingsFragment::SettingsFragment(TrayIcon *trayIcon,
8271
ui->stackedWidget->show();
8372
ui->stackedWidget->repaint();
8473
});
85-
//ui->selector->expandItem(ui->selector->findItems("Spectrum analyser", Qt::MatchFlag::MatchExactly).first());
8674
ui->selector->expandItem(ui->selector->findItems("Tray icon", Qt::MatchFlag::MatchExactly).first());
8775

8876
/*
@@ -230,62 +218,6 @@ SettingsFragment::SettingsFragment(TrayIcon *trayIcon,
230218
connect(ui->dev_mode_manual, &QRadioButton::clicked, this, deviceUpdated);
231219
connect(ui->dev_select, qOverload<int>(&QComboBox::currentIndexChanged), this, deviceUpdated);
232220

233-
/*
234-
* Connect all signals for SA/ROOT
235-
*/
236-
/*connect(ui->sa_enable, &QGroupBox::clicked, this, [this]()
237-
{
238-
AppConfig::instance().set(AppConfig::SpectrumEnabled, ui->sa_enable->isChecked());
239-
ui->spectrum_advanced->setEnabled(ui->sa_enable->isChecked());
240-
emit reopenSettings();
241-
});
242-
connect(ui->sa_bands, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, [this](int number)
243-
{
244-
AppConfig::instance().set(AppConfig::SpectrumBands, number);
245-
});
246-
connect(ui->sa_minfreq, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, [this](int number)
247-
{
248-
AppConfig::instance().set(AppConfig::SpectrumMinFreq, number);
249-
});
250-
connect(ui->sa_maxfreq, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, [this](int number)
251-
{
252-
AppConfig::instance().set(AppConfig::SpectrumMaxFreq, number);
253-
});
254-
connect(ui->sa_input, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), this, [this](const QString &str)
255-
{
256-
if (lockslot)
257-
{
258-
return;
259-
}
260-
261-
AppConfig::instance().setSpectrumInput(str);
262-
});
263-
connect(ui->sa_type, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged), this, [this](const QString &)
264-
{
265-
if (lockslot)
266-
{
267-
return;
268-
}
269-
270-
AppConfig::instance().set(AppConfig::SpectrumTheme, ui->sa_type->currentIndex());
271-
});*/
272-
273-
/*
274-
* Connect all signals for SA/Advanced
275-
*/
276-
/*connect(ui->sa_refresh, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, [this](int number)
277-
{
278-
AppConfig::instance().set(AppConfig::SpectrumRefresh, number);
279-
});
280-
connect(ui->sa_multi, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), this, [this](double number)
281-
{
282-
AppConfig::instance().set(AppConfig::SpectrumMultiplier, number);
283-
});
284-
connect(ui->sa_grid, &QCheckBox::clicked, this, [this]()
285-
{
286-
AppConfig::instance().set(AppConfig::SpectrumGrid, ui->sa_grid->isChecked());
287-
});*/
288-
289221
/*
290222
* Connect all signals for Global
291223
*/
@@ -456,96 +388,7 @@ void SettingsFragment::refreshAll()
456388

457389
refreshDevices();
458390

459-
/*int bands = AppConfig::instance().get<int>(AppConfig::SpectrumBands);
460-
int minfreq = AppConfig::instance().get<int>(AppConfig::SpectrumMinFreq);
461-
int maxfreq = AppConfig::instance().get<int>(AppConfig::SpectrumMaxFreq);
462-
int refresh = AppConfig::instance().get<int>(AppConfig::SpectrumRefresh);
463-
float multiplier = AppConfig::instance().get<float>(AppConfig::SpectrumMultiplier);
464-
465-
// Set default values if undefined
466-
if (bands == 0)
467-
{
468-
bands = 100;
469-
}
470-
471-
if (maxfreq == 0)
472-
{
473-
maxfreq = 1000;
474-
}
475-
476-
if (refresh == 0)
477-
{
478-
refresh = 10;
479-
}
480-
481-
if (multiplier == 0)
482-
{
483-
multiplier = 0.15;
484-
}
485-
486-
// Check boundaries
487-
if (bands < 5 )
488-
{
489-
bands = 5;
490-
}
491-
else if (bands > 300)
492-
{
493-
bands = 300;
494-
}
495-
496-
if (minfreq < 0)
497-
{
498-
minfreq = 0;
499-
}
500-
else if (minfreq > 10000)
501-
{
502-
minfreq = 10000;
503-
}
504-
505-
if (maxfreq < 100)
506-
{
507-
maxfreq = 100;
508-
}
509-
else if (maxfreq > 24000)
510-
{
511-
maxfreq = 24000;
512-
}
513-
514-
if (refresh < 10)
515-
{
516-
refresh = 10;
517-
}
518-
else if (refresh > 500)
519-
{
520-
refresh = 500;
521-
}
522-
523-
if (multiplier < 0.01)
524-
{
525-
multiplier = 0.01;
526-
}
527-
else if (multiplier > 1)
528-
{
529-
multiplier = 1;
530-
}
531-
532-
if (maxfreq < minfreq)
533-
{
534-
maxfreq = minfreq + 100;
535-
}
536-
537-
ui->sa_enable->setChecked(AppConfig::instance().get<bool>(AppConfig::SpectrumEnabled));
538-
ui->spectrum_advanced->setEnabled(AppConfig::instance().get<bool>(AppConfig::SpectrumEnabled));
539-
540-
ui->sa_type->setCurrentIndex(AppConfig::instance().get<int>(AppConfig::SpectrumTheme));
541-
ui->sa_bands->setValue(bands);
542-
ui->sa_minfreq->setValue(minfreq);
543-
ui->sa_maxfreq->setValue(maxfreq);
544-
ui->sa_grid->setChecked(AppConfig::instance().get<bool>(AppConfig::SpectrumGrid));
545-
ui->sa_refresh->setValue(refresh);
546-
ui->sa_multi->setValue(multiplier);*/
547-
548-
lockslot = false;
391+
lockslot = false;
549392
}
550393

551394
void SettingsFragment::updateButtonStyle(bool white)

0 commit comments

Comments
 (0)