Start adding LFO artwork

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1211 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Paul Giblock
2008-06-29 13:53:13 +00:00
parent 8f695eb423
commit 22f15c3955
5 changed files with 34 additions and 32 deletions

View File

@@ -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<float>(x1 - x0);
float deltay = tAbs<float>(y1 - y0);
int x = x0;
float y = y0;
int deltax = tAbs<float>( _x1 - _x0 );
float deltay = tAbs<float>( _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 );
}

View File

@@ -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 )