diff --git a/ChangeLog b/ChangeLog index c22b63e41..c327db7b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -63,6 +63,11 @@ - Don't miss points when scribbling quickly - Shift-Click to draw a line + * include/lfo_controller.h: + * src/gui/lfo_controller_dialog.cpp: + * data/themes/default/lfo_controller_artwork.png: + Add LFO artwork (almost) + 2008-06-28 Tobias Doerffel * plugins/Makefile.am: diff --git a/data/themes/default/lfo_controller_artwork.png b/data/themes/default/lfo_controller_artwork.png new file mode 100644 index 000000000..812ee37ad Binary files /dev/null and b/data/themes/default/lfo_controller_artwork.png differ diff --git a/include/lfo_controller.h b/include/lfo_controller.h index 5b8743f72..9b5f9b96c 100644 --- a/include/lfo_controller.h +++ b/include/lfo_controller.h @@ -113,7 +113,7 @@ signals: protected: virtual void contextMenuEvent( QContextMenuEvent * _me ); - virtual void paintEvent( QPaintEvent * _pe ); + //virtual void paintEvent( QPaintEvent * _pe ); virtual void modelChanged( void ); lfoController * m_lfo; diff --git a/src/gui/automation_editor.cpp b/src/gui/automation_editor.cpp index 8e0c56905..66da59d49 100644 --- a/src/gui/automation_editor.cpp +++ b/src/gui/automation_editor.cpp @@ -637,23 +637,25 @@ void automationEditor::leaveEvent( QEvent * _e ) } -void automationEditor::drawLine( int x0, float y0, int x1, float y1 ) +void automationEditor::drawLine( int _x0, float _y0, int _x1, float _y1 ) { - int deltax = tAbs(x1 - x0); - float deltay = tAbs(y1 - y0); - int x = x0; - float y = y0; + int deltax = tAbs( _x1 - _x0 ); + float deltay = tAbs( _y1 - _y0 ); + int x = _x0; + float y = _y0; int xstep; int ystep; - if( deltax == 0 ) + if( deltax < quantization() ) { return; } - float yscale = deltay / deltax; + deltax /= quantization(); - if( x0 < x1) + float yscale = deltay / ( deltax ); + + if( _x0 < _x1) { xstep = quantization(); } @@ -662,7 +664,7 @@ void automationEditor::drawLine( int x0, float y0, int x1, float y1 ) xstep = -( quantization() ); } - if( y0 < y1 ) + if( _y0 < _y1 ) { ystep = 1; } @@ -674,10 +676,10 @@ void automationEditor::drawLine( int x0, float y0, int x1, float y1 ) int i = 0; while( i < deltax ) { - y = y0 + ( ystep * yscale * i ); + y = _y0 + ( ystep * yscale * i ); x += xstep; - i += quantization(); + i += 1; m_pattern->removeValue( midiTime( x ) ); m_pattern->putValue( midiTime( x ), y ); } diff --git a/src/gui/lfo_controller_dialog.cpp b/src/gui/lfo_controller_dialog.cpp index 293be0d60..df741f38b 100644 --- a/src/gui/lfo_controller_dialog.cpp +++ b/src/gui/lfo_controller_dialog.cpp @@ -72,7 +72,7 @@ lfoControllerDialog::lfoControllerDialog( controller * _model, QWidget * _parent title.append( ")" ); setWindowTitle( tr( "LFO (name)" ) ); setWindowIcon( embed::getIconPixmap( "controller" ) ); - setFixedSize( 256, 64 ); + setFixedSize( 240, 80 ); toolTip::add( this, tr( "LFO Controller" ) ); @@ -211,36 +211,26 @@ lfoControllerDialog::lfoControllerDialog( controller * _model, QWidget * _parent pixmapButton * x1 = new pixmapButton( this, NULL ); - x1->move( LFO_MULTIPLIER_X, LFO_SHAPES_Y + 15 ); + x1->move( LFO_MULTIPLIER_X, LFO_SHAPES_Y ); x1->setActiveGraphic( embed::getIconPixmap( "lfo_x1_active" ) ); x1->setInactiveGraphic( embed::getIconPixmap( "lfo_x1_inactive" ) ); pixmapButton * x100 = new pixmapButton( this, NULL ); - x100->move( LFO_MULTIPLIER_X, LFO_SHAPES_Y ); + x100->move( LFO_MULTIPLIER_X, LFO_SHAPES_Y - 15 ); x100->setActiveGraphic( embed::getIconPixmap( "lfo_x100_active" ) ); x100->setInactiveGraphic( embed::getIconPixmap( "lfo_x100_inactive" ) ); pixmapButton * d100 = new pixmapButton( this, NULL ); - d100->move( LFO_MULTIPLIER_X, LFO_SHAPES_Y + 30 ); + d100->move( LFO_MULTIPLIER_X, LFO_SHAPES_Y + 15 ); d100->setActiveGraphic( embed::getIconPixmap( "lfo_d100_active" ) ); d100->setInactiveGraphic( embed::getIconPixmap( "lfo_d100_inactive" ) ); - /* - m_x100Cb = new ledCheckBox( tr( "FREQ x 100" ), this ); - m_x100Cb->setFont( pointSize<6>( m_x100Cb->font() ) ); - m_x100Cb->move( LFO_BASE_KNOB_X, LFO_KNOB_Y + 36 ); - m_x100Cb->setWhatsThis( - tr( "Click here if the frequency of this LFO should be " - "multiplied with 100." ) ); - toolTip::add( m_x100Cb, tr( "multiply LFO-frequency with 100" ) ); - */ - m_multiplierBtnGrp = new automatableButtonGroup( this ); m_multiplierBtnGrp->addButton( x1 ); m_multiplierBtnGrp->addButton( x100 ); @@ -248,8 +238,14 @@ lfoControllerDialog::lfoControllerDialog( controller * _model, QWidget * _parent setModel( _model ); -} + setAutoFillBackground( TRUE ); + QPalette pal; + pal.setBrush( backgroundRole(), + QColor( 255 ,0 ,0, 255 ) ); + setPalette( pal ); + +} @@ -303,13 +299,12 @@ void lfoControllerDialog::contextMenuEvent( QContextMenuEvent * ) } - - -void lfoControllerDialog::paintEvent( QPaintEvent * ) +/* +void lfoControllerDialog::paintEvent( QPaintEvent * _pe ) { - QPainter p( this ); + QWidget::paintEvent( _pe ); } - +*/ void lfoControllerDialog::modelChanged( void )