# HG changeset patch # User Chris Cannam # Date 1308930168 -3600 # Node ID 0946feb81b79613b3ef10337639a36ece5dc39a2 # Parent 241929c5d57c88572a9834f31baa7a9d9577dcd0 Add playExampleNote route through view manager out to the audio play source diff -r 241929c5d57c -r 0946feb81b79 layer/SpectrogramLayer.cpp --- 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; } diff -r 241929c5d57c -r 0946feb81b79 view/View.cpp --- 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 { diff -r 241929c5d57c -r 0946feb81b79 view/View.h --- 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); diff -r 241929c5d57c -r 0946feb81b79 view/ViewManager.cpp --- 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 { diff -r 241929c5d57c -r 0946feb81b79 view/ViewManager.h --- 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();