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