added fast and more leight-weight setAutomatedValue() which omits things like journalling - makes things faster and doesn't introduce threading-problems
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1094 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -182,8 +182,6 @@ void automatableModel::setValue( const float _value )
|
||||
addJournalEntry( journalEntry( 0, m_value - old_val ) );
|
||||
|
||||
// notify linked models
|
||||
|
||||
// doesn't work because of implicit typename T
|
||||
for( autoModelVector::iterator it =
|
||||
m_linkedModels.begin();
|
||||
it != m_linkedModels.end(); ++it )
|
||||
@@ -210,6 +208,32 @@ void automatableModel::setValue( const float _value )
|
||||
|
||||
|
||||
|
||||
void automatableModel::setAutomatedValue( const float _value )
|
||||
{
|
||||
const float old_val = m_value;
|
||||
|
||||
m_value = fittedValue( _value );
|
||||
if( old_val != m_value )
|
||||
{
|
||||
// notify linked models
|
||||
for( autoModelVector::iterator it =
|
||||
m_linkedModels.begin();
|
||||
it != m_linkedModels.end(); ++it )
|
||||
{
|
||||
if( value<float>() != (*it)->value<float>() &&
|
||||
(*it)->fittedValue( value<float>() )
|
||||
!= (*it)->value<float>() )
|
||||
{
|
||||
(*it)->setAutomatedValue( value<float>() );
|
||||
}
|
||||
}
|
||||
emit dataChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automatableModel::setRange( const float _min, const float _max,
|
||||
const float _step )
|
||||
{
|
||||
|
||||
@@ -278,7 +278,8 @@ void automationPattern::processMidiTime( const midiTime & _time )
|
||||
{
|
||||
if( _time >= 0 )
|
||||
{
|
||||
m_object->setValue( m_time_map.lowerBound( -_time ).value() );
|
||||
m_object->setAutomatedValue(
|
||||
m_time_map.lowerBound( -_time ).value() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user