From 92789f843efd909813c093b93746c7e196d65618 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Tue, 4 Nov 2008 10:46:09 +0000 Subject: [PATCH] call saveSettings()/loadSettings() on model rather than loading/saving value directly - fixes lost automation on basic effect controls (stable backport) git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms/stable-0.4@1827 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 6 ++++++ src/core/effect.cpp | 16 ++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 52831db63..14918801d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-04 Tobias Doerffel + + * src/core/effect.cpp: + call saveSettings()/loadSettings() on model rather than loading/saving + value directly - fixes lost automation on basic effect controls + 2008-10-30 Tobias Doerffel * CMakeLists.txt: diff --git a/src/core/effect.cpp b/src/core/effect.cpp index f899ebf9c..bb0cd321c 100644 --- a/src/core/effect.cpp +++ b/src/core/effect.cpp @@ -75,10 +75,10 @@ effect::~effect() void effect::saveSettings( QDomDocument & _doc, QDomElement & _this ) { - _this.setAttribute( "on", m_enabledModel.value() ); - _this.setAttribute( "wet", m_wetDryModel.value() ); - _this.setAttribute( "autoquit", m_autoQuitModel.value() ); - _this.setAttribute( "gate", m_gateModel.value() ); + m_enabledModel.saveSettings( _doc, _this, "on" ); + m_wetDryModel.saveSettings( _doc, _this, "wet" ); + m_autoQuitModel.saveSettings( _doc, _this, "autoquit" ); + m_gateModel.saveSettings( _doc, _this, "gate" ); getControls()->saveState( _doc, _this ); } @@ -87,10 +87,10 @@ void effect::saveSettings( QDomDocument & _doc, QDomElement & _this ) void effect::loadSettings( const QDomElement & _this ) { - m_enabledModel.setValue( (float) _this.attribute( "on" ).toInt() ); - m_wetDryModel.setValue( _this.attribute( "wet" ).toFloat() ); - m_autoQuitModel.setValue( _this.attribute( "autoquit" ).toFloat() ); - m_gateModel.setValue( _this.attribute( "gate" ).toFloat() ); + m_enabledModel.loadSettings( _this, "on" ); + m_wetDryModel.loadSettings( _this, "wet" ); + m_autoQuitModel.loadSettings( _this, "autoquit" ); + m_gateModel.loadSettings( _this, "gate" ); QDomNode node = _this.firstChild(); while( !node.isNull() )