X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fsubtitle_content.cc;h=8c94a94b995f7f35798dc3ec06f1a02a090890a4;hb=8d58a7c5f4320ad5c111e336c45e44d6b51ab509;hp=f839a56d0f6b60b008090b7d1d6756c1b06f34d5;hpb=dc1c279211773ad68cb0348eb802cf5c9594d8dd;p=dcpomatic.git diff --git a/src/lib/subtitle_content.cc b/src/lib/subtitle_content.cc index f839a56d0..8c94a94b9 100644 --- a/src/lib/subtitle_content.cc +++ b/src/lib/subtitle_content.cc @@ -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 f) + : Content (f) + , _subtitle_use (false) + , _subtitle_x_offset (0) + , _subtitle_y_offset (0) + , _subtitle_scale (1) +{ + +} + SubtitleContent::SubtitleContent (shared_ptr 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 (subtitle_scale()) + << "_" << raw_convert (subtitle_x_offset()) + << "_" << raw_convert (subtitle_y_offset()); + + return s.str (); +}