From 66f98a30175e7583bf989cd39432372b09025cd3 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Fri, 20 Jun 2008 23:34:43 +0000 Subject: [PATCH] full context-menu for piano-basenote so it can be automated as well as controlled via controller git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1161 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 17 +++++++++++++++-- include/automatable_model_view.h | 4 ++-- src/core/piano.cpp | 9 +++------ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index f646a8776..af5cff1ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2008-06-20 Tobias Doerffel + * include/automatable_model_view.h: + * src/core/piano.cpp: + full context-menu for piano-basenote so it can be automated as well as + controlled via controller + + * src/gui/widgets/knob.cpp: + - when linking knobs via Shift+Drag do not use pointer to model as + drag-data rather than model-ID which can be resolved via + project-journal + - fixed displayValue() + * Makefile.am: * include/knob.h: * include/volume_knob.h: @@ -39,8 +50,10 @@ * include/tempo_sync_knob.h: * src/gui/widgets/tempo_sync_knob.cpp: - do not re-implement private event-handlers and use knob's signals - instead + - do not re-implement private event-handlers and use knob's signals + instead + - fixed crash when closing meterDialog and choosing custom-sync + afterwards * src/gui/fx_mixer_view.cpp: better initial position of FX-mixer view diff --git a/include/automatable_model_view.h b/include/automatable_model_view.h index 5c00645b9..39e6ca6e6 100644 --- a/include/automatable_model_view.h +++ b/include/automatable_model_view.h @@ -82,10 +82,10 @@ public: m_unit = _unit; } - -protected: void addDefaultActions( QMenu * _menu ); + +protected: QString m_description; QString m_unit; diff --git a/src/core/piano.cpp b/src/core/piano.cpp index 80ea87e7d..a2aa1f887 100644 --- a/src/core/piano.cpp +++ b/src/core/piano.cpp @@ -209,7 +209,7 @@ pianoView::pianoView( QWidget * _parent ) : m_pianoScroll = new QScrollBar( Qt::Horizontal, this ); m_pianoScroll->setRange( 0, WhiteKeysPerOctave * ( NumOctaves - 3 ) - - 4 ); + 5 ); m_pianoScroll->setSingleStep( 1 ); m_pianoScroll->setPageStep( 20 ); m_pianoScroll->setValue( Octave_3 * WhiteKeysPerOctave ); @@ -400,11 +400,8 @@ void pianoView::contextMenuEvent( QContextMenuEvent * _me ) } captionMenu contextMenu( tr( "Base note" ) ); - contextMenu.addAction( embed::getIconPixmap( "automation" ), - tr( "&Open in automation editor" ), - m_piano->m_instrumentTrack->baseNoteModel()-> - getAutomationPattern(), - SLOT( openInAutomationEditor() ) ); + automatableModelView amv( m_piano->m_instrumentTrack->baseNoteModel() ); + amv.addDefaultActions( &contextMenu ); contextMenu.exec( QCursor::pos() ); }