diff --git a/include/InlineAutomation.h b/include/InlineAutomation.h index 89f3e9164..70cefbec9 100644 --- a/include/InlineAutomation.h +++ b/include/InlineAutomation.h @@ -52,9 +52,7 @@ public: inline bool hasAutomation() const { return m_autoPattern != NULL && - !typeInfo::isEqual( - m_autoPattern->getTimeMap()[0], - defaultValue() ); + m_autoPattern->getTimeMap().isEmpty() == false; } AutomationPattern * automationPattern() diff --git a/src/gui/piano_roll.cpp b/src/gui/piano_roll.cpp index 1728b1c03..6679120a1 100644 --- a/src/gui/piano_roll.cpp +++ b/src/gui/piano_roll.cpp @@ -618,7 +618,7 @@ pianoRoll::pianoRoll() : if( engine::mainWindow()->workspace() ) { engine::mainWindow()->workspace()->addSubWindow( this ); - parentWidget()->setMinimumWidth( tb_layout->minimumSize().width()+10 ); + parentWidget()->setMinimumSize( tb_layout->minimumSize().width()+10, 200 ); parentWidget()->resize( tb_layout->minimumSize().width()+10, INITIAL_PIANOROLL_HEIGHT ); parentWidget()->hide(); @@ -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 ) { @@ -929,10 +932,28 @@ inline void pianoRoll::drawDetuningInfo( QPainter & _p, note * _n, int _x, const float level = it.value(); - int pos_y = (int)( middle_y - level * KEY_LINE_HEIGHT / 10 ); + 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; } }