changeset 591:0946feb81b79 sonification

Add playExampleNote route through view manager out to the audio play source
author Chris Cannam
date Fri, 24 Jun 2011 16:42:48 +0100
parents 241929c5d57c
children a13aa5320221
files layer/SpectrogramLayer.cpp view/View.cpp view/View.h view/ViewManager.cpp view/ViewManager.h
diffstat 5 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/layer/SpectrogramLayer.cpp	Fri Jun 24 14:27:32 2011 +0100
+++ b/layer/SpectrogramLayer.cpp	Fri Jun 24 16:42:48 2011 +0100
@@ -3798,7 +3798,10 @@
 
         std::cerr<< "Frequency: " << freq << " " << unit.toStdString() << " (midi pitch = " << midipitch << ")" << std::endl;
 
+        v->playExampleNote(midipitch);
+
         return true;
+
     } else {
         return false;
     }
--- a/view/View.cpp	Fri Jun 24 14:27:32 2011 +0100
+++ b/view/View.cpp	Fri Jun 24 16:42:48 2011 +0100
@@ -2365,6 +2365,12 @@
 }
 
 void
+View::playExampleNote(int midiPitch) const
+{
+    if (m_manager) m_manager->playExampleNote(midiPitch);
+}
+
+void
 View::toXml(QTextStream &stream,
             QString indent, QString extraAttributes) const
 {
--- a/view/View.h	Fri Jun 24 14:27:32 2011 +0100
+++ b/view/View.h	Fri Jun 24 16:42:48 2011 +0100
@@ -307,6 +307,8 @@
 
     virtual void progressCheckStalledTimerElapsed();
 
+    virtual void playExampleNote(int midiPitch) const;
+
 protected:
     View(QWidget *, bool showProgress);
     virtual void paintEvent(QPaintEvent *e);
--- a/view/ViewManager.cpp	Fri Jun 24 14:27:32 2011 +0100
+++ b/view/ViewManager.cpp	Fri Jun 24 16:42:48 2011 +0100
@@ -190,6 +190,12 @@
     else return m_playbackModel->alignFromReference(frame);
 }
 
+void
+ViewManager::playExampleNote(int midiPitch)
+{
+    m_playSource->queueExampleNote(midiPitch);
+}
+
 bool
 ViewManager::haveInProgressSelection() const
 {
--- a/view/ViewManager.h	Fri Jun 24 14:27:32 2011 +0100
+++ b/view/ViewManager.h	Fri Jun 24 16:42:48 2011 +0100
@@ -243,6 +243,7 @@
     void viewZoomLevelChanged(unsigned long, bool);
     void setGlobalCentreFrame(unsigned long);
     void setPlaybackFrame(unsigned long);
+    void playExampleNote(int midiPitch);
 
 protected slots:
     void checkPlayStatus();