From ef4f9b1b60960dd4fb98c24b12d4e7ea405e4130 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 26 Jan 2014 23:18:59 +0100 Subject: [PATCH] InstrumentTrack: partly revert ad27039b9bbba2ab1095ddd3c163a20a02956c96 Even though there are probably not many old projects out there, at least old presets didn't load properly anymore as of ad27039b9bbba2ab1095ddd3. Fix this by reintroducing compat code. --- src/tracks/InstrumentTrack.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index e7a58834a..b7412f19f 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -767,6 +767,22 @@ void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & thisElement emit instrumentChanged(); } + // compat code - if node-name doesn't match any known + // one, we assume that it is an instrument-plugin + // which we'll try to load + else if( AutomationPattern::classNodeName() != node.nodeName() && + ControllerConnection::classNodeName() != node.nodeName() && + !node.toElement().hasAttribute( "id" ) ) + { + delete m_instrument; + m_instrument = NULL; + m_instrument = Instrument::instantiate( node.nodeName(), this ); + if( m_instrument->nodeName() == node.nodeName() ) + { + m_instrument->restoreState( node.toElement() ); + } + emit instrumentChanged(); + } } node = node.nextSibling(); }