std::shared_ptr
[dcpomatic.git] / src / lib / dcp_examiner.cc
index 133c1614e922b5b5f8b6efbcb8a88d7321c2d785..fc1fbc53a7163fe7f7decee339435d41f833506e 100644 (file)
@@ -53,8 +53,8 @@ using std::list;
 using std::cout;
 using std::runtime_error;
 using std::map;
-using boost::shared_ptr;
-using boost::dynamic_pointer_cast;
+using std::shared_ptr;
+using std::dynamic_pointer_cast;
 
 DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
        : DCP (content, tolerant)
@@ -67,6 +67,7 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
        , _kdm_valid (false)
        , _three_d (false)
        , _has_atmos (false)
+       , _atmos_length (0)
 {
        shared_ptr<dcp::CPL> cpl;
 
@@ -189,6 +190,7 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
                        }
 
                        _text_count[TEXT_CLOSED_CAPTION]++;
+                       _dcp_text_tracks.push_back (DCPTextTrack(j->annotation_text(), j->language().get_value_or(_("Unknown"))));
                }
 
                if (i->main_markers ()) {
@@ -198,6 +200,11 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
 
                if (i->atmos()) {
                        _has_atmos = true;
+                       _atmos_length += i->atmos()->actual_duration();
+                       if (_atmos_edit_rate != dcp::Fraction()) {
+                               DCPOMATIC_ASSERT (i->atmos()->edit_rate() == _atmos_edit_rate);
+                       }
+                       _atmos_edit_rate = i->atmos()->edit_rate();
                }
 
                if (i->main_picture()) {
@@ -252,8 +259,10 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
        _standard = cpl->standard().get();
        _three_d = !cpl->reels().empty() && cpl->reels().front()->main_picture() &&
                dynamic_pointer_cast<dcp::StereoPictureAsset> (cpl->reels().front()->main_picture()->asset());
-       _ratings = list_to_vector (cpl->ratings());
-       _content_version = cpl->content_version_label_text ();
+       _ratings = cpl->ratings();
+       BOOST_FOREACH (dcp::ContentVersion i, cpl->content_versions()) {
+               _content_versions.push_back (i.label_text);
+       }
 
        _cpl = cpl->id ();
 }