diff --git a/ChangeLog b/ChangeLog index eb57340e5..91b432443 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-11-28 Andrew Kelley + * src/gui/piano_roll.cpp: + * src/core/note.cpp: + copy/paste selection support + + * TODO: + added a bunch + 2008-11-28 Tobias Doerffel * include/mmp.h: diff --git a/TODO b/TODO index 9f077c48d..ee24588d1 100644 --- a/TODO +++ b/TODO @@ -51,6 +51,7 @@ - add FLAC as export-format? Andrew Kelley's todo: +- when you draw a note, if there's a selection it should clear it - piano roll, copy and paste notes - remove the move tool, it's irrelevant now - holding control and shift shouldn't bring up the automation window @@ -59,12 +60,15 @@ Andrew Kelley's todo: - moving a group of notes shouldn't crunch them together if brought to boundary conditions - moving a group with an unquantized note will quantize that note when you move the selection (this is bad) - undo/redo for piano roll +- when you clone a track in the song editor, rename the track so that it doesn't have the same name (increment the number if necessary) - doing actions on the piano roll when LMMS doesn't have focus is glitchy - +- somehow enable easy pattern copy pasting in the beat+bassline editor - make knobs easier to tune (less sensitive) - +- make copy/paste work beyond inside piano roll - it didn't work when I copied notes from one pattern and then opened another pattern and pasted. - make it so you can see the notes when putting a pattern in the playlist - make the menu for a channel happen when you right click, instead of renaming, and make the midi input a top-level menu item - segfault on quit - recording automation - dragging a note below the automation level messes up dragging it's weird and glitchy fix it +- adding/removing steps to the beat+bassline editor is awkward +- the 'add beat+bassline' button in the beat+bassline editor is misleading - I say we remove it and rely on the song editor to add beat+basslines diff --git a/src/core/note.cpp b/src/core/note.cpp index b854d7976..732bda4de 100644 --- a/src/core/note.cpp +++ b/src/core/note.cpp @@ -69,9 +69,9 @@ note::note( const note & _note ) : m_volume( _note.m_volume ), m_panning( _note.m_panning ), m_length( _note.m_length ), - m_pos( _note.m_pos ) + m_pos( _note.m_pos ), + m_selected( _note.m_selected ) { - setSelected( false ); m_detuning = sharedObject::ref( _note.m_detuning ); } diff --git a/src/gui/piano_roll.cpp b/src/gui/piano_roll.cpp index 1c9196190..5cd9c07be 100644 --- a/src/gui/piano_roll.cpp +++ b/src/gui/piano_roll.cpp @@ -2722,39 +2722,14 @@ void pianoRoll::getSelectedNotes( noteVector & _selected_notes ) return; } - int sel_pos_start = m_selectStartTick; - int sel_pos_end = sel_pos_start + m_selectedTick; - if( sel_pos_start > sel_pos_end ) - { - qSwap( sel_pos_start, sel_pos_end ); - } - - int sel_key_start = m_selectStartKey; - int sel_key_end = sel_key_start + m_selectedKeys; - if( sel_key_start > sel_key_end ) - { - qSwap( sel_key_start, sel_key_end ); - } - const noteVector & notes = m_pattern->notes(); for( noteVector::const_iterator it = notes.begin(); it != notes.end(); ++it ) { - Sint32 len_ticks = ( *it )->length(); - - if( len_ticks > 0 ) + if( ( *it )->getSelected() ) { - int key = ( *it )->key(); - Sint32 pos_ticks = ( *it )->pos(); - - if( key > sel_key_start && - key <= sel_key_end && - pos_ticks >= sel_pos_start && - pos_ticks+len_ticks <= sel_pos_end ) - { - _selected_notes.push_back( *it ); - } + _selected_notes.push_back( *it ); } } } @@ -2794,11 +2769,6 @@ void pianoRoll::copySelectedNotes( void ) if( selected_notes.empty() == false ) { copy_to_clipboard( selected_notes ); - - textFloat::displayMessage( tr( "Notes copied" ), - tr( "All selected notes were copied to the " - "clipboard." ), - embed::getIconPixmap( "edit_copy" ), 2000 ); } } @@ -2854,11 +2824,21 @@ void pianoRoll::pasteNotes( void ) QDomNodeList list = mmp.elementsByTagName( note::classNodeName() ); + + // remove selection and select the newly pasted notes + clearSelectedNotes(); + for( int i = 0; !list.item( i ).isNull(); ++i ) { + // create the note note cur_note; cur_note.restoreState( list.item( i ).toElement() ); cur_note.setPos( cur_note.pos() + m_timeLine->pos() ); + + // select it + cur_note.setSelected( true ); + + // add to pattern m_pattern->addNote( cur_note ); }