X-Git-Url: https://main.carlh.net/gitweb/?p=ardour.git;a=blobdiff_plain;f=libs%2Fardour%2Fplaylist_source.cc;h=07f72331bb8f136798760b0a744d07e7ed3c10ea;hp=7bbfdecd822efb4b2cd8edb922633336babe9251;hb=c8c6bca6587450ff64303dbc994a4cd28d6ce7aa;hpb=d6be900da002cde17570e742bcc48f1588f73dc9 diff --git a/libs/ardour/playlist_source.cc b/libs/ardour/playlist_source.cc index 7bbfdecd82..07f72331bb 100644 --- a/libs/ardour/playlist_source.cc +++ b/libs/ardour/playlist_source.cc @@ -33,18 +33,15 @@ #include "ardour/playlist.h" #include "ardour/playlist_source.h" #include "ardour/playlist_factory.h" -#include "ardour/session.h" -#include "ardour/session_playlists.h" -#include "ardour/source_factory.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace std; using namespace ARDOUR; using namespace PBD; PlaylistSource::PlaylistSource (Session& s, const ID& orig, const std::string& name, boost::shared_ptr p, DataType type, - frameoffset_t begin, framecnt_t len, Source::Flag flags) + frameoffset_t begin, framecnt_t len, Source::Flag /*flags*/) : Source (s, type, name) , _playlist (p) , _original (orig) @@ -64,7 +61,7 @@ PlaylistSource::PlaylistSource (Session& s, const XMLNode& node) { /* PlaylistSources are never writable, renameable, removable or destructive */ _flags = Flag (_flags & ~(Writable|CanRename|Removable|RemovableIfEmpty|RemoveAtDestroy|Destructive)); - + if (set_state (node, Stateful::loading_state_version)) { throw failed_constructor (); @@ -86,17 +83,17 @@ PlaylistSource::add_state (XMLNode& node) node.add_property ("offset", buf); snprintf (buf, sizeof (buf), "%" PRIu64, _playlist_length); node.add_property ("length", buf); - node.add_property ("original", _id.to_s()); - + node.add_property ("original", id().to_s()); + node.add_child_nocopy (_playlist->get_state()); } int -PlaylistSource::set_state (const XMLNode& node, int version) +PlaylistSource::set_state (const XMLNode& node, int /*version*/) { /* check that we have a playlist ID */ - const XMLProperty *prop = node.property (X_("playlist")); + XMLProperty const * prop = node.property (X_("playlist")); if (!prop) { error << _("No playlist ID in PlaylistSource XML!") << endmsg; @@ -118,7 +115,7 @@ PlaylistSource::set_state (const XMLNode& node, int version) } if (!_playlist) { - error << _("No playlist node in PlaylistSource XML!") << endmsg; + error << _("Could not construct playlist for PlaylistSource from session data!") << endmsg; throw failed_constructor (); } @@ -127,7 +124,7 @@ PlaylistSource::set_state (const XMLNode& node, int version) if ((prop = node.property (X_("name"))) == 0) { throw failed_constructor (); } - + set_name (prop->value()); if ((prop = node.property (X_("offset"))) == 0) { @@ -141,11 +138,15 @@ PlaylistSource::set_state (const XMLNode& node, int version) sscanf (prop->value().c_str(), "%" PRIu64, &_playlist_length); + /* XXX not quite sure why we set our ID back to the "original" one + here. october 2011, paul + */ + if ((prop = node.property (X_("original"))) == 0) { throw failed_constructor (); } - _id = prop->value(); + set_id (prop->value()); _level = _playlist->max_source_level () + 1;