Start of Fonts dialog for setting up subtitle fonts.
[dcpomatic.git] / src / lib / dcp_subtitle_content.cc
index 85c28d03832acbb8e2ec126175e370def41859ea..351d8c26ef8e07b958b2c2323f7a2893ede12b99 100644 (file)
 
 */
 
+#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"
@@ -47,9 +49,18 @@ void
 DCPSubtitleContent::examine (shared_ptr<Job> job, bool calculate_digest)
 {
        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