Start of Fonts dialog for setting up subtitle fonts.
[dcpomatic.git] / src / lib / dcp_subtitle_content.cc
index 83b0d200cee33146c6f92b33a1de1bd0b34df0da..351d8c26ef8e07b958b2c2323f7a2893ede12b99 100644 (file)
 
 */
 
-#include <dcp/subtitle_content.h>
-#include <dcp/raw_convert.h>
+#include "font.h"
 #include "dcp_subtitle_content.h"
+#include <dcp/interop_subtitle_content.h>
+#include <dcp/interop_load_font.h>
+#include <dcp/raw_convert.h>
 
 #include "i18n.h"
 
@@ -44,11 +46,21 @@ DCPSubtitleContent::DCPSubtitleContent (shared_ptr<const Film> film, cxml::Const
 }
 
 void
-DCPSubtitleContent::examine (shared_ptr<Job> job)
+DCPSubtitleContent::examine (shared_ptr<Job> job, bool calculate_digest)
 {
-       Content::examine (job);
-       dcp::SubtitleContent sc (path (0), false);
+       Content::examine (job, calculate_digest);
+       
+       dcp::InteropSubtitleContent sc (path (0));
+
+       boost::mutex::scoped_lock lm (_mutex);
+       
+       _subtitle_language = sc.language ();
        _length = DCPTime::from_seconds (sc.latest_subtitle_out().to_seconds ());
+
+       list<shared_ptr<dcp::InteropLoadFont> > fonts = sc.load_font_nodes ();
+       for (list<shared_ptr<dcp::InteropLoadFont> >::const_iterator i = fonts.begin(); i != fonts.end(); ++i) {
+               _fonts.push_back (shared_ptr<Font> (new Font ((*i)->id)));
+       }
 }
 
 DCPTime