diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-19 11:41:47 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-19 11:41:47 +0100 |
| commit | 91273da19c689e44f3baa368d4b4efbe75cd8fe5 (patch) | |
| tree | b38e643c9de71b16168128a7f2f00ccb75009605 /src/lib/content.cc | |
| parent | d6b125826e28c0633137d667371defc33f95f648 (diff) | |
| parent | ba17803f7e33be2bea1363b5a7115e4713dd5997 (diff) | |
Merge branch '1.0' of /home/carl/git/dvdomatic into 1.0
Diffstat (limited to 'src/lib/content.cc')
| -rw-r--r-- | src/lib/content.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc index b49ea4316..531dbc38f 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -22,6 +22,7 @@ #include <libcxml/cxml.h> #include "content.h" #include "util.h" +#include "content_factory.h" using std::string; using std::set; @@ -90,3 +91,18 @@ Content::set_start (Time s) signal_changed (ContentProperty::START); } + +shared_ptr<Content> +Content::clone () const +{ + shared_ptr<const Film> film = _film.lock (); + if (!film) { + return shared_ptr<Content> (); + } + + /* This is a bit naughty, but I can't think of a compelling reason not to do it ... */ + xmlpp::Document doc; + xmlpp::Node* node = doc.create_root_node ("Content"); + as_xml (node); + return content_factory (film, shared_ptr<cxml::Node> (new cxml::Node (node))); +} |
