AutomationPattern: do not put initial value if model is at init value

There's no need to initialize an automation pattern with the value of the
model if it's default already. This fixes tons of dummy automation patterns
being saved for every note (as part of the note detuning feature).
This commit is contained in:
Tobias Doerffel
2014-01-20 23:06:24 +01:00
parent 1a99ed8e2f
commit cc35373241

View File

@@ -102,10 +102,10 @@ void AutomationPattern::addObject( AutomatableModel * _obj, bool _search_dup )
if( addIt )
{
// been empty before?
if( m_objects.isEmpty() && hasAutomation() == false )
// been empty before and model's current value is not its init value?
if( m_objects.isEmpty() && hasAutomation() == false && _obj->isAtInitValue() == false )
{
// then initialize default value
// then initialize first value
putValue( 0, _obj->value<float>(), false );
}