diff --git a/include/note_play_handle.h b/include/note_play_handle.h index ca58047e2..78a696b9b 100644 --- a/include/note_play_handle.h +++ b/include/note_play_handle.h @@ -27,6 +27,8 @@ #ifndef _NOTE_PLAY_HANDLE_H #define _NOTE_PLAY_HANDLE_H +#include + #include "play_handle.h" #include "basic_filters.h" #include "note.h" @@ -39,12 +41,15 @@ typedef vvector notePlayHandleVector; typedef vvector constNotePlayHandleVector; -class notePlayHandle : public playHandle, public note +class notePlayHandle : public QObject, public playHandle, public note { + Q_OBJECT public: void * m_pluginData; basicFilters<> * m_filter; + float m_frequency; + notePlayHandle( instrumentTrack * _chnl_trk, const f_cnt_t _frames_ahead, const f_cnt_t _frames, const note & _n, const bool _arp_note = FALSE ); @@ -191,6 +196,10 @@ private: // sub-note) bool m_muted; // indicates whether note is muted + +private slots: + void updateFrequency( void ); + } ; #endif diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index 2acc87051..b05a5a0d0 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -59,6 +59,10 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it, m_arpNote( _arp_note ), m_muted( FALSE ) { + connect( m_instrumentTrack, SIGNAL( baseNoteChanged() ), + this, SLOT( updateFrequency() ) ); + updateFrequency(); + setFrames( _frames ); if( !configManager::inst()->value( "ui", "manualchannelpiano" ).toInt() ) @@ -391,4 +395,15 @@ bool notePlayHandle::operator==( const notePlayHandle & _nph ) const + +void notePlayHandle::updateFrequency( void ) +{ + m_frequency = m_instrumentTrack->frequency( this ); +} + + + +#include "note_play_handle.moc" + + #endif