Merge master.
[dcpomatic.git] / src / lib / subtitle_content.cc
index f839a56d0f6b60b008090b7d1d6756c1b06f34d5..8c94a94b995f7f35798dc3ec06f1a02a090890a4 100644 (file)
@@ -26,6 +26,7 @@
 #include "i18n.h"
 
 using std::string;
+using std::stringstream;
 using std::vector;
 using std::cout;
 using boost::shared_ptr;
@@ -37,6 +38,16 @@ int const SubtitleContentProperty::SUBTITLE_Y_OFFSET = 501;
 int const SubtitleContentProperty::SUBTITLE_SCALE = 502;
 int const SubtitleContentProperty::SUBTITLE_USE = 503;
 
+SubtitleContent::SubtitleContent (shared_ptr<const Film> f)
+       : Content (f)
+       , _subtitle_use (false)
+       , _subtitle_x_offset (0)
+       , _subtitle_y_offset (0)
+       , _subtitle_scale (1)
+{
+
+}
+
 SubtitleContent::SubtitleContent (shared_ptr<const Film> f, boost::filesystem::path p)
        : Content (f, p)
        , _subtitle_use (false)
@@ -145,3 +156,15 @@ SubtitleContent::set_subtitle_scale (double s)
        }
        signal_changed (SubtitleContentProperty::SUBTITLE_SCALE);
 }
+
+string
+SubtitleContent::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 ();
+}