From 0aaed00cc14f2d6c354c1d98b398b1be7ef5628d Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Tue, 11 Jun 2013 14:50:51 +0200 Subject: [PATCH] AutomationPattern: initialize with current value of first object When attaching a control object to an AutomationPattern initialize the value at position 0 with the current value of the control object. This is similiar to the behaviour found in LMMS < 0.4.14 and has been reintroduced as requested by some users. Closes #535. --- src/core/AutomationPattern.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/AutomationPattern.cpp b/src/core/AutomationPattern.cpp index fda913256..e4cb69f5b 100644 --- a/src/core/AutomationPattern.cpp +++ b/src/core/AutomationPattern.cpp @@ -97,7 +97,15 @@ void AutomationPattern::addObject( AutomatableModel * _obj, bool _search_dup ) if( addIt ) { + // been empty before? + if( m_objects.isEmpty() && hasAutomation() == false ) + { + // then initialize default value + putValue( 0, _obj->value(), false ); + } + m_objects += _obj; + connect( _obj, SIGNAL( destroyed( jo_id_t ) ), this, SLOT( objectDestroyed( jo_id_t ) ), Qt::DirectConnection );