summaryrefslogtreecommitdiff
path: root/src/picture_asset_instance.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-08-30 17:27:22 +0100
committerCarl Hetherington <cth@carlh.net>2013-08-30 17:27:22 +0100
commitff38c8737a36e5aced5f2dede5bccd2832fc446a (patch)
tree652a0548b76cfff2f4e7438c477cd4ac18f7a089 /src/picture_asset_instance.cc
parentd0e025d26cab0eecfea1528343638dac69f363cd (diff)
Partial.rework-again
Diffstat (limited to 'src/picture_asset_instance.cc')
-rw-r--r--src/picture_asset_instance.cc43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/picture_asset_instance.cc b/src/picture_asset_instance.cc
new file mode 100644
index 00000000..339944d3
--- /dev/null
+++ b/src/picture_asset_instance.cc
@@ -0,0 +1,43 @@
+/*
+ Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "picture_asset_instance.h"
+
+using namespace libdcp;
+
+void
+PictureAssetInstance::write_to_cpl (xmlpp::Element* node, bool interop) const
+{
+ AssetInstance::write_to_cpl (node, interop);
+
+ xmlpp::Node::NodeList c = node->get_children ();
+ xmlpp::Node::NodeList::iterator i = c.begin();
+ while (i != c.end() && (*i)->get_name() != cpl_node_name ()) {
+ ++i;
+ }
+
+ assert (i != c.end ());
+
+ (*i)->add_child ("FrameRate")->add_child_text (lexical_cast<string> (_edit_rate * edit_rate_factor ()) + " 1");
+ if (interop) {
+ (*i)->add_child ("ScreenAspectRatio")->add_child_text (lexical_cast<string> (float (_size.width) / _size.height));
+ } else {
+ (*i)->add_child ("ScreenAspectRatio")->add_child_text (lexical_cast<string> (_size.width) + " " + lexical_cast<string> (_size.height));
+ }
+}