diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-05-16 21:21:16 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-05-16 21:21:16 +0000 |
commit | c8a27ebdbf601c22b19ad8a7defeb98b784c0dcf (patch) | |
tree | 716fad6a2fd84de55d13bbacdbc9d18cab78acb8 /libs/ardour/playlist.cc | |
parent | 99aa8c6338e47b41143f799fdcb35d1699548076 (diff) |
track combine ops per-playlist to avoid name collisions for compound regions
git-svn-id: svn://localhost/ardour2/branches/3.0@9529 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/playlist.cc')
-rw-r--r-- | libs/ardour/playlist.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 9ceb11fe51..d933594d3d 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -28,10 +28,10 @@ #include <boost/lexical_cast.hpp> +#include "pbd/convert.h" #include "pbd/failed_constructor.h" #include "pbd/stateful_diff_command.h" #include "pbd/xml++.h" -#include "pbd/stacktrace.h" #include "ardour/debug.h" #include "ardour/playlist.h" @@ -357,6 +357,7 @@ Playlist::init (bool hide) layer_op_counter = 0; freeze_length = 0; _explicit_relayering = false; + _combine_ops = 0; _session.history().BeginUndoRedo.connect_same_thread (*this, boost::bind (&Playlist::begin_undo, this)); _session.history().EndUndoRedo.connect_same_thread (*this, boost::bind (&Playlist::end_undo, this)); @@ -2277,6 +2278,8 @@ Playlist::set_state (const XMLNode& node, int version) _orig_diskstream_id = prop->value (); } else if (prop->name() == X_("frozen")) { _frozen = string_is_affirmative (prop->value()); + } else if (prop->name() == X_("combine-ops")) { + _combine_ops = atoi (prop->value()); } } @@ -2369,7 +2372,7 @@ XMLNode& Playlist::state (bool full_state) { XMLNode *node = new XMLNode (X_("Playlist")); - char buf[64] = ""; + char buf[64]; node->add_property (X_("id"), id().to_s()); node->add_property (X_("name"), _name); @@ -2383,6 +2386,9 @@ Playlist::state (bool full_state) RegionLock rlock (this, false); XMLNode* nested_node = 0; + snprintf (buf, sizeof (buf), "%u", _combine_ops); + node->add_property ("combine-ops", buf); + for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) { if ((*i)->max_source_level() > 0) { @@ -3208,6 +3214,7 @@ Playlist::join (const RegionList& r, const std::string& name) /* add the new region at the right location */ add_region (compound_region, earliest_position); + _combine_ops++; thaw (); } |