Mercurial > hg > tony
diff src/MainWindow.cpp @ 345:f3a9e4abec1b
added low amplitude suppression toggle to analysis menu
author | matthiasm |
---|---|
date | Mon, 16 Jun 2014 12:24:52 +0100 |
parents | 6f545a46746b |
children | 65907d91f328 |
line wrap: on
line diff
--- a/src/MainWindow.cpp Mon Jun 16 11:44:14 2014 +0100 +++ b/src/MainWindow.cpp Mon Jun 16 12:24:52 2014 +0100 @@ -828,6 +828,7 @@ settings.beginGroup("Analyser"); bool autoAnalyse = settings.value("auto-analysis", true).toBool(); bool precise = settings.value("precision-analysis", false).toBool(); + bool lowamp = settings.value("lowamp-analysis", true).toBool(); settings.endGroup(); action = new QAction(tr("Auto-Analyse &New Audio"), this); @@ -843,6 +844,14 @@ action->setChecked(precise); connect(action, SIGNAL(triggered()), this, SLOT(precisionAnalysisToggled())); menu->addAction(action); + + action = new QAction(tr("&Suppress Detection at Low Amplitude"), this); + action->setStatusTip(tr("Reduce the likelihood of detecting a pitch when the signal has low amplitude.")); + action->setCheckable(true); + action->setChecked(lowamp); + connect(action, SIGNAL(triggered()), this, SLOT(lowampAnalysisToggled())); + menu->addAction(action); + } void @@ -876,6 +885,22 @@ } void +MainWindow::lowampAnalysisToggled() +{ + QAction *a = qobject_cast<QAction *>(sender()); + if (!a) return; + + bool set = a->isChecked(); + + QSettings settings; + settings.beginGroup("Analyser"); + settings.setValue("lowamp-analysis", set); + settings.endGroup(); + + // don't run analyseNow() automatically -- it's a destructive operation +} + +void MainWindow::setupHelpMenu() { QMenu *menu = menuBar()->addMenu(tr("&Help"));