From cbe50bf6ef7c46d6e6c39497c2d25d44b1155cbc Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 8 Dec 2008 21:20:45 +0000 Subject: [PATCH] disabled note volume editing while dragging a selection git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1891 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 1 + src/gui/piano_roll.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 919e998ca..84b430215 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ * src/gui/piano_roll.cpp: ability to scroll left and right while using ctrl to select notes + disabled volume bar changes while dragging a selection 2008-12-08 Tobias Doerffel diff --git a/src/gui/piano_roll.cpp b/src/gui/piano_roll.cpp index 758cf842a..d3cd4f1f5 100644 --- a/src/gui/piano_roll.cpp +++ b/src/gui/piano_roll.cpp @@ -1574,8 +1574,10 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) if( _me->y() > PR_TOP_MARGIN ) { - bool edit_note = ( _me->y() > height() - - PR_BOTTOM_MARGIN - m_notesEditHeight ); + bool edit_note = ( _me->y() > + height() - PR_BOTTOM_MARGIN - m_notesEditHeight ) + && m_action != ActionSelectNotes; + int key_num = getKey( _me->y() ); int x = _me->x(); @@ -1612,16 +1614,18 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) } x -= WHITE_KEY_WIDTH; - // Volume Bars if( _me->buttons() & Qt::LeftButton && m_editMode == ModeDraw && (m_action == ActionMoveNote || m_action == ActionResizeNote ) ) { + // handle moving notes and resizing them dragNotes(_me->x(), _me->y(), _me->modifiers() & Qt::AltModifier); } else if( ( edit_note == true || m_action == ActionChangeNoteVolume ) && _me->buttons() & Qt::LeftButton ) { + // Volume Bars + // Use nearest-note when changing volume so the bars can // be "scribbled" int pos_ticks = ( x * midiTime::ticksPerTact() ) /