diff src/MainWindow.cpp @ 325:ef75afbe4c67

Wire up "analyse now"
author Chris Cannam
date Fri, 13 Jun 2014 14:36:30 +0100
parents ac662fca8058
children b176ea403ee8
line wrap: on
line diff
--- a/src/MainWindow.cpp	Fri Jun 13 14:21:53 2014 +0100
+++ b/src/MainWindow.cpp	Fri Jun 13 14:36:30 2014 +0100
@@ -2986,8 +2986,23 @@
 void
 MainWindow::analyseNow()
 {
-    //!!!
     cerr << "analyseNow called" << endl;
+    if (!m_analyser) return;
+
+    CommandHistory::getInstance()->startCompoundOperation
+        (tr("Analyse Audio"), true);
+
+    QString error = m_analyser->analyseExistingFile();
+
+    CommandHistory::getInstance()->endCompoundOperation();
+
+    if (error != "") {
+        QMessageBox::warning
+            (this,
+             tr("Failed to analyse audio"),
+             tr("<b>Analysis failed</b><p>%1</p>").arg(error),
+             QMessageBox::Ok);
+    }
 }
 
 void