Start of Fonts dialog for setting up subtitle fonts.
[dcpomatic.git] / src / lib / subrip_content.cc
index 8f9c28e293c15bfe9335e0f9f7fe9bc24edca1de..969829b31e1a9075d2e7316fb1cfab2ecbaed58e 100644 (file)
 #include "util.h"
 #include "subrip.h"
 #include "film.h"
+#include "font.h"
 #include <dcp/raw_convert.h>
 
 #include "i18n.h"
 
-using std::stringstream;
 using std::string;
 using std::cout;
 using dcp::raw_convert;
@@ -39,18 +39,18 @@ SubRipContent::SubRipContent (shared_ptr<const Film> film, boost::filesystem::pa
 
 }
 
-SubRipContent::SubRipContent (shared_ptr<const Film> film, shared_ptr<const cxml::Node> node, int version)
+SubRipContent::SubRipContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
        : Content (film, node)
        , SubtitleContent (film, node, version)
-       , _length (node->number_child<int64_t> ("Length"))
+       , _length (node->number_child<DCPTime::Type> ("Length"))
 {
 
 }
 
 void
-SubRipContent::examine (boost::shared_ptr<Job> job)
+SubRipContent::examine (boost::shared_ptr<Job> job, bool calculate_digest)
 {
-       Content::examine (job);
+       Content::examine (job, calculate_digest);
        SubRip s (shared_from_this ());
 
        shared_ptr<const Film> film = _film.lock ();
@@ -60,6 +60,7 @@ SubRipContent::examine (boost::shared_ptr<Job> job)
 
        boost::mutex::scoped_lock lm (_mutex);
        _length = len;
+       _fonts.push_back (shared_ptr<Font> (new Font ()));
 }
 
 string
@@ -77,7 +78,7 @@ SubRipContent::technical_summary () const
 string
 SubRipContent::information () const
 {
-       
+
 }
        
 void
@@ -97,15 +98,3 @@ SubRipContent::full_length () const
        */
        return _length;
 }
-
-string
-SubRipContent::identifier () const
-{
-       stringstream s;
-       s << Content::identifier()
-         << "_" << raw_convert<string> (subtitle_scale())
-         << "_" << raw_convert<string> (subtitle_x_offset())
-         << "_" << raw_convert<string> (subtitle_y_offset());
-
-       return s.str ();
-}