diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-10 22:41:48 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-10 22:41:48 +0100 |
| commit | a8af9a0b57b853b8a8cd8fa35adb3fc967d59ee7 (patch) | |
| tree | 9493b374153de99bc220138361420c5abe85b16e /src/lib/dcp_content.cc | |
| parent | 8d58a7c5f4320ad5c111e336c45e44d6b51ab509 (diff) | |
Add has_subtitles method to SubtitleContent; tidy up timeline display a bit.
Diffstat (limited to 'src/lib/dcp_content.cc')
| -rw-r--r-- | src/lib/dcp_content.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index b1d0d9a37..0eef075d7 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -34,6 +34,7 @@ DCPContent::DCPContent (shared_ptr<const Film> f, boost::filesystem::path p) , VideoContent (f) , SingleStreamAudioContent (f) , SubtitleContent (f) + , _has_subtitles (false) , _directory (p) { read_directory (p); @@ -46,6 +47,7 @@ DCPContent::DCPContent (shared_ptr<const Film> f, cxml::ConstNodePtr node, int v , SubtitleContent (f, node, version) { _name = node->string_child ("Name"); + _has_subtitles = node->bool_child ("HasSubtitles"); _directory = node->string_child ("Directory"); } @@ -66,12 +68,14 @@ DCPContent::examine (shared_ptr<Job> job) { job->set_progress_unknown (); Content::examine (job); + shared_ptr<DCPExaminer> examiner (new DCPExaminer (shared_from_this ())); take_from_video_examiner (examiner); take_from_audio_examiner (examiner); boost::mutex::scoped_lock lm (_mutex); _name = examiner->name (); + _has_subtitles = examiner->has_subtitles (); } string @@ -99,7 +103,9 @@ DCPContent::as_xml (xmlpp::Node* node) const SingleStreamAudioContent::as_xml (node); SubtitleContent::as_xml (node); + boost::mutex::scoped_lock lm (_mutex); node->add_child("Name")->add_child_text (_name); + node->add_child("HasSubtitles")->add_child_text (_has_subtitles ? "1" : "0"); node->add_child("Directory")->add_child_text (_directory.string ()); } @@ -116,3 +122,10 @@ DCPContent::identifier () const { return SubtitleContent::identifier (); } + +bool +DCPContent::has_subtitles () const +{ + boost::mutex::scoped_lock lm (_mutex); + return _has_subtitles; +} |
