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:
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user