diff --git a/ChangeLog b/ChangeLog index 53a82cd64..1bd3ee28b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,8 +2,10 @@ * include/piano_roll.h: * src/gui/piano_roll.cpp: - double click in the note edit area to clear selected notes (allowing you - to edit note velocities/panning for all notes) + - double click in the note edit area to clear selected notes (allowing you + to edit note velocities/panning for all notes) + - when setting a new note, set panning and volume to that of last + clicked on note 2008-12-14 Tobias Doerffel diff --git a/TODO b/TODO index a88f56fd5..47c67bd0b 100644 --- a/TODO +++ b/TODO @@ -52,10 +52,8 @@ - add FLAC as export-format? Andrew Kelley's todo: -- when setting a new note, set panning and volume to that of last note - figure out a way to not make editing note volume awkward. AKA don't select notes just by clicking on them, and don't select newly created notes - - if you press both controls at the same time, the piano roll gets stuck in selection mode - multiview button - show notes from every instrument in the current beat+bassline with different colors - undo/redo for piano roll diff --git a/include/piano_roll.h b/include/piano_roll.h index 4de787707..bf32ce651 100644 --- a/include/piano_roll.h +++ b/include/piano_roll.h @@ -273,7 +273,11 @@ private: int m_ppt; int m_totalKeysToScroll; + // remember these values to use them + // for the next note that is set midiTime m_lenOfNewNotes; + volume m_lastNoteVolume; + panning m_lastNotePanning; int m_startKey; // first key when drawing int m_lastKey; diff --git a/src/gui/piano_roll.cpp b/src/gui/piano_roll.cpp index a903d517f..25375f4e2 100644 --- a/src/gui/piano_roll.cpp +++ b/src/gui/piano_roll.cpp @@ -155,6 +155,8 @@ pianoRoll::pianoRoll( void ) : m_notesEditHeight( 100 ), m_ppt( DEFAULT_PR_PPT ), m_lenOfNewNotes( midiTime( 0, DefaultTicksPerTact/4 ) ), + m_lastNoteVolume( DefaultVolume ), + m_lastNotePanning( DefaultPanning ), m_startKey( INITIAL_START_KEY ), m_lastKey( 0 ), m_editMode( ModeDraw ), @@ -1346,6 +1348,8 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me ) note new_note( note_len, note_pos, key_num ); new_note.setSelected( true ); + new_note.setPanning( m_lastNotePanning ); + new_note.setVolume( m_lastNoteVolume ); created_new_note = m_pattern->addNote( new_note ); // reset it so that it can be used for @@ -1362,6 +1366,9 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me ) } m_currentNote = *it; + m_lastNotePanning = ( *it )->getPanning(); + m_lastNoteVolume = ( *it )->getVolume(); + m_lenOfNewNotes = ( *it )->length(); // remember which key and tick we started with m_mouseDownKey = m_startKey; @@ -1920,6 +1927,17 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) ( (float)( PanningRight - PanningLeft ) ), PanningLeft, PanningRight); + if( m_noteEditMode == NoteEditVolume ) + { + m_lastNoteVolume = vol; + } + else if( m_noteEditMode == NoteEditPanning ) + { + m_lastNotePanning = pan; + } + + + // loop through vector bool use_selection = isSelection(); noteVector::const_iterator it = notes.begin();