From 3b3a8afe6bd98141df734e67808b4a05c202d372 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Fri, 18 Jul 2008 10:04:30 +0000 Subject: [PATCH] improved behaviour in automationPattern::clear() and automationPattern::putValue() git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1321 0778d3d1-df1d-0410-868b-ea421aaaa00d --- src/core/automation_pattern.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/core/automation_pattern.cpp b/src/core/automation_pattern.cpp index 5ec815693..d32e69346 100644 --- a/src/core/automation_pattern.cpp +++ b/src/core/automation_pattern.cpp @@ -145,6 +145,18 @@ midiTime automationPattern::putValue( const midiTime & _time, { m_dynamic = TRUE; } + else + { + m_dynamic = FALSE; + for( objectVector::iterator it = m_objects.begin(); + it != m_objects.end(); ++it ) + { + if( *it ) + { + ( *it )->setValue( _value ); + } + } + } if( getTrack() && getTrack()->type() == track::HiddenAutomationTrack ) { @@ -197,9 +209,9 @@ void automationPattern::removeValue( const midiTime & _time ) void automationPattern::clear( void ) { + const float val = firstObject()->value(); m_timeMap.clear(); - m_dynamic = FALSE; - m_timeMap[0] = firstObject()->value(); + putValue( 0, val ); if( engine::getAutomationEditor() && engine::getAutomationEditor()->currentPattern() == this )