Improve automation track appearance. Fix tempoSyncKnob calculation

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1198 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Paul Giblock
2008-06-29 06:24:23 +00:00
parent f53a76d7ee
commit 941c3cdc78
3 changed files with 27 additions and 7 deletions

View File

@@ -4,12 +4,16 @@
Initialize gain at 1.0
* src/core/automation_pattern.cpp:
Correctly draw automation TCO for negative minValues.
- Correctly draw automation TCO for negative minValues.
- Add some shading
* src/gui/controller_connection_dialog.cpp:
- Connect cancel button
- Make mapping function read-only for alpha release
* src/gui/widgets/tempo_sync_knob.cpp:
Make tempoSyncKnob really sync to tempo again
2008-06-28 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* plugins/Makefile.am:

View File

@@ -621,15 +621,31 @@ void automationPatternView::paintEvent( QPaintEvent * )
height() - 2 * TCO_BORDER_WIDTH );
}
const float y_scale = m_pat->firstObject()->maxValue<float>() -
m_pat->firstObject()->minValue<float>();
const float min = m_pat->firstObject()->minValue<float>();
const float max = m_pat->firstObject()->maxValue<float>();
const float y_scale = max - min;
const float h = ( height()-2*TCO_BORDER_WIDTH ) /
y_scale;
p.translate( 0.0f, m_pat->firstObject()->maxValue<float>() *
height() / y_scale );
p.translate( 0.0f, max * height() / y_scale );
p.scale( 1.0f, -h );
//QLinearGradient lin2grad( 0, min, 0, max );
QLinearGradient lin2grad( 0, min, 0, max );
const QColor cl = QColor( 255, 224, 0 );
const QColor cd = QColor( 229, 158, 0 );
//lingrad.setColorAt( min, c );
lin2grad.setColorAt( 1, cl );
/* if( min < 0 ) {
lin2grad.setColorAt( -min/y_scale, Qt::black );
lin2grad.setColorAt( 0, k );
}
else {*/
lin2grad.setColorAt( 0, cd );
// }
for( automationPattern::timeMap::const_iterator it =
m_pat->getTimeMap().begin();
it != m_pat->getTimeMap().end(); ++it )
@@ -646,7 +662,7 @@ void automationPatternView::paintEvent( QPaintEvent * )
x2 = width() - TCO_BORDER_WIDTH + 1;
}
p.fillRect( QRectF( x1, 0.0f, x2-x1, it.value() ),
QColor( 255, 224, 0 ) );
lin2grad /*QColor( 255, 224, 0 )*/ );
}
p.resetMatrix();

View File

@@ -118,7 +118,7 @@ void tempoSyncKnobModel::calculateTempoSyncTime( bpm_t _bpm )
}
bool journalling = testAndSetJournalling( FALSE );
float oneUnit = 60000.0 / ( _bpm * conversionFactor * m_scale );
setValue( oneUnit*( maxValue() - minValue() ) + minValue() );
setValue( oneUnit * maxValue() );
setJournalling( journalling );
}