From 18d3c886a6a4becbf74b71d60a4ca5f06a9dd5a4 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Wed, 1 Sep 2010 23:23:13 +0200 Subject: [PATCH] ZynAddSubFX: properly load preset data if knobs are automated/controlled Commit 534c4debb519dcc6c33b93212db8648b2c691237 introduced a regression. If knobs have a song-global automation or controllers attached, they save these settings in a sub XML node which confused the ZASF preset loader which assumed the first child node would always be the ZASF preset data. Fix this by explicitely searching for an XML element named "ZynAddSubFX-data". Closes #3057275. (cherry picked from commit 4e695a4ea81892550c0cd927022109a7150553a6) --- plugins/zynaddsubfx/ZynAddSubFx.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/zynaddsubfx/ZynAddSubFx.cpp b/plugins/zynaddsubfx/ZynAddSubFx.cpp index 7fe8663f6..2574409c0 100644 --- a/plugins/zynaddsubfx/ZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/ZynAddSubFx.cpp @@ -209,7 +209,13 @@ void ZynAddSubFxInstrument::loadSettings( const QDomElement & _this ) m_forwardMidiCcModel.loadSettings( _this, "forwardmidicc" ); QDomDocument doc; - doc.appendChild( doc.importNode( _this.firstChild(), true ) ); + QDomElement data = _this.firstChildElement( "ZynAddSubFX-data" ); + if( data.isNull() ) + { + data = _this.firstChildElement(); + } + doc.appendChild( doc.importNode( data, true ) ); + QTemporaryFile tf; tf.setAutoRemove( false ); if( tf.open() )