+ if (version == 32) {
+ BOOST_FOREACH (cxml::NodePtr i, node->node_children ("Period")) {
+ /* In version 32 we assumed that from times were unique, so they were
+ used as identifiers. All subtitles were image subtitles.
+ */
+ add_image_subtitle (
+ raw_convert<string> (i->string_child ("From")),
+ ContentTimePeriod (
+ ContentTime (i->number_child<ContentTime::Type> ("From")),
+ ContentTime (i->number_child<ContentTime::Type> ("To"))
+ )
+ );
+ }
+ } else {
+ /* In version 33 we use a hash of various parts of the subtitle as the id.
+ <Subtitle> was initially used for image subtitles; later we have
+ <ImageSubtitle> and <TextSubtitle>
+ */
+ BOOST_FOREACH (cxml::NodePtr i, node->node_children ("Subtitle")) {
+ add_image_subtitle (
+ raw_convert<string> (i->string_child ("Id")),
+ ContentTimePeriod (
+ ContentTime (i->number_child<ContentTime::Type> ("From")),
+ ContentTime (i->number_child<ContentTime::Type> ("To"))
+ )
+ );
+ }
+
+ BOOST_FOREACH (cxml::NodePtr i, node->node_children ("ImageSubtitle")) {
+ add_image_subtitle (
+ raw_convert<string> (i->string_child ("Id")),
+ ContentTimePeriod (
+ ContentTime (i->number_child<ContentTime::Type> ("From")),
+ ContentTime (i->number_child<ContentTime::Type> ("To"))
+ )
+ );
+ }
+
+ BOOST_FOREACH (cxml::NodePtr i, node->node_children ("TextSubtitle")) {
+ add_text_subtitle (
+ raw_convert<string> (i->string_child ("Id")),
+ ContentTimePeriod (
+ ContentTime (i->number_child<ContentTime::Type> ("From")),
+ ContentTime (i->number_child<ContentTime::Type> ("To"))
+ )
+ );
+ }
+
+ BOOST_FOREACH (cxml::NodePtr i, node->node_children ("Colour")) {
+ _colours[RGBA(i->node_child("From"))] = RGBA (i->node_child("To"));
+ }