diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-24 22:23:41 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-24 22:23:41 +0100 |
| commit | 93d06f01683ec7ad351db329627b02d4fb23f4fa (patch) | |
| tree | dd6f1a265b2965e8c177a7e14afa639bd699ae91 /src/subtitle_asset.h | |
| parent | 9e523d8a4062ad52330dff6c2ba50e54184c9bb2 (diff) | |
| parent | 69f188e13db64d8a3b17e49351d0be0ac3676b99 (diff) | |
Merge.
Diffstat (limited to 'src/subtitle_asset.h')
| -rw-r--r-- | src/subtitle_asset.h | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h index cc27f958..44ac455f 100644 --- a/src/subtitle_asset.h +++ b/src/subtitle_asset.h @@ -70,7 +70,7 @@ public: void add (SubtitleString); virtual void add_font (std::string id, boost::filesystem::path file) = 0; - std::map<std::string, Data> fonts () const; + std::map<std::string, Data> fonts_with_load_ids () const; virtual void write (boost::filesystem::path) const = 0; virtual Glib::ustring xml_as_string () const = 0; @@ -85,28 +85,34 @@ protected: void parse_subtitles (boost::shared_ptr<cxml::Document> xml, std::list<boost::shared_ptr<FontNode> > font_nodes); void subtitles_as_xml (xmlpp::Element* root, int time_code_rate, std::string xmlns) const; - void add_font_data (std::string id, boost::filesystem::path file); /** All our subtitles, in no particular order */ std::list<SubtitleString> _subtitles; - class FileData : public Data { + class Font + { public: - FileData () {} + Font (std::string load_id_, std::string uuid_, boost::filesystem::path file_) + : load_id (load_id_) + , uuid (uuid_) + , data (file_) + , file (file_) + {} - FileData (boost::shared_array<uint8_t> data_, boost::uintmax_t size_) - : Data (data_, size_) + Font (std::string load_id_, std::string uuid_, Data data_) + : load_id (load_id_) + , uuid (uuid_) + , data (data_) {} - /** .ttf file that this data was last written to */ + std::string load_id; + std::string uuid; + Data data; + /** .ttf file that this data was last written to, if applicable */ mutable boost::optional<boost::filesystem::path> file; }; - /** Font data, keyed by a subclass-dependent identifier. - * For Interop, the string is the font ID from the subtitle file. - * For SMPTE, the string is the font's URN from the subtitle file. - */ - std::map<std::string, FileData> _fonts; + std::list<Font> _fonts; private: /** @struct ParseState |
