From 2216a85737518ee36f750d13aee0614eb99910f8 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sat, 23 Aug 2008 19:18:35 +0000 Subject: [PATCH] made base-note automatable via drag'n'drop git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1478 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 15 +++++++++++++++ src/core/piano.cpp | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ebde5a9f4..973857c45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2008-08-23 Tobias Doerffel + + * src/gui/automatable_model_view.cpp: + coding style fixes + + * src/gui/string_pair_drag.cpp: + if no pixmap was given and parent-widget is valid, use a snapshot of + the widget as drag-icon + + * src/tracks/instrument_track.cpp: + added display-name for baseNoteModel + + * src/core/piano.cpp: + made base-note automatable via drag'n'drop + 2008-08-22 Paul Giblock * include/automatable_model.h: diff --git a/src/core/piano.cpp b/src/core/piano.cpp index 24447aaaf..a22bb6dc2 100644 --- a/src/core/piano.cpp +++ b/src/core/piano.cpp @@ -53,6 +53,8 @@ #include "gui_templates.h" #include "instrument_track.h" #include "knob.h" +#include "string_pair_drag.h" +#include "main_window.h" #include "midi.h" #include "templates.h" #include "update_event.h" @@ -502,8 +504,20 @@ void pianoView::mousePressEvent( QMouseEvent * _me ) } else { - m_piano->m_instrumentTrack->baseNoteModel()-> + if( engine::getMainWindow()->isCtrlPressed() ) + { + new stringPairDrag( "automatable_model", + QString::number( m_piano-> + m_instrumentTrack-> + baseNoteModel()->id() ), + QPixmap(), this ); + _me->accept(); + } + else + { + m_piano->m_instrumentTrack->baseNoteModel()-> setInitValue( key_num ); + } } // and let the user see that he pressed a key... :)