diff src/MainWindow.cpp @ 224:445dcb9026a9

Fix for #892 (Cannot export pitch track)
author Chris Cannam
date Fri, 07 Mar 2014 16:27:10 +0000
parents 50122e9b817e
children 9bdff8d10a86
line wrap: on
line diff
--- a/src/MainWindow.cpp	Fri Mar 07 16:01:04 2014 +0000
+++ b/src/MainWindow.cpp	Fri Mar 07 16:27:10 2014 +0000
@@ -446,13 +446,13 @@
     action = new QAction(tr("Export Pitch Track Data..."), this);
     action->setStatusTip(tr("Export pitch-track data to a file"));
     connect(action, SIGNAL(triggered()), this, SLOT(exportPitchLayer()));
-    connect(this, SIGNAL(canExportLayer(bool)), action, SLOT(setEnabled(bool)));
+    connect(this, SIGNAL(canExportPitchTrack(bool)), action, SLOT(setEnabled(bool)));
     menu->addAction(action);
 
     action = new QAction(tr("Export Note Data..."), this);
     action->setStatusTip(tr("Export note data to a file"));
     connect(action, SIGNAL(triggered()), this, SLOT(exportNoteLayer()));
-    connect(this, SIGNAL(canExportLayer(bool)), action, SLOT(setEnabled(bool)));
+    connect(this, SIGNAL(canExportNotes(bool)), action, SLOT(setEnabled(bool)));
     menu->addAction(action);
 
     menu->addSeparator();
@@ -1059,6 +1059,11 @@
     emit canSpeedUpPlayback(v < m_playSpeed->maximum());
     emit canSlowDownPlayback(v > m_playSpeed->minimum());
 
+    emit canExportPitchTrack(m_analyser->isVisible(Analyser::PitchTrack) &&
+                             m_analyser->getLayer(Analyser::PitchTrack));
+    emit canExportNotes(m_analyser->isVisible(Analyser::Notes) &&
+                        m_analyser->getLayer(Analyser::Notes));
+
     if (pitchCandidatesVisible) {
         m_showCandidatesAction->setText(tr("Hide Pitch Candidates"));
         m_showCandidatesAction->setStatusTip(tr("Remove the display of alternate pitch candidates for the selected region"));