changeset 224:445dcb9026a9

Fix for #892 (Cannot export pitch track)
author Chris Cannam
date Fri, 07 Mar 2014 16:27:10 +0000
parents d323b5d41570
children dd97a58277ea
files .hgsubstate src/MainWindow.cpp src/MainWindow.h
diffstat 3 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Fri Mar 07 16:01:04 2014 +0000
+++ b/.hgsubstate	Fri Mar 07 16:27:10 2014 +0000
@@ -1,4 +1,4 @@
-32d91b97af7c34b628d819f8fe80073d41cd07f0 chp
+d2f7a8295671a2b955d47bb05ff4cd06b94e9d41 chp
 236814e07bd07473958c1ff89103124536a0c3c8 dataquay
 60eb8771d34050e3bed8e715f5fcd0275de469ef pyin
 27d4e7152c954bf3c4387319db088fb3cd02436b sv-dependency-builds
--- 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"));
--- a/src/MainWindow.h	Fri Mar 07 16:01:04 2014 +0000
+++ b/src/MainWindow.h	Fri Mar 07 16:27:10 2014 +0000
@@ -30,6 +30,10 @@
                bool withOSCSupport = true);
     virtual ~MainWindow();
 
+signals:
+    virtual void canExportPitchTrack(bool);
+    virtual void canExportNotes(bool);
+
 public slots:
     virtual bool commitData(bool mayAskUser); // on session shutdown