From 03bf853a4da103f14d9e8af2d7a0255cbe0e8ba3 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 12 Mar 2009 19:03:42 +0100 Subject: [PATCH] AutomationPattern: save and restore length of AutomationPattern to avoid confusions with the previous auto-resize behaviour --- src/core/automation_pattern.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/core/automation_pattern.cpp b/src/core/automation_pattern.cpp index fe473ebb0..78139f1c4 100644 --- a/src/core/automation_pattern.cpp +++ b/src/core/automation_pattern.cpp @@ -2,7 +2,7 @@ * automation_pattern.cpp - implementation of class automationPattern which * holds dynamic values * - * Copyright (c) 2008 Tobias Doerffel + * Copyright (c) 2008-2009 Tobias Doerffel * Copyright (c) 2006-2008 Javier Serrano Polo * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net @@ -273,6 +273,7 @@ float automationPattern::valueAt( const midiTime & _time ) const void automationPattern::saveSettings( QDomDocument & _doc, QDomElement & _this ) { _this.setAttribute( "pos", startPosition() ); + _this.setAttribute( "len", trackContentObject::length() ); _this.setAttribute( "name", name() ); for( timeMap::const_iterator it = m_timeMap.begin(); @@ -337,8 +338,12 @@ void automationPattern::loadSettings( const QDomElement & _this ) } } } - - changeLength( length() ); + int len = _this.attribute( "len" ).toInt(); + if( len <= 0 ) + { + len = length(); + } + changeLength( len ); }