diff options
author | Robin Gareus <robin@gareus.org> | 2019-12-11 16:21:23 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-12-11 16:25:08 +0100 |
commit | 0a5837ec7111e446f168e6a5cc245b4b62fc7a9e (patch) | |
tree | b8830f0410889e2a76449f75a25a823173304d48 | |
parent | dd18be15fbe9ad6a594f37b0d3a8183c0601babb (diff) |
Fix loading plugin state from sessions
While loading a session XML state, set_state must use
`Stateful::loading_state_version`.
When later copying processor state,
`Stateful::current_state_version` is correct.
-rw-r--r-- | libs/ardour/ardour/route.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/track.h | 2 | ||||
-rw-r--r-- | libs/ardour/route.cc | 12 | ||||
-rw-r--r-- | libs/ardour/track.cc | 8 |
4 files changed, 13 insertions, 13 deletions
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 5c2c4ad48d..781f989d8f 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -409,8 +409,8 @@ public: virtual int set_state (const XMLNode&, int version); XMLNode& get_processor_state (); - void set_processor_state (const XMLNode&); - virtual bool set_processor_state (XMLNode const & node, XMLProperty const* prop, ProcessorList& new_order, bool& must_configure); + void set_processor_state (const XMLNode&, int version); + virtual bool set_processor_state (XMLNode const & node, int version, XMLProperty const* prop, ProcessorList& new_order, bool& must_configure); boost::weak_ptr<Route> weakroute (); diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index fbac03edf0..2ab9b8ef9a 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -65,7 +65,7 @@ public: MeterState metering_state () const; - bool set_processor_state (XMLNode const & node, XMLProperty const* prop, ProcessorList& new_order, bool& must_configure); + bool set_processor_state (XMLNode const& node, int version, XMLProperty const* prop, ProcessorList& new_order, bool& must_configure); bool declick_in_progress () const; diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 3bc66f1a30..1f56ddc5e9 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -2691,7 +2691,7 @@ Route::set_state (const XMLNode& node, int version) _initial_io_setup = false; - set_processor_state (processor_state); + set_processor_state (processor_state, version); // this looks up the internal instrument in processors reset_instrument_info(); @@ -2988,7 +2988,7 @@ Route::set_processor_state_2X (XMLNodeList const & nList, int version) } void -Route::set_processor_state (const XMLNode& node) +Route::set_processor_state (const XMLNode& node, int version) { const XMLNodeList &nlist = node.children(); XMLNodeConstIterator niter; @@ -3037,7 +3037,7 @@ Route::set_processor_state (const XMLNode& node) _disk_writer->set_state (**niter, Stateful::current_state_version); new_order.push_back (_disk_writer); } else { - set_processor_state (**niter, prop, new_order, must_configure); + set_processor_state (**niter, version, prop, new_order, must_configure); } } @@ -3096,14 +3096,14 @@ Route::set_processor_state (const XMLNode& node) } bool -Route::set_processor_state (XMLNode const & node, XMLProperty const* prop, ProcessorList& new_order, bool& must_configure) +Route::set_processor_state (XMLNode const& node, int version, XMLProperty const* prop, ProcessorList& new_order, bool& must_configure) { ProcessorList::iterator o; for (o = _processors.begin(); o != _processors.end(); ++o) { XMLProperty const * id_prop = node.property(X_("id")); if (id_prop && (*o)->id() == id_prop->value()) { - (*o)->set_state (node, Stateful::current_state_version); + (*o)->set_state (node, version); new_order.push_back (*o); break; } @@ -3149,7 +3149,7 @@ Route::set_processor_state (XMLNode const & node, XMLProperty const* prop, Proce return false; } - if (processor->set_state (node, Stateful::current_state_version) != 0) { + if (processor->set_state (node, version) != 0) { /* This processor could not be configured. Turn it into a UnknownProcessor */ processor.reset (new UnknownProcessor (_session, node)); } diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc index f2cb9a5b3a..87c9aedabb 100644 --- a/libs/ardour/track.cc +++ b/libs/ardour/track.cc @@ -850,9 +850,9 @@ Track::metering_state () const } bool -Track::set_processor_state (XMLNode const & node, XMLProperty const* prop, ProcessorList& new_order, bool& must_configure) +Track::set_processor_state (XMLNode const& node, int version, XMLProperty const* prop, ProcessorList& new_order, bool& must_configure) { - if (Route::set_processor_state (node, prop, new_order, must_configure)) { + if (Route::set_processor_state (node, version, prop, new_order, must_configure)) { return true; } @@ -860,13 +860,13 @@ Track::set_processor_state (XMLNode const & node, XMLProperty const* prop, Proce if (prop->value() == "diskreader") { if (_disk_reader) { - _disk_reader->set_state (node, Stateful::current_state_version); + _disk_reader->set_state (node, version); new_order.push_back (_disk_reader); return true; } } else if (prop->value() == "diskwriter") { if (_disk_writer) { - _disk_writer->set_state (node, Stateful::current_state_version); + _disk_writer->set_state (node, version); new_order.push_back (_disk_writer); return true; } |