13
0

skip fade&envelope info in region XML

git-svn-id: svn://localhost/ardour2/branches/3.0@14118 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Robin Gareus 2013-03-03 08:26:50 +00:00
parent dbe00236ff
commit 0c90adf3e6
3 changed files with 17 additions and 3 deletions

View 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);

View 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;

View 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 ());
}
}
}