diff --git a/ChangeLog b/ChangeLog index 939feadd8..18eca1446 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,13 @@ * plugins/sf2_player/sf2_player.cpp: Initialize gain at 1.0 + * src/core/automation_pattern.cpp: + Correctly draw automation TCO for negative minValues. + + * src/gui/controller_connection_dialog.cpp: + - Connect cancel button + - Make mapping function read-only for alpha release + 2008-06-28 Tobias Doerffel * plugins/Makefile.am: diff --git a/src/core/automation_pattern.cpp b/src/core/automation_pattern.cpp index 0a5515995..8f8d8364e 100644 --- a/src/core/automation_pattern.cpp +++ b/src/core/automation_pattern.cpp @@ -621,7 +621,14 @@ void automationPatternView::paintEvent( QPaintEvent * ) height() - 2 * TCO_BORDER_WIDTH ); } - const float y_scale = m_pat->firstObject()->maxValue(); + const float y_scale = m_pat->firstObject()->maxValue() - + m_pat->firstObject()->minValue(); + const float h = ( height()-2*TCO_BORDER_WIDTH ) / + y_scale; + + p.translate( 0.0f, m_pat->firstObject()->maxValue() * + height() / y_scale ); + p.scale( 1.0f, -h ); for( automationPattern::timeMap::const_iterator it = m_pat->getTimeMap().begin(); @@ -638,12 +645,11 @@ void automationPatternView::paintEvent( QPaintEvent * ) { x2 = width() - TCO_BORDER_WIDTH + 1; } - const float h = ( height()-2*TCO_BORDER_WIDTH ) * it.value() / - y_scale; - p.fillRect( QRectF( x1, height()-TCO_BORDER_WIDTH-h, x2-x1, h ), + p.fillRect( QRectF( x1, 0.0f, x2-x1, it.value() ), QColor( 255, 224, 0 ) ); } + p.resetMatrix(); p.setFont( pointSize<7>( p.font() ) ); if( m_pat->isMuted() || m_pat->getTrack()->isMuted() ) { diff --git a/src/gui/controller_connection_dialog.cpp b/src/gui/controller_connection_dialog.cpp index f733e5649..b304464c4 100644 --- a/src/gui/controller_connection_dialog.cpp +++ b/src/gui/controller_connection_dialog.cpp @@ -199,6 +199,7 @@ controllerConnectionDialog::controllerConnectionDialog( QWidget * _parent, m_mappingFunction = new QLineEdit( m_mappingBox ); m_mappingFunction->setGeometry( 10, 20, 170, 16 ); m_mappingFunction->setText( "input" ); + m_mappingFunction->setReadOnly( TRUE ); // Buttons @@ -218,8 +219,8 @@ controllerConnectionDialog::controllerConnectionDialog( QWidget * _parent, QPushButton * cancel_btn = new QPushButton( embed::getIconPixmap( "cancel" ), tr( "Cancel" ), buttons ); - //connect( cancel_btn, SIGNAL( clicked() ), - // this, SLOT( reject() ) ); + connect( cancel_btn, SIGNAL( clicked() ), + this, SLOT( reject() ) ); resize( 256, 246 );