From cc35373241a191ba307c73aee1f888112c323c4e Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 20 Jan 2014 23:06:24 +0100 Subject: [PATCH] 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). --- src/core/AutomationPattern.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/AutomationPattern.cpp b/src/core/AutomationPattern.cpp index 25f4114b8..0d1cfb210 100644 --- a/src/core/AutomationPattern.cpp +++ b/src/core/AutomationPattern.cpp @@ -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(), false ); }