summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-24 11:16:24 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-24 11:16:24 +0100
commit3412af70b950dcdc604413ef05c26becda6da789 (patch)
treeb901f89335ec7e06531b475dbb45ff1ee7087e28 /src/lib
parenta26b6e9e392a1ac342a19e0d33d92865819c6ded (diff)
Bump libdcp for new method.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/atmos_mxf_content.cc4
-rw-r--r--src/lib/atmos_mxf_content.h2
-rw-r--r--src/lib/config.cc8
-rw-r--r--src/lib/config.h2
-rw-r--r--src/lib/content.cc8
-rw-r--r--src/lib/content.h2
-rw-r--r--src/lib/dcp_content.cc2
-rw-r--r--src/lib/dcp_content.h2
-rw-r--r--src/lib/ffmpeg_content.cc4
-rw-r--r--src/lib/ffmpeg_content.h2
-rw-r--r--src/lib/film.cc4
-rw-r--r--src/lib/film.h2
-rw-r--r--src/lib/image_content.cc4
-rw-r--r--src/lib/image_content.h2
-rw-r--r--src/lib/playlist.cc4
-rw-r--r--src/lib/playlist.h2
-rw-r--r--src/lib/text_subtitle_content.cc4
-rw-r--r--src/lib/text_subtitle_content.h2
18 files changed, 36 insertions, 24 deletions
diff --git a/src/lib/atmos_mxf_content.cc b/src/lib/atmos_mxf_content.cc
index f8cc05178..2fd9ead06 100644
--- a/src/lib/atmos_mxf_content.cc
+++ b/src/lib/atmos_mxf_content.cc
@@ -79,10 +79,10 @@ AtmosMXFContent::summary () const
}
void
-AtmosMXFContent::as_xml (xmlpp::Node* node) const
+AtmosMXFContent::as_xml (xmlpp::Node* node, bool with_paths) const
{
node->add_child("Type")->add_child_text ("AtmosMXF");
- Content::as_xml (node);
+ Content::as_xml (node, with_paths);
}
DCPTime
diff --git a/src/lib/atmos_mxf_content.h b/src/lib/atmos_mxf_content.h
index 10c969a7d..0f5225c2e 100644
--- a/src/lib/atmos_mxf_content.h
+++ b/src/lib/atmos_mxf_content.h
@@ -32,7 +32,7 @@ public:
void examine (boost::shared_ptr<Job> job);
std::string summary () const;
- void as_xml (xmlpp::Node* node) const;
+ void as_xml (xmlpp::Node* node, bool with_path) const;
DCPTime full_length () const;
static bool valid_mxf (boost::filesystem::path path);
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 4184a7d1d..383ffdbd6 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -588,3 +588,11 @@ Config::set_cinemas_file (boost::filesystem::path file)
changed (OTHER);
}
+
+void
+Config::save_template (shared_ptr<const Film> film, string name) const
+{
+ boost::filesystem::create_directories (path ("templates"));
+ shared_ptr<xmlpp::Document> doc = film->metadata (false);
+ doc->write_to_file_formatted (path("templates") / tidy_for_filename (name));
+}
diff --git a/src/lib/config.h b/src/lib/config.h
index a988cda6b..3df5c3795 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -514,6 +514,8 @@ public:
void write () const;
+ void save_template (boost::shared_ptr<const Film> film, std::string name) const;
+
static Config* instance ();
static void drop ();
static void restore_defaults ();
diff --git a/src/lib/content.cc b/src/lib/content.cc
index 9083635f2..a27032e9c 100644
--- a/src/lib/content.cc
+++ b/src/lib/content.cc
@@ -135,12 +135,14 @@ Content::Content (shared_ptr<const Film> film, vector<shared_ptr<Content> > c)
}
void
-Content::as_xml (xmlpp::Node* node) const
+Content::as_xml (xmlpp::Node* node, bool with_paths) const
{
boost::mutex::scoped_lock lm (_mutex);
- for (vector<boost::filesystem::path>::const_iterator i = _paths.begin(); i != _paths.end(); ++i) {
- node->add_child("Path")->add_child_text (i->string ());
+ if (with_paths) {
+ for (vector<boost::filesystem::path>::const_iterator i = _paths.begin(); i != _paths.end(); ++i) {
+ node->add_child("Path")->add_child_text (i->string ());
+ }
}
node->add_child("Digest")->add_child_text (_digest);
node->add_child("Position")->add_child_text (raw_convert<string> (_position.get ()));
diff --git a/src/lib/content.h b/src/lib/content.h
index f8b5493c0..e126c994b 100644
--- a/src/lib/content.h
+++ b/src/lib/content.h
@@ -86,7 +86,7 @@ public:
*/
virtual std::string technical_summary () const;
- virtual void as_xml (xmlpp::Node *) const;
+ virtual void as_xml (xmlpp::Node *, bool with_paths) const;
virtual DCPTime full_length () const = 0;
virtual std::string identifier () const;
/** @return points at which to split this content when
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc
index 03e6f1aaa..5cacc824a 100644
--- a/src/lib/dcp_content.cc
+++ b/src/lib/dcp_content.cc
@@ -192,7 +192,7 @@ DCPContent::technical_summary () const
}
void
-DCPContent::as_xml (xmlpp::Node* node) const
+DCPContent::as_xml (xmlpp::Node* node, bool with_paths) const
{
node->add_child("Type")->add_child_text ("DCP");
diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h
index f3a8236a2..79c35d0e8 100644
--- a/src/lib/dcp_content.h
+++ b/src/lib/dcp_content.h
@@ -62,7 +62,7 @@ public:
void examine (boost::shared_ptr<Job>);
std::string summary () const;
std::string technical_summary () const;
- void as_xml (xmlpp::Node *) const;
+ void as_xml (xmlpp::Node *, bool with_paths) const;
std::string identifier () const;
void set_default_colour_conversion ();
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index b5c5ce0a8..bc913a9ae 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -181,10 +181,10 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> film, vector<shared_ptr<Con
}
void
-FFmpegContent::as_xml (xmlpp::Node* node) const
+FFmpegContent::as_xml (xmlpp::Node* node, bool with_paths) const
{
node->add_child("Type")->add_child_text ("FFmpeg");
- Content::as_xml (node);
+ Content::as_xml (node, with_paths);
if (video) {
video->as_xml (node);
diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h
index 666322669..b341aa012 100644
--- a/src/lib/ffmpeg_content.h
+++ b/src/lib/ffmpeg_content.h
@@ -57,7 +57,7 @@ public:
void examine (boost::shared_ptr<Job>);
std::string summary () const;
std::string technical_summary () const;
- void as_xml (xmlpp::Node *) const;
+ void as_xml (xmlpp::Node *, bool with_paths) const;
DCPTime full_length () const;
std::string identifier () const;
diff --git a/src/lib/film.cc b/src/lib/film.cc
index edb911217..31c47540f 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -329,7 +329,7 @@ Film::send_dcp_to_tms ()
}
shared_ptr<xmlpp::Document>
-Film::metadata () const
+Film::metadata (bool with_content_paths) const
{
shared_ptr<xmlpp::Document> doc (new xmlpp::Document);
xmlpp::Element* root = doc->create_root_node ("Metadata");
@@ -364,7 +364,7 @@ Film::metadata () const
root->add_child("ReelType")->add_child_text (raw_convert<string> (static_cast<int> (_reel_type)));
root->add_child("ReelLength")->add_child_text (raw_convert<string> (_reel_length));
root->add_child("UploadAfterMakeDCP")->add_child_text (_upload_after_make_dcp ? "1" : "0");
- _playlist->as_xml (root->add_child ("Playlist"));
+ _playlist->as_xml (root->add_child ("Playlist"), with_content_paths);
return doc;
}
diff --git a/src/lib/film.h b/src/lib/film.h
index 82d1f78c0..abe5c214f 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -93,7 +93,7 @@ public:
std::list<std::string> read_metadata ();
void write_metadata () const;
- boost::shared_ptr<xmlpp::Document> metadata () const;
+ boost::shared_ptr<xmlpp::Document> metadata (bool with_content_paths = true) const;
std::string isdcf_name (bool if_created_now) const;
std::string dcp_name (bool if_created_now = false) const;
diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc
index 825f6da25..b27483978 100644
--- a/src/lib/image_content.cc
+++ b/src/lib/image_content.cc
@@ -100,10 +100,10 @@ ImageContent::technical_summary () const
}
void
-ImageContent::as_xml (xmlpp::Node* node) const
+ImageContent::as_xml (xmlpp::Node* node, bool with_paths) const
{
node->add_child("Type")->add_child_text ("Image");
- Content::as_xml (node);
+ Content::as_xml (node, with_paths);
if (video) {
video->as_xml (node);
diff --git a/src/lib/image_content.h b/src/lib/image_content.h
index edcbec6dd..660d2ef9f 100644
--- a/src/lib/image_content.h
+++ b/src/lib/image_content.h
@@ -36,7 +36,7 @@ public:
void examine (boost::shared_ptr<Job>);
std::string summary () const;
std::string technical_summary () const;
- void as_xml (xmlpp::Node *) const;
+ void as_xml (xmlpp::Node *, bool with_paths) const;
DCPTime full_length () const;
std::string identifier () const;
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc
index a8b5a26eb..a30dde633 100644
--- a/src/lib/playlist.cc
+++ b/src/lib/playlist.cc
@@ -175,10 +175,10 @@ Playlist::set_from_xml (shared_ptr<const Film> film, cxml::ConstNodePtr node, in
/** @param node <Playlist> node */
void
-Playlist::as_xml (xmlpp::Node* node)
+Playlist::as_xml (xmlpp::Node* node, bool with_content_paths)
{
BOOST_FOREACH (shared_ptr<Content> i, _content) {
- i->as_xml (node->add_child ("Content"));
+ i->as_xml (node->add_child ("Content"), with_content_paths);
}
}
diff --git a/src/lib/playlist.h b/src/lib/playlist.h
index e84b51a73..0a5c087de 100644
--- a/src/lib/playlist.h
+++ b/src/lib/playlist.h
@@ -45,7 +45,7 @@ public:
Playlist ();
~Playlist ();
- void as_xml (xmlpp::Node *);
+ void as_xml (xmlpp::Node *, bool with_content_paths);
void set_from_xml (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int, std::list<std::string> &);
void add (boost::shared_ptr<Content>);
diff --git a/src/lib/text_subtitle_content.cc b/src/lib/text_subtitle_content.cc
index 63144766a..08722a065 100644
--- a/src/lib/text_subtitle_content.cc
+++ b/src/lib/text_subtitle_content.cc
@@ -75,10 +75,10 @@ TextSubtitleContent::technical_summary () const
}
void
-TextSubtitleContent::as_xml (xmlpp::Node* node) const
+TextSubtitleContent::as_xml (xmlpp::Node* node, bool with_paths) const
{
node->add_child("Type")->add_child_text ("TextSubtitle");
- Content::as_xml (node);
+ Content::as_xml (node, with_paths);
if (subtitle) {
subtitle->as_xml (node);
diff --git a/src/lib/text_subtitle_content.h b/src/lib/text_subtitle_content.h
index 3b9d396f6..fd0bad12a 100644
--- a/src/lib/text_subtitle_content.h
+++ b/src/lib/text_subtitle_content.h
@@ -38,7 +38,7 @@ public:
void examine (boost::shared_ptr<Job>);
std::string summary () const;
std::string technical_summary () const;
- void as_xml (xmlpp::Node *) const;
+ void as_xml (xmlpp::Node *, bool with_paths) const;
DCPTime full_length () const;
private: