Reasonably straightforward stuff; main things are adding
[dcpomatic.git] / src / lib / dcp_content.h
index 0f59bdf43e1f6aaee16d3e3835b0098e5b91f65f..1edc3a3aaaac7276a600499f60b7a93d7f4d0100 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -24,7 +24,6 @@
  *  @brief DCPContent class.
  */
 
-#include "video_content.h"
 #include "single_stream_audio_content.h"
 #include "subtitle_content.h"
 #include <libcxml/cxml.h>
@@ -42,7 +41,7 @@ public:
 /** @class DCPContent
  *  @brief An existing DCP used as input.
  */
-class DCPContent : public VideoContent, public SingleStreamAudioContent, public SubtitleContent
+class DCPContent : public SingleStreamAudioContent, public SubtitleContent
 {
 public:
        DCPContent (boost::shared_ptr<const Film>, boost::filesystem::path p);
@@ -52,6 +51,10 @@ public:
                return boost::dynamic_pointer_cast<DCPContent> (Content::shared_from_this ());
        }
 
+       boost::shared_ptr<const DCPContent> shared_from_this () const {
+               return boost::dynamic_pointer_cast<const DCPContent> (Content::shared_from_this ());
+       }
+
        DCPTime full_length () const;
 
        void examine (boost::shared_ptr<Job>);
@@ -61,6 +64,7 @@ public:
        std::string identifier () const;
 
        void set_default_colour_conversion ();
+       std::list<DCPTime> reel_split_points () const;
 
        /* SubtitleContent */
 
@@ -73,9 +77,7 @@ public:
                return false;
        }
 
-       double subtitle_video_frame_rate () const {
-               return video_frame_rate ();
-       }
+       double subtitle_video_frame_rate () const;
 
        boost::filesystem::path directory () const;
 
@@ -99,6 +101,8 @@ public:
                return _reference_video;
        }
 
+       bool can_reference_video (std::list<std::string> &) const;
+
        void set_reference_audio (bool r);
 
        bool reference_audio () const {
@@ -106,6 +110,8 @@ public:
                return _reference_audio;
        }
 
+       bool can_reference_audio (std::list<std::string> &) const;
+
        void set_reference_subtitle (bool r);
 
        bool reference_subtitle () const {
@@ -113,11 +119,15 @@ public:
                return _reference_subtitle;
        }
 
+       bool can_reference_subtitle (std::list<std::string> &) const;
+
 protected:
-       void add_properties (std::list<std::pair<std::string, std::string> >& p) const;
+       void add_properties (std::list<UserProperty>& p) const;
 
 private:
        void read_directory (boost::filesystem::path);
+       std::list<DCPTimePeriod> reels () const;
+       template <class T> bool can_reference (std::string overlapping, std::list<std::string>& why_not) const;
 
        std::string _name;
        bool _has_subtitles;