From 5c362e51ac22fd7c8f7682df7542e6d5100dea1c Mon Sep 17 00:00:00 2001 From: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com> Date: Wed, 24 Oct 2018 22:23:21 +0200 Subject: [PATCH] Fix not saving some automations (#4632) (#4667) Save automation of * Track::muted * Track::solo * EffectChain::enabled --- src/core/EffectChain.cpp | 4 ++-- src/core/Track.cpp | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/core/EffectChain.cpp b/src/core/EffectChain.cpp index efadca525..cdb9ad7f1 100644 --- a/src/core/EffectChain.cpp +++ b/src/core/EffectChain.cpp @@ -53,7 +53,7 @@ EffectChain::~EffectChain() void EffectChain::saveSettings( QDomDocument & _doc, QDomElement & _this ) { - _this.setAttribute( "enabled", m_enabledModel.value() ); + m_enabledModel.saveSettings( _doc, _this, "enabled" ); _this.setAttribute( "numofeffects", m_effects.count() ); for( Effect* effect : m_effects) @@ -80,7 +80,7 @@ void EffectChain::loadSettings( const QDomElement & _this ) // TODO This method should probably also lock the mixer - m_enabledModel.setValue( _this.attribute( "enabled" ).toInt() ); + m_enabledModel.loadSettings( _this, "enabled" ); const int plugin_cnt = _this.attribute( "numofeffects" ).toInt(); diff --git a/src/core/Track.cpp b/src/core/Track.cpp index fa500da33..bf10a10a0 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -2063,8 +2063,9 @@ void Track::saveSettings( QDomDocument & doc, QDomElement & element ) } element.setAttribute( "type", type() ); element.setAttribute( "name", name() ); - element.setAttribute( "muted", isMuted() ); - element.setAttribute( "solo", isSolo() ); + m_mutedModel.saveSettings( doc, element, "muted" ); + m_soloModel.saveSettings( doc, element, "solo" ); + if( m_height >= MINIMAL_TRACK_HEIGHT ) { element.setAttribute( "height", m_height ); @@ -2116,8 +2117,8 @@ void Track::loadSettings( const QDomElement & element ) setName( element.hasAttribute( "name" ) ? element.attribute( "name" ) : element.firstChild().toElement().attribute( "name" ) ); - setMuted( element.attribute( "muted" ).toInt() ); - setSolo( element.attribute( "solo" ).toInt() ); + m_mutedModel.loadSettings( element, "muted" ); + m_soloModel.loadSettings( element, "solo" ); if( m_simpleSerializingMode ) { @@ -2150,8 +2151,9 @@ void Track::loadSettings( const QDomElement & element ) { loadTrackSpecificSettings( node.toElement() ); } - else if( - !node.toElement().attribute( "metadata" ).toInt() ) + else if( node.nodeName() != "muted" + && node.nodeName() != "solo" + && !node.toElement().attribute( "metadata" ).toInt() ) { TrackContentObject * tco = createTCO( MidiTime( 0 ) );