X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcinema.cc;h=c8cb7b66cc935be866e8049b3a489971fd2712bc;hb=8102046b2f29e0c7b234c29bf204b056cb30e64f;hp=7af4372f59981fe2b444a0286a829abf8bc88164;hpb=089b90439e745a218494e76b45e7df6215af01df;p=dcpomatic.git diff --git a/src/lib/cinema.cc b/src/lib/cinema.cc index 7af4372f5..c8cb7b66c 100644 --- a/src/lib/cinema.cc +++ b/src/lib/cinema.cc @@ -24,13 +24,21 @@ using std::list; using boost::shared_ptr; -Cinema::Cinema (shared_ptr node) +Cinema::Cinema (cxml::ConstNodePtr node) + : name (node->string_child ("Name")) + , email (node->string_child ("Email")) { - name = node->string_child ("Name"); - email = node->string_child ("Email"); - list > s = node->node_children ("Screen"); - for (list >::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 (cxml::ConstNodePtr node) +{ + list s = node->node_children ("Screen"); + for (list::iterator i = s.begin(); i != s.end(); ++i) { add_screen (shared_ptr (new Screen (*i))); } } @@ -59,10 +67,10 @@ Cinema::remove_screen (shared_ptr s) _screens.remove (s); } -Screen::Screen (shared_ptr node) +Screen::Screen (cxml::ConstNodePtr node) { name = node->string_child ("Name"); - certificate = shared_ptr (new libdcp::Certificate (node->string_child ("Certificate"))); + certificate = shared_ptr (new dcp::Certificate (node->string_child ("Certificate"))); } void