Mercurial > hg > tony
comparison src/MainWindow.cpp @ 350:fc0c4cfad044
Merge
author | Chris Cannam |
---|---|
date | Mon, 16 Jun 2014 12:50:44 +0100 |
parents | c66ec7f40acb |
children | 56109ef020b4 0b08d860081b ffd1a89a68fa |
comparison
equal
deleted
inserted
replaced
349:ff00432761ce | 350:fc0c4cfad044 |
---|---|
833 | 833 |
834 QSettings settings; | 834 QSettings settings; |
835 settings.beginGroup("Analyser"); | 835 settings.beginGroup("Analyser"); |
836 bool autoAnalyse = settings.value("auto-analysis", true).toBool(); | 836 bool autoAnalyse = settings.value("auto-analysis", true).toBool(); |
837 bool precise = settings.value("precision-analysis", false).toBool(); | 837 bool precise = settings.value("precision-analysis", false).toBool(); |
838 bool lowamp = settings.value("lowamp-analysis", true).toBool(); | |
838 settings.endGroup(); | 839 settings.endGroup(); |
839 | 840 |
840 action = new QAction(tr("Auto-Analyse &New Audio"), this); | 841 action = new QAction(tr("Auto-Analyse &New Audio"), this); |
841 action->setStatusTip(tr("Automatically trigger analysis upon opening of a new audio file.")); | 842 action->setStatusTip(tr("Automatically trigger analysis upon opening of a new audio file.")); |
842 action->setCheckable(true); | 843 action->setCheckable(true); |
848 action->setStatusTip(tr("Use a symmetric window in YIN to remove frequency-dependent timing bias. (This is slow!)")); | 849 action->setStatusTip(tr("Use a symmetric window in YIN to remove frequency-dependent timing bias. (This is slow!)")); |
849 action->setCheckable(true); | 850 action->setCheckable(true); |
850 action->setChecked(precise); | 851 action->setChecked(precise); |
851 connect(action, SIGNAL(triggered()), this, SLOT(precisionAnalysisToggled())); | 852 connect(action, SIGNAL(triggered()), this, SLOT(precisionAnalysisToggled())); |
852 menu->addAction(action); | 853 menu->addAction(action); |
854 | |
855 action = new QAction(tr("&Penalise Soft Pitches"), this); | |
856 action->setStatusTip(tr("Reduce the likelihood of detecting a pitch when the signal has low amplitude.")); | |
857 action->setCheckable(true); | |
858 action->setChecked(lowamp); | |
859 connect(action, SIGNAL(triggered()), this, SLOT(lowampAnalysisToggled())); | |
860 menu->addAction(action); | |
861 | |
853 } | 862 } |
854 | 863 |
855 void | 864 void |
856 MainWindow::autoAnalysisToggled() | 865 MainWindow::autoAnalysisToggled() |
857 { | 866 { |
875 bool set = a->isChecked(); | 884 bool set = a->isChecked(); |
876 | 885 |
877 QSettings settings; | 886 QSettings settings; |
878 settings.beginGroup("Analyser"); | 887 settings.beginGroup("Analyser"); |
879 settings.setValue("precision-analysis", set); | 888 settings.setValue("precision-analysis", set); |
889 settings.endGroup(); | |
890 | |
891 // don't run analyseNow() automatically -- it's a destructive operation | |
892 } | |
893 | |
894 void | |
895 MainWindow::lowampAnalysisToggled() | |
896 { | |
897 QAction *a = qobject_cast<QAction *>(sender()); | |
898 if (!a) return; | |
899 | |
900 bool set = a->isChecked(); | |
901 | |
902 QSettings settings; | |
903 settings.beginGroup("Analyser"); | |
904 settings.setValue("lowamp-analysis", set); | |
880 settings.endGroup(); | 905 settings.endGroup(); |
881 | 906 |
882 // don't run analyseNow() automatically -- it's a destructive operation | 907 // don't run analyseNow() automatically -- it's a destructive operation |
883 } | 908 } |
884 | 909 |