From dbe00236ff5cfce8f539cf84a6d34b353542dfff Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 3 Mar 2013 08:26:46 +0000 Subject: fix region fade/env XML save - fixes #5353 In rev 12740 FadeIn/Out became stateful properties which are automatically saved when Region:state() calls Stateful::add_properties(). AudioRegion::state() called Region:state() AND Stateful::add_properties() which added a 2nd redundant copy to the XML. Finally AudioRegion::state() adds custom serialization for Fades. Furthermore this custom serialization also used names which did not match the Property name. git-svn-id: svn://localhost/ardour2/branches/3.0@14117 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/region.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'libs/ardour/region.cc') diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 952e8b5c9c..4ccd3c77b0 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -1126,7 +1126,18 @@ Region::state () LocaleGuard lg (X_("POSIX")); const char* fe = NULL; - add_properties (*node); + /* custom version of 'add_properties (*node);' + * skip values that have have dedicated save functions + * in AudioRegion::state() + */ + for (OwnedPropertyList::iterator i = _properties->begin(); i != _properties->end(); ++i) { + if (!strcmp(i->second->property_name(), (const char*)"Envelope")) continue; + if (!strcmp(i->second->property_name(), (const char*)"FadeIn")) continue; + if (!strcmp(i->second->property_name(), (const char*)"FadeOut")) continue; + if (!strcmp(i->second->property_name(), (const char*)"InverseFadeIn")) continue; + if (!strcmp(i->second->property_name(), (const char*)"InverseFadeOut")) continue; + i->second->get_value (*node); + } id().print (buf, sizeof (buf)); node->add_property ("id", buf); -- cgit v1.2.3