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.
This commit is contained in:
Tobias Doerffel
2013-06-11 14:50:51 +02:00
parent f83b9b04a3
commit 0aaed00cc1

View File

@@ -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<float>(), false );
}
m_objects += _obj;
connect( _obj, SIGNAL( destroyed( jo_id_t ) ),
this, SLOT( objectDestroyed( jo_id_t ) ),
Qt::DirectConnection );