-/** Return the filename of a subtitle image if one exists for a given thumb index.
- * @param Thumbnail index.
- * @return Position of the image within the source frame, and the image filename, if one exists.
- * Otherwise the filename will be empty.
- */
-pair<Position, string>
-Film::thumb_subtitle (int n) const
-{
- string sub_file = thumb_base(n) + ".sub";
- if (!boost::filesystem::exists (sub_file)) {
- return pair<Position, string> ();
- }
-
- pair<Position, string> sub;
-
- ifstream f (sub_file.c_str ());
- multimap<string, string> kv = read_key_value (f);
- for (map<string, string>::const_iterator i = kv.begin(); i != kv.end(); ++i) {
- if (i->first == "x") {
- sub.first.x = lexical_cast<int> (i->second);
- } else if (i->first == "y") {
- sub.first.y = lexical_cast<int> (i->second);
- sub.second = String::compose ("%1.sub.png", thumb_base(n));
- }
- }
-
- return sub;
-}
-