From ec9658d205d4448ba1e49679627c63f2cc418027 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 24 Jan 2011 15:40:39 +0100 Subject: [PATCH] PeakControllerEffect: properly save and load all settings The settings for the new attack and decay controls weren't saved and loaded at all while just the values of all other knobs were saved (instead automation data, controllers etc.). --- .../peak_controller_effect_controls.cpp | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/plugins/peak_controller_effect/peak_controller_effect_controls.cpp b/plugins/peak_controller_effect/peak_controller_effect_controls.cpp index 5fc009801..a07d52358 100644 --- a/plugins/peak_controller_effect/peak_controller_effect_controls.cpp +++ b/plugins/peak_controller_effect/peak_controller_effect_controls.cpp @@ -2,7 +2,7 @@ * peak_controller_effect_controls.cpp - controls for peakController effect * * Copyright (c) 2008 Paul Giblock - * Copyright (c) 2009 Tobias Doerffel + * Copyright (c) 2009-2011 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -47,10 +47,13 @@ PeakControllerEffectControls( PeakControllerEffect * _eff ) : void PeakControllerEffectControls::loadSettings( const QDomElement & _this ) { - m_baseModel.setValue( _this.attribute( "base" ).toFloat() ); - m_amountModel.setValue( _this.attribute( "amount" ).toFloat() ); - m_muteModel.setValue( _this.attribute( "mute" ).toFloat() ); - + m_baseModel.loadSettings( _this, "base" ); + m_amountModel.loadSettings( _this, "amount" ); + m_muteModel.loadSettings( _this, "mute" ); + + m_attackModel.loadSettings( _this, "attack" ); + m_decayModel.loadSettings( _this, "decay" ); + int effectId = _this.attribute( "effectId" ).toInt(); if( effectId > PeakController::s_lastEffectId ) { @@ -71,10 +74,14 @@ void PeakControllerEffectControls::loadSettings( const QDomElement & _this ) void PeakControllerEffectControls::saveSettings( QDomDocument & _doc, QDomElement & _this ) { - _this.setAttribute( "base", m_baseModel.value() ); - _this.setAttribute( "amount", m_amountModel.value() ); - _this.setAttribute( "mute", m_muteModel.value() ); _this.setAttribute( "effectId", m_effect->m_effectId ); + + m_baseModel.saveSettings( _doc, _this, "base" ); + m_amountModel.saveSettings( _doc, _this, "amount" ); + m_muteModel.saveSettings( _doc, _this, "mute" ); + + m_attackModel.saveSettings( _doc, _this, "attack" ); + m_decayModel.saveSettings( _doc, _this, "decay" ); }