Fix not saving some automations (#4632) (#4667)

Save automation of
* Track::muted
* Track::solo
* EffectChain::enabled
This commit is contained in:
Johannes Lorenz
2018-10-24 22:23:21 +02:00
committed by Oskar Wallgren
parent 1ab1280843
commit 5c362e51ac
2 changed files with 10 additions and 8 deletions

View File

@@ -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();

View File

@@ -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 ) );