diff --git a/AUTHORS b/AUTHORS index 0df34e704..fd26b2551 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,6 +2,10 @@ Tobias Doerffel Maintainer, main-development, artwork etc. +Paul Giblock + + development + Danny McRae development @@ -10,22 +14,22 @@ Javier Serrano Polo development -Paul Giblock - - development +Andreas Brandmaier + + BitInvader plugin -Zolo - - theme "Blue Scene" +Juan Fabián Simón + + version 4.0 plugin artwork Sebastian Tilsch recording of many samples +Zolo + + theme "Blue Scene" + gabriel additional artwork - -Andreas Brandmaier - - BitInvader plugin diff --git a/ChangeLog b/ChangeLog index a29d47cf4..dd0048d58 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-05-27 Paul Giblock + + * src/gui/piano_roll.cpp: + - Improve selection of volume-bars on a chord. Select closest note + instead of whichever one was created first. + - Display volume-change handles on top of the bars instead of possibly + underneith other bars when dealing with chords + + * AUTHORS: + Add Juan (Fabi) to authors, organize names more alphabetically + 2008-05-30 Tobias Doerffel * plugins/ladspa_effect/ladspa_effect.cpp: diff --git a/src/gui/piano_roll.cpp b/src/gui/piano_roll.cpp index 7e827f5a7..e34547963 100644 --- a/src/gui/piano_roll.cpp +++ b/src/gui/piano_roll.cpp @@ -946,6 +946,24 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me ) { vol = 2 * ( -_me->y() + height() - PR_BOTTOM_MARGIN ); + + int shortVolumeDiff = MaxVolume - MinVolume; + noteVector::const_iterator jt = notes.begin(); + while( jt != notes.end() ) + { + if( (*jt)->pos() == (*it)->pos() && (*jt)->length().getTicks() > 0 ) + { + + int volDiff = abs( vol - (*jt)->getVolume() ); + if( volDiff <= shortVolumeDiff ) + { + shortVolumeDiff = volDiff; + it = jt; + } + } + ++jt; + } + ( *it )->setVolume( vol ); m_currentNote = *it; m_action = CHANGE_NOTE_VOLUME; @@ -971,7 +989,7 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me ) // +32 to quanitize the note correctly when placing notes with // the mouse. We do this here instead of in note.quantized // because live notes should still be quantized at the half. - midiTime note_pos( pos_ticks - (quantization() / 2) ); + midiTime note_pos( pos_ticks - ( quantization() / 2 ) ); midiTime note_len( newNoteLen() ); note new_note( note_len, note_pos, key_num ); @@ -1202,15 +1220,13 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) // get note-vector of current pattern const noteVector & notes = m_pattern->notes(); - // will be our iterator in the following loop - noteVector::const_iterator it = notes.begin(); - note * shortNote = NULL; // Max "snap length" 1/8 note on either side int shortDistance = DefaultTicksPerTact/8; // loop through vector to find nearest note + noteVector::const_iterator it = notes.begin(); while( it != notes.end() ) { int tmp = abs( pos_ticks - (int)( (*it)->pos() ) ); @@ -1225,6 +1241,41 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) } + volume vol = tLimit( 2 * ( -_me->y() + + height() - + PR_BOTTOM_MARGIN ), + MinVolume, + MaxVolume ); + + if( shortNote ) + { + // have short length - now check for volume difference and currentNote + it = notes.begin(); + + int shortNotePos = shortNote->pos(); + int shortVolumeDiff = MaxVolume-MinVolume; + + while( it != notes.end() ) + { + if( (*it)->pos() == shortNotePos && (*it)->length().getTicks() > 0 ) + { + if( *it == m_currentNote ) + { + shortNote = m_currentNote; + break; + } + + int volDiff = abs( vol - (*it)->getVolume() ); + if( volDiff <= shortVolumeDiff ) + { + shortVolumeDiff = volDiff; + shortNote = *it; + } + } + ++it; + } + } + if( shortNote != m_currentNote && engine::getSong()->isPlaying() == FALSE ) { @@ -1245,11 +1296,6 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) m_currentNote = shortNote; if( m_currentNote != NULL ) { - volume vol = tLimit( 2 * ( -_me->y() + - height() - - PR_BOTTOM_MARGIN ), - MinVolume, - MaxVolume ); m_currentNote->setVolume( vol ); m_pattern->dataChanged(); m_pattern->getInstrumentTrack()->processInEvent( @@ -1896,6 +1942,8 @@ void pianoRoll::paintEvent( QPaintEvent * _pe ) const int visible_keys = ( height() - PR_TOP_MARGIN - PR_BOTTOM_MARGIN - m_notesEditHeight ) / KEY_LINE_HEIGHT + 2; + + QPolygon volumeHandles; for( noteVector::const_iterator it = notes.begin(); it != notes.end(); ++it ) @@ -1971,12 +2019,12 @@ void pianoRoll::paintEvent( QPaintEvent * _pe ) ( *it )->getVolume() / 2, x + WHITE_KEY_WIDTH, height() - PR_BOTTOM_MARGIN ); - p.drawLine( x + WHITE_KEY_WIDTH-1, + + + volumeHandles << QPoint( x + WHITE_KEY_WIDTH + 1, height() - PR_BOTTOM_MARGIN - - ( *it )->getVolume() / 2+1, - x + WHITE_KEY_WIDTH + 1, - height()-PR_BOTTOM_MARGIN - - (*it)->getVolume() / 2 + 1 ); + ( *it )->getVolume() / 2+1 ); + if( ( *it )->hasDetuningInfo() ) { drawDetuningInfo( p, *it, @@ -1984,6 +2032,11 @@ void pianoRoll::paintEvent( QPaintEvent * _pe ) y_base - key * KEY_LINE_HEIGHT ); } } + + p.setPen( QPen( QColor( 0xEA, 0xA1, 0x00 ), + NE_LINE_WIDTH*2 ) ); + p.drawPoints( volumeHandles ); + } else {