Skip to content

Commit

Permalink
draw discrete and linear differently
Browse files Browse the repository at this point in the history
  • Loading branch information
grejppi committed Jan 17, 2014
1 parent 3d0749a commit dfd5753
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/gui/piano_roll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,9 @@ inline void pianoRoll::drawDetuningInfo( QPainter & _p, note * _n, int _x,
int middle_y = _y + KEY_LINE_HEIGHT / 2;
_p.setPen( QColor( 0xFF, 0xDF, 0x20 ) );

int old_x = 0;
int old_y = 0;

timeMap & map = _n->detuning()->automationPattern()->getTimeMap();
for( timeMap::ConstIterator it = map.begin(); it != map.end(); ++it )
{
Expand All @@ -931,8 +934,26 @@ inline void pianoRoll::drawDetuningInfo( QPainter & _p, note * _n, int _x,

int pos_y = (int)( middle_y - level * KEY_LINE_HEIGHT );

if( old_x != 0 && old_y != 0 )
{
switch( _n->detuning()->automationPattern()->progressionType() )
{
case AutomationPattern::DiscreteProgression:
_p.drawLine( old_x, old_y, pos_x, old_y );
_p.drawLine( pos_x, old_y, pos_x, pos_y );
break;
case AutomationPattern::CubicHermiteProgression: /* TODO */
case AutomationPattern::LinearProgression:
_p.drawLine( old_x, old_y, pos_x, pos_y );
break;
}
}

_p.drawLine( pos_x - 1, pos_y, pos_x + 1, pos_y );
_p.drawLine( pos_x, pos_y - 1, pos_x, pos_y + 1 );

old_x = pos_x;
old_y = pos_y;
}
}

Expand Down

0 comments on commit dfd5753

Please sign in to comment.