Fix merging of audio in various circumstances.
[dcpomatic.git] / src / lib / playlist.cc
index a8b5a26ebbc0c4e91a9385d2aa67b5a724cf9bb2..6abbbcab33810696dc2bbb551aa5cd512ed5ff98 100644 (file)
@@ -175,10 +175,10 @@ Playlist::set_from_xml (shared_ptr<const Film> film, cxml::ConstNodePtr node, in
 
 /** @param node <Playlist> node */
 void
-Playlist::as_xml (xmlpp::Node* node)
+Playlist::as_xml (xmlpp::Node* node, bool with_content_paths)
 {
        BOOST_FOREACH (shared_ptr<Content> i, _content) {
-               i->as_xml (node->add_child ("Content"));
+               i->as_xml (node->add_child ("Content"), with_content_paths);
        }
 }
 
@@ -536,3 +536,15 @@ Playlist::content_summary (DCPTimePeriod period) const
 
        return best_summary;
 }
+
+bool
+Playlist::video_content_at (DCPTime time) const
+{
+       BOOST_FOREACH (shared_ptr<Content> i, _content) {
+               if (i->video && i->position() <= time && time < i->end()) {
+                       return true;
+               }
+       }
+
+       return false;
+}