+ boost::optional<std::string> font_id;
+ boost::optional<int64_t> size;
+ boost::optional<float> aspect_adjust;
+ boost::optional<bool> italic;
+ boost::optional<bool> bold;
+ boost::optional<bool> underline;
+ boost::optional<Colour> colour;
+ boost::optional<Effect> effect;
+ boost::optional<Colour> effect_colour;
+ boost::optional<float> h_position;
+ boost::optional<HAlign> h_align;
+ boost::optional<float> v_position;
+ boost::optional<VAlign> v_align;
+ boost::optional<float> z_position;
+ boost::optional<Direction> direction;
+ boost::optional<Time> in;
+ boost::optional<Time> out;
+ boost::optional<Time> fade_up_time;
+ boost::optional<Time> fade_down_time;
+ enum class Type {
+ TEXT,
+ IMAGE
+ };
+ boost::optional<Type> type;
+ float space_before = 0;
+ };
+
+ void parse_subtitles (xmlpp::Element const * node, std::vector<ParseState>& state, boost::optional<int> tcr, Standard standard);
+ ParseState font_node_state (xmlpp::Element const * node, Standard standard) const;
+ ParseState text_node_state (xmlpp::Element const * node) const;
+ ParseState image_node_state (xmlpp::Element const * node) const;
+ ParseState subtitle_node_state (xmlpp::Element const * node, boost::optional<int> tcr) const;
+ Time fade_time (xmlpp::Element const * node, std::string name, boost::optional<int> tcr) const;
+ void position_align (ParseState& ps, xmlpp::Element const * node) const;
+
+ void subtitles_as_xml (xmlpp::Element* root, int time_code_rate, Standard standard) const;
+
+ /** All our subtitles, in no particular order */
+ std::vector<std::shared_ptr<Subtitle>> _subtitles;
+
+ class Font
+ {
+ public:
+ Font (std::string load_id_, std::string uuid_, boost::filesystem::path file_)
+ : load_id (load_id_)
+ , uuid (uuid_)
+ , data (file_)
+ , file (file_)
+ {}
+
+ Font (std::string load_id_, std::string uuid_, ArrayData data_)
+ : load_id (load_id_)
+ , uuid (uuid_)
+ , data (data_)
+ {}
+
+ std::string load_id;
+ std::string uuid;
+ ArrayData data;
+ /** .ttf file that this data was last written to, if applicable */
+ mutable boost::optional<boost::filesystem::path> file;