diff src/MainWindow.cpp @ 321:9b131c32fcb7

Merge
author Chris Cannam
date Fri, 13 Jun 2014 13:46:09 +0100
parents 68779eb910c7
children 8a884e1e3912 b3ed6e562ee5
line wrap: on
line diff
--- a/src/MainWindow.cpp	Fri Jun 13 13:45:40 2014 +0100
+++ b/src/MainWindow.cpp	Fri Jun 13 13:46:09 2014 +0100
@@ -133,6 +133,7 @@
     cdb->setUseDarkBackground(cdb->addColour(QColor(255, 188, 80), tr("Bright Orange")), true);
 
     Preferences::getInstance()->setResampleOnLoad(true);
+    Preferences::getInstance()->setFixedSampleRate(44100);
     Preferences::getInstance()->setSpectrogramSmoothing
         (Preferences::SpectrogramInterpolated);
 
@@ -414,6 +415,7 @@
     setupFileMenu();
     setupEditMenu();
     setupViewMenu();
+    setupAnalysisMenu();
 
     m_mainMenusCreated = true;
 }
@@ -479,9 +481,7 @@
     menu->addAction(action);
     toolbar->addAction(action);
 
-    icon = il.load("filesave");
-    icon.addPixmap(il.loadPixmap("filesave-22"));
-    action = new QAction(icon, tr("Save Session to Audio &Path"), this);
+    action = new QAction(tr("Save Session to Audio &Path"), this);
     action->setShortcut(tr("Ctrl+Alt+S"));
     action->setStatusTip(tr("Save the current session into a %1 session file with the same filename as the audio but a .ton extension.").arg(QApplication::applicationName()));
     connect(action, SIGNAL(triggered()), this, SLOT(saveSessionInAudioPath()));
@@ -801,6 +801,41 @@
 }
 
 void
+MainWindow::setupAnalysisMenu()
+{
+    if (m_mainMenusCreated) return;
+
+    IconLoader il;
+
+    QAction *action = 0;
+
+    QMenu *menu = menuBar()->addMenu(tr("&Analysis"));
+    menu->setTearOffEnabled(true);
+
+    m_keyReference->setCategory(tr("Analysis"));
+
+    action = new QAction(tr("&Analyse now"), this);
+    action->setShortcut(tr("Ctrl+P"));
+    action->setStatusTip(tr("Analyse audio now to extract pitches and notes. (This will delete all existing pitches and notes.)"));
+    menu->addAction(action);
+    m_keyReference->registerShortcut(action);
+
+    menu->addSeparator();
+
+    action = new QAction(tr("Automatically Analyse &New Audio"), this);
+    action->setCheckable(true);
+    action->setChecked(true);
+    menu->addAction(action);
+
+    action = new QAction(tr("Analyse &Without Frequency-dependent Timing Bias (slow)"), this);
+    action->setCheckable(true);
+    action->setChecked(false);
+    
+    menu->addAction(action);
+
+}
+
+void
 MainWindow::setupHelpMenu()
 {
     QMenu *menu = menuBar()->addMenu(tr("&Help"));