skip fade&envelope info in region XML
authorRobin Gareus <robin@gareus.org>
Sun, 3 Mar 2013 08:26:50 +0000 (08:26 +0000)
committerRobin Gareus <robin@gareus.org>
Sun, 3 Mar 2013 08:26:50 +0000 (08:26 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@14118 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/audioregion.h
libs/ardour/audioregion.cc
libs/ardour/session_state.cc

index 67946caa6f7d4f65d9b4f15493e2bfe05c6ba1a9..83cd227bce0136d2179b217aedd4cb56b472d7b6 100644 (file)
@@ -112,6 +112,7 @@ class AudioRegion : public Region
        virtual framecnt_t read_raw_internal (Sample*, framepos_t, framecnt_t, int channel) const;
 
        XMLNode& state ();
+       XMLNode& get_basic_state ();
        int set_state (const XMLNode&, int version);
 
        static void set_default_fade (float steepness, framecnt_t len);
index fe09774bc53c38368a2ada44b31dd8eca92d5f9f..d101583aa4b1086d6028243e0a0c8c714b77cc19 100644 (file)
@@ -754,16 +754,25 @@ AudioRegion::read_from_sources (SourceList const & srcs, framecnt_t limit, Sampl
 }
 
 XMLNode&
-AudioRegion::state ()
+AudioRegion::get_basic_state ()
 {
        XMLNode& node (Region::state ());
-       XMLNode *child;
        char buf[64];
        LocaleGuard lg (X_("POSIX"));
 
        snprintf (buf, sizeof (buf), "%u", (uint32_t) _sources.size());
        node.add_property ("channels", buf);
 
+       return node;
+}
+
+XMLNode&
+AudioRegion::state ()
+{
+       XMLNode& node (get_basic_state());
+       XMLNode *child;
+       LocaleGuard lg (X_("POSIX"));
+
        child = node.add_child ("Envelope");
 
        bool default_env = false;
index 2dd2dfa7a0dcd4640b57723f25f2ce4390886474..7857e85f4c25005dd1d62733b387ebb35368c4a0 100644 (file)
@@ -1078,7 +1078,11 @@ Session::state (bool full_state)
                         boost::shared_ptr<Region> r = i->second;
                         /* only store regions not attached to playlists */
                         if (r->playlist() == 0) {
-                                child->add_child_nocopy (r->get_state ());
+                               if (boost::dynamic_pointer_cast<AudioRegion>(r)) {
+                                       child->add_child_nocopy ((boost::dynamic_pointer_cast<AudioRegion>(r))->get_basic_state ());
+                               } else {
+                                       child->add_child_nocopy (r->get_state ());
+                               }
                         }
                 }