Conversion of frame index to FFmpeg time must always use the original or detected...
[dcpomatic.git] / src / lib / cinema.cc
index 7af4372f59981fe2b444a0286a829abf8bc88164..fca6b6afda36c80c653940eaaaa8819818327b4b 100644 (file)
@@ -25,12 +25,20 @@ using std::list;
 using boost::shared_ptr;
 
 Cinema::Cinema (shared_ptr<const cxml::Node> node)
+       : name (node->string_child ("Name"))
+       , email (node->string_child ("Email"))
 {
-       name = node->string_child ("Name");
-       email = node->string_child ("Email");
 
-       list<shared_ptr<cxml::Node> > s = node->node_children ("Screen");
-       for (list<shared_ptr<cxml::Node> >::iterator i = s.begin(); i != s.end(); ++i) {
+}
+
+/* This is necessary so that we can use shared_from_this in add_screen (which cannot be done from
+   a constructor)
+*/
+void
+Cinema::read_screens (shared_ptr<const cxml::Node> node)
+{
+       list<cxml::NodePtr> s = node->node_children ("Screen");
+       for (list<cxml::NodePtr>::iterator i = s.begin(); i != s.end(); ++i) {
                add_screen (shared_ptr<Screen> (new Screen (*i)));
        }
 }