Fixes for the tension dial (crash + missing update)
Fixes a crash that occurred when the tension dial of the automation editor was moved when no pattern was loaded. Also added a missing update of the tension dial when the automation patterns are switched.
This commit is contained in:
@@ -281,6 +281,8 @@ void AutomationEditor::updateAfterPatternChange()
|
||||
m_step = m_pattern->firstObject()->step<float>();
|
||||
m_scrollLevel = ( m_minLevel + m_maxLevel ) / 2;
|
||||
|
||||
m_tensionModel->setValue( m_pattern->getTension() );
|
||||
|
||||
// resizeEvent() does the rest for us (scrolling, range-checking
|
||||
// of levels and so on...)
|
||||
resizeEvent( NULL );
|
||||
@@ -1676,8 +1678,11 @@ void AutomationEditor::setProgressionType(int type)
|
||||
|
||||
void AutomationEditor::setTension()
|
||||
{
|
||||
m_pattern->setTension( QString::number( m_tensionModel->value() ) );
|
||||
update();
|
||||
if ( m_pattern )
|
||||
{
|
||||
m_pattern->setTension( QString::number( m_tensionModel->value() ) );
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user