X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fsubtitle_asset.h;h=7a00e0369eba87549de42fc4a75b3cebd2b5f939;hb=refs%2Ftags%2Fv0.84;hp=2da1ce7b8f9b7ae6f0c3090428a4b6351bdd027d;hpb=27e74ac5cf717233914fd017eb9ca67ee7c4af96;p=libdcp.git diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h index 2da1ce7b..7a00e036 100644 --- a/src/subtitle_asset.h +++ b/src/subtitle_asset.h @@ -17,14 +17,24 @@ */ +#ifndef LIBDCP_SUBTITLE_ASSET_H +#define LIBDCP_SUBTITLE_ASSET_H + +#include #include "asset.h" -#include "xml.h" #include "dcp_time.h" -#include "parse/subtitle.h" namespace libdcp { +namespace parse +{ + class Font; + class Text; + class Subtitle; + class LoadFont; +} + class Subtitle { public: @@ -102,9 +112,15 @@ private: std::string _font; bool _italic; Color _color; + /** Size in points as if the screen height is 11 inches, so a 72pt font + * would be 1/11th of the screen height. + */ int _size; Time _in; Time _out; + /** Vertical position as a proportion of the screen height from the top + * (between 0 and 1) + */ float _v_position; VAlign _v_align; std::string _text; @@ -123,7 +139,7 @@ public: SubtitleAsset (std::string directory, std::string xml_file); SubtitleAsset (std::string directory, std::string movie_title, std::string language); - void write_to_cpl (xmlpp::Node *) const; + void write_to_cpl (xmlpp::Element *, bool) const; virtual bool equals (boost::shared_ptr, EqualityOptions, boost::function note) const { /* XXX */ note (ERROR, "subtitle assets not compared yet"); @@ -143,7 +159,7 @@ public: void read_xml (std::string); void write_xml () const; - void write_xml (std::ostream &) const; + Glib::ustring xml_as_string () const; private: std::string font_id_to_name (std::string id) const; @@ -179,3 +195,5 @@ private: }; } + +#endif