updated: set 'svn:eol-style' to 'native'
authortaxigps <taxigps@svn>
Sun, 27 Sep 2009 15:57:03 +0000 (15:57 +0000)
committertaxigps <taxigps@svn>
Sun, 27 Sep 2009 15:57:03 +0000 (15:57 +0000)
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@23194 568bbfeb-2a22-0410-94d2-cc84cf5bfa90

system/colors.xml
xbmc/cores/dvdplayer/DVDSubtitles/SamiTagConvertor.cpp
xbmc/cores/dvdplayer/DVDSubtitles/SamiTagConvertor.h

index d7cd763..43703e4 100644 (file)
-<colors>\r
-       <color name="aliceblue">fff0f8ff</color>\r
-       <color name="antiquewhite">fffaebd7</color>\r
-       <color name="aqua">ff00ffff</color>\r
-       <color name="aquamarine">ff7fffd4</color>\r
-       <color name="azure">fff0ffff</color>\r
-       <color name="beige">fff5f5dc</color>\r
-       <color name="bisque">ffffe4c4</color>\r
-       <color name="black">ff000000</color>\r
-       <color name="blanchedalmond">ffffebcd</color>\r
-       <color name="blue">ff0000ff</color>\r
-       <color name="blueviolet">ff8a2be2</color>\r
-       <color name="brown">ffa52a2a</color>\r
-       <color name="burlywood">ffdeb887</color>\r
-       <color name="cadetblue">ff5f9ea0</color>\r
-       <color name="chartreuse">ff7fff00</color>\r
-       <color name="chocolate">ffd2691e</color>\r
-       <color name="coral">ffff7f50</color>\r
-       <color name="cornflowerblue">ff6495ed</color>\r
-       <color name="cornsilk">fffff8dc</color>\r
-       <color name="crimson">ffdc143c</color>\r
-       <color name="cyan">ff00ffff</color>\r
-       <color name="darkblue">ff00008b</color>\r
-       <color name="darkcyan">ff008b8b</color>\r
-       <color name="darkgoldenrod">ffb8860b</color>\r
-       <color name="darkgray">ffa9a9a9</color>\r
-       <color name="darkgreen">ff006400</color>\r
-       <color name="darkkhaki">ffbdb76b</color>\r
-       <color name="darkmagenta">ff8b008b</color>\r
-       <color name="darkolivegreen">ff556b2f</color>\r
-       <color name="darkorange">ffff8c00</color>\r
-       <color name="darkorchid">ff9932cc</color>\r
-       <color name="darkred">ff8b0000</color>\r
-       <color name="darksalmon">ffe9967a</color>\r
-       <color name="darkseagreen">ff8fbc8f</color>\r
-       <color name="darkslateblue">ff483d8b</color>\r
-       <color name="darkslategray">ff2f4f4f</color>\r
-       <color name="darkturquoise">ff00ced1</color>\r
-       <color name="darkviolet">ff9400d3</color>\r
-       <color name="deeppink">ffff1493</color>\r
-       <color name="deepskyblue">ff00bfff</color>\r
-       <color name="dimgray">ff696969</color>\r
-       <color name="dodgerblue">ff1e90ff</color>\r
-       <color name="firebrick">ffb22222</color>\r
-       <color name="floralwhite">fffffaf0</color>\r
-       <color name="forestgreen">ff228b22</color>\r
-       <color name="fuchsia">ffff00ff</color>\r
-       <color name="gainsboro">ffdcdcdc</color>\r
-       <color name="ghostwhite">fff8f8ff</color>\r
-       <color name="gold">ffffd700</color>\r
-       <color name="goldenrod">ffdaa520</color>\r
-       <color name="gray">ff808080</color>\r
-       <color name="green">ff008000</color>\r
-       <color name="greenyellow">ffadff2f</color>\r
-       <color name="honeydew">fff0fff0</color>\r
-       <color name="hotpink">ffff69b4</color>\r
-       <color name="indianred ">ffcd5c5c</color>\r
-       <color name="indigo  ">ff4b0082</color>\r
-       <color name="ivory">fffffff0</color>\r
-       <color name="khaki">fff0e68c</color>\r
-       <color name="lavender">ffe6e6fa</color>\r
-       <color name="lavenderblush">fffff0f5</color>\r
-       <color name="lawngreen">ff7cfc00</color>\r
-       <color name="lemonchiffon">fffffacd</color>\r
-       <color name="lightblue">ffadd8e6</color>\r
-       <color name="lightcoral">fff08080</color>\r
-       <color name="lightcyan">ffe0ffff</color>\r
-       <color name="lightgoldenrodyellow">fffafad2</color>\r
-       <color name="lightgrey">ffd3d3d3</color>\r
-       <color name="lightgreen">ff90ee90</color>\r
-       <color name="lightpink">ffffb6c1</color>\r
-       <color name="lightsalmon">ffffa07a</color>\r
-       <color name="lightseagreen">ff20b2aa</color>\r
-       <color name="lightskyblue">ff87cefa</color>\r
-       <color name="lightslategray">ff778899</color>\r
-       <color name="lightsteelblue">ffb0c4de</color>\r
-       <color name="lightyellow">ffffffe0</color>\r
-       <color name="lime">ff00ff00</color>\r
-       <color name="limegreen">ff32cd32</color>\r
-       <color name="linen">fffaf0e6</color>\r
-       <color name="magenta">ffff00ff</color>\r
-       <color name="maroon">ff800000</color>\r
-       <color name="mediumaquamarine">ff66cdaa</color>\r
-       <color name="mediumblue">ff0000cd</color>\r
-       <color name="mediumorchid">ffba55d3</color>\r
-       <color name="mediumpurple">ff9370d8</color>\r
-       <color name="mediumseagreen">ff3cb371</color>\r
-       <color name="mediumslateblue">ff7b68ee</color>\r
-       <color name="mediumspringgreen">ff00fa9a</color>\r
-       <color name="mediumturquoise">ff48d1cc</color>\r
-       <color name="mediumvioletred">ffc71585</color>\r
-       <color name="midnightblue">ff191970</color>\r
-       <color name="mintcream">fff5fffa</color>\r
-       <color name="mistyrose">ffffe4e1</color>\r
-       <color name="moccasin">ffffe4b5</color>\r
-       <color name="navajowhite">ffffdead</color>\r
-       <color name="navy">ff000080</color>\r
-       <color name="oldlace">fffdf5e6</color>\r
-       <color name="olive">ff808000</color>\r
-       <color name="olivedrab">ff6b8e23</color>\r
-       <color name="orange">ffffa500</color>\r
-       <color name="orangered">ffff4500</color>\r
-       <color name="orchid">ffda70d6</color>\r
-       <color name="palegoldenrod">ffeee8aa</color>\r
-       <color name="palegreen">ff98fb98</color>\r
-       <color name="paleturquoise">ffafeeee</color>\r
-       <color name="palevioletred">ffd87093</color>\r
-       <color name="papayawhip">ffffefd5</color>\r
-       <color name="peachpuff">ffffdab9</color>\r
-       <color name="peru">ffcd853f</color>\r
-       <color name="pink">ffffc0cb</color>\r
-       <color name="plum">ffdda0dd</color>\r
-       <color name="powderblue">ffb0e0e6</color>\r
-       <color name="purple">ff800080</color>\r
-       <color name="red">ffff0000</color>\r
-       <color name="rosybrown">ffbc8f8f</color>\r
-       <color name="royalblue">ff4169e1</color>\r
-       <color name="saddlebrown">ff8b4513</color>\r
-       <color name="salmon">fffa8072</color>\r
-       <color name="sandybrown">fff4a460</color>\r
-       <color name="seagreen">ff2e8b57</color>\r
-       <color name="seashell">fffff5ee</color>\r
-       <color name="sienna">ffa0522d</color>\r
-       <color name="silver">ffc0c0c0</color>\r
-       <color name="skyblue">ff87ceeb</color>\r
-       <color name="slateblue">ff6a5acd</color>\r
-       <color name="slategray">ff708090</color>\r
-       <color name="snow">fffffafa</color>\r
-       <color name="springgreen">ff00ff7f</color>\r
-       <color name="steelblue">ff4682b4</color>\r
-       <color name="tan">ffd2b48c</color>\r
-       <color name="teal">ff008080</color>\r
-       <color name="thistle">ffd8bfd8</color>\r
-       <color name="tomato">ffff6347</color>\r
-       <color name="turquoise">ff40e0d0</color>\r
-       <color name="violet">ffee82ee</color>\r
-       <color name="wheat">fff5deb3</color>\r
-       <color name="white">ffffffff</color>\r
-       <color name="whitesmoke">fff5f5f5</color>\r
-       <color name="yellow">ffffff00</color>\r
-       <color name="yellowgreen">ff9acd32</color>\r
-</colors>\r
+<colors>
+       <color name="aliceblue">fff0f8ff</color>
+       <color name="antiquewhite">fffaebd7</color>
+       <color name="aqua">ff00ffff</color>
+       <color name="aquamarine">ff7fffd4</color>
+       <color name="azure">fff0ffff</color>
+       <color name="beige">fff5f5dc</color>
+       <color name="bisque">ffffe4c4</color>
+       <color name="black">ff000000</color>
+       <color name="blanchedalmond">ffffebcd</color>
+       <color name="blue">ff0000ff</color>
+       <color name="blueviolet">ff8a2be2</color>
+       <color name="brown">ffa52a2a</color>
+       <color name="burlywood">ffdeb887</color>
+       <color name="cadetblue">ff5f9ea0</color>
+       <color name="chartreuse">ff7fff00</color>
+       <color name="chocolate">ffd2691e</color>
+       <color name="coral">ffff7f50</color>
+       <color name="cornflowerblue">ff6495ed</color>
+       <color name="cornsilk">fffff8dc</color>
+       <color name="crimson">ffdc143c</color>
+       <color name="cyan">ff00ffff</color>
+       <color name="darkblue">ff00008b</color>
+       <color name="darkcyan">ff008b8b</color>
+       <color name="darkgoldenrod">ffb8860b</color>
+       <color name="darkgray">ffa9a9a9</color>
+       <color name="darkgreen">ff006400</color>
+       <color name="darkkhaki">ffbdb76b</color>
+       <color name="darkmagenta">ff8b008b</color>
+       <color name="darkolivegreen">ff556b2f</color>
+       <color name="darkorange">ffff8c00</color>
+       <color name="darkorchid">ff9932cc</color>
+       <color name="darkred">ff8b0000</color>
+       <color name="darksalmon">ffe9967a</color>
+       <color name="darkseagreen">ff8fbc8f</color>
+       <color name="darkslateblue">ff483d8b</color>
+       <color name="darkslategray">ff2f4f4f</color>
+       <color name="darkturquoise">ff00ced1</color>
+       <color name="darkviolet">ff9400d3</color>
+       <color name="deeppink">ffff1493</color>
+       <color name="deepskyblue">ff00bfff</color>
+       <color name="dimgray">ff696969</color>
+       <color name="dodgerblue">ff1e90ff</color>
+       <color name="firebrick">ffb22222</color>
+       <color name="floralwhite">fffffaf0</color>
+       <color name="forestgreen">ff228b22</color>
+       <color name="fuchsia">ffff00ff</color>
+       <color name="gainsboro">ffdcdcdc</color>
+       <color name="ghostwhite">fff8f8ff</color>
+       <color name="gold">ffffd700</color>
+       <color name="goldenrod">ffdaa520</color>
+       <color name="gray">ff808080</color>
+       <color name="green">ff008000</color>
+       <color name="greenyellow">ffadff2f</color>
+       <color name="honeydew">fff0fff0</color>
+       <color name="hotpink">ffff69b4</color>
+       <color name="indianred ">ffcd5c5c</color>
+       <color name="indigo  ">ff4b0082</color>
+       <color name="ivory">fffffff0</color>
+       <color name="khaki">fff0e68c</color>
+       <color name="lavender">ffe6e6fa</color>
+       <color name="lavenderblush">fffff0f5</color>
+       <color name="lawngreen">ff7cfc00</color>
+       <color name="lemonchiffon">fffffacd</color>
+       <color name="lightblue">ffadd8e6</color>
+       <color name="lightcoral">fff08080</color>
+       <color name="lightcyan">ffe0ffff</color>
+       <color name="lightgoldenrodyellow">fffafad2</color>
+       <color name="lightgrey">ffd3d3d3</color>
+       <color name="lightgreen">ff90ee90</color>
+       <color name="lightpink">ffffb6c1</color>
+       <color name="lightsalmon">ffffa07a</color>
+       <color name="lightseagreen">ff20b2aa</color>
+       <color name="lightskyblue">ff87cefa</color>
+       <color name="lightslategray">ff778899</color>
+       <color name="lightsteelblue">ffb0c4de</color>
+       <color name="lightyellow">ffffffe0</color>
+       <color name="lime">ff00ff00</color>
+       <color name="limegreen">ff32cd32</color>
+       <color name="linen">fffaf0e6</color>
+       <color name="magenta">ffff00ff</color>
+       <color name="maroon">ff800000</color>
+       <color name="mediumaquamarine">ff66cdaa</color>
+       <color name="mediumblue">ff0000cd</color>
+       <color name="mediumorchid">ffba55d3</color>
+       <color name="mediumpurple">ff9370d8</color>
+       <color name="mediumseagreen">ff3cb371</color>
+       <color name="mediumslateblue">ff7b68ee</color>
+       <color name="mediumspringgreen">ff00fa9a</color>
+       <color name="mediumturquoise">ff48d1cc</color>
+       <color name="mediumvioletred">ffc71585</color>
+       <color name="midnightblue">ff191970</color>
+       <color name="mintcream">fff5fffa</color>
+       <color name="mistyrose">ffffe4e1</color>
+       <color name="moccasin">ffffe4b5</color>
+       <color name="navajowhite">ffffdead</color>
+       <color name="navy">ff000080</color>
+       <color name="oldlace">fffdf5e6</color>
+       <color name="olive">ff808000</color>
+       <color name="olivedrab">ff6b8e23</color>
+       <color name="orange">ffffa500</color>
+       <color name="orangered">ffff4500</color>
+       <color name="orchid">ffda70d6</color>
+       <color name="palegoldenrod">ffeee8aa</color>
+       <color name="palegreen">ff98fb98</color>
+       <color name="paleturquoise">ffafeeee</color>
+       <color name="palevioletred">ffd87093</color>
+       <color name="papayawhip">ffffefd5</color>
+       <color name="peachpuff">ffffdab9</color>
+       <color name="peru">ffcd853f</color>
+       <color name="pink">ffffc0cb</color>
+       <color name="plum">ffdda0dd</color>
+       <color name="powderblue">ffb0e0e6</color>
+       <color name="purple">ff800080</color>
+       <color name="red">ffff0000</color>
+       <color name="rosybrown">ffbc8f8f</color>
+       <color name="royalblue">ff4169e1</color>
+       <color name="saddlebrown">ff8b4513</color>
+       <color name="salmon">fffa8072</color>
+       <color name="sandybrown">fff4a460</color>
+       <color name="seagreen">ff2e8b57</color>
+       <color name="seashell">fffff5ee</color>
+       <color name="sienna">ffa0522d</color>
+       <color name="silver">ffc0c0c0</color>
+       <color name="skyblue">ff87ceeb</color>
+       <color name="slateblue">ff6a5acd</color>
+       <color name="slategray">ff708090</color>
+       <color name="snow">fffffafa</color>
+       <color name="springgreen">ff00ff7f</color>
+       <color name="steelblue">ff4682b4</color>
+       <color name="tan">ffd2b48c</color>
+       <color name="teal">ff008080</color>
+       <color name="thistle">ffd8bfd8</color>
+       <color name="tomato">ffff6347</color>
+       <color name="turquoise">ff40e0d0</color>
+       <color name="violet">ffee82ee</color>
+       <color name="wheat">fff5deb3</color>
+       <color name="white">ffffffff</color>
+       <color name="whitesmoke">fff5f5f5</color>
+       <color name="yellow">ffffff00</color>
+       <color name="yellowgreen">ff9acd32</color>
+</colors>
index b60c188..191d3a3 100644 (file)
-/*\r
- *      Copyright (C) 2005-2008 Team XBMC\r
- *      http://www.xbmc.org\r
- *\r
- *  This Program is free software; you can redistribute it and/or modify\r
- *  it under the terms of the GNU General Public License as published by\r
- *  the Free Software Foundation; either version 2, or (at your option)\r
- *  any later version.\r
- *\r
- *  This Program is distributed in the hope that it will be useful,\r
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- *  GNU General Public License for more details.\r
- *\r
- *  You should have received a copy of the GNU General Public License\r
- *  along with XBMC; see the file COPYING.  If not, write to\r
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.\r
- *  http://www.gnu.org/copyleft/gpl.html\r
- *\r
- */\r
-\r
-#include "SamiTagConvertor.h"\r
-#include "DVDCodecs/Overlay/DVDOverlayText.h"\r
-#include "utils/RegExp.h"\r
-\r
-SamiTagConvertor::~SamiTagConvertor()\r
-{\r
-  if (m_tags)\r
-    delete m_tags;\r
-  if (m_tagOptions)\r
-    delete m_tagOptions;\r
-}\r
-\r
-bool SamiTagConvertor::Init()\r
-{\r
-  m_tags = new CRegExp(true);\r
-  if (!m_tags->RegComp("(<[^>]*>)"))\r
-    return false;\r
-\r
-  m_tagOptions = new CRegExp(true);\r
-  if (!m_tagOptions->RegComp("([a-z]+)[ \t]*=[ \t]*(?:[\"'])?([^\"'> ]+)(?:[\"'])?(?:>)?"))\r
-    return false;\r
-\r
-  return true;\r
-}\r
-\r
-void SamiTagConvertor::ConvertLine(CDVDOverlayText* pOverlay, const char* line, int len)\r
-{\r
-  CStdStringA strUTF8;\r
-  strUTF8.assign(line, len);\r
-  strUTF8.Replace("\n", "");\r
-\r
-  int pos = 0;\r
-  while ((pos=m_tags->RegFind(strUTF8.c_str(), pos)) >= 0)\r
-  {\r
-    // Parse Tags\r
-    CStdString fullTag = m_tags->GetMatch(0);\r
-    fullTag.ToLower();\r
-    strUTF8.erase(pos, fullTag.length());\r
-    if (fullTag == "<b>")\r
-    {\r
-      tag_flag[0] = true;\r
-      strUTF8.insert(pos, "[B]");\r
-      pos += 3;\r
-    }\r
-    else if (fullTag == "</b>" && tag_flag[0])\r
-    {\r
-      tag_flag[0] = false;\r
-      strUTF8.insert(pos, "[/B]");\r
-      pos += 4;\r
-    }\r
-    else if (fullTag == "<i>")\r
-    {\r
-      tag_flag[1] = true;\r
-      strUTF8.insert(pos, "[I]");\r
-      pos += 3;\r
-    }\r
-    else if (fullTag == "</i>" && tag_flag[1])\r
-    {\r
-      tag_flag[1] = false;\r
-      strUTF8.insert(pos, "[/I]");\r
-      pos += 4;\r
-    }\r
-    else if (fullTag == "</font>" && tag_flag[2])\r
-    {\r
-      tag_flag[2] = false;\r
-      strUTF8.insert(pos, "[/COLOR]");\r
-      pos += 8;\r
-    }\r
-    else if (fullTag.Left(5) == "<font")\r
-    {\r
-      int pos2 = 5;\r
-      while ((pos2 = m_tagOptions->RegFind(fullTag.c_str(), pos2)) >= 0)\r
-      {\r
-        CStdString tagOptionName = m_tagOptions->GetMatch(1);\r
-        CStdString tagOptionValue = m_tagOptions->GetMatch(2);\r
-        pos2 += tagOptionName.length() + tagOptionValue.length();\r
-        if (tagOptionName == "color")\r
-        {\r
-          tag_flag[2] = true;\r
-          CStdString tempColorTag = "[COLOR ";\r
-          if (tagOptionValue[0] == '#')\r
-          {\r
-            tagOptionValue.erase(0, 1);\r
-            tempColorTag += "FF";\r
-          }\r
-          tempColorTag += tagOptionValue;\r
-          tempColorTag += "]";\r
-          strUTF8.insert(pos, tempColorTag);\r
-          pos += tempColorTag.length();\r
-        }\r
-      }\r
-    }\r
-  }\r
-\r
-  if (strUTF8.IsEmpty())\r
-    return;\r
-  // add a new text element to our container\r
-  pOverlay->AddElement(new CDVDOverlayText::CElementText(strUTF8.c_str()));\r
-}\r
-\r
-void SamiTagConvertor::CloseTag(CDVDOverlayText* pOverlay)\r
-{\r
-  if (tag_flag[0])\r
-  {\r
-    pOverlay->AddElement(new CDVDOverlayText::CElementText("[/B]"));\r
-    tag_flag[0] = false;\r
-  }\r
-  if (tag_flag[1])\r
-  {\r
-    pOverlay->AddElement(new CDVDOverlayText::CElementText("[/I]"));\r
-    tag_flag[1] = false;\r
-  }\r
-  if (tag_flag[2])\r
-  {\r
-    pOverlay->AddElement(new CDVDOverlayText::CElementText("[/COLOR]"));\r
-    tag_flag[2] = false;\r
-  }\r
-}\r
+/*
+ *      Copyright (C) 2005-2008 Team XBMC
+ *      http://www.xbmc.org
+ *
+ *  This Program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This Program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with XBMC; see the file COPYING.  If not, write to
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "SamiTagConvertor.h"
+#include "DVDCodecs/Overlay/DVDOverlayText.h"
+#include "utils/RegExp.h"
+
+SamiTagConvertor::~SamiTagConvertor()
+{
+  if (m_tags)
+    delete m_tags;
+  if (m_tagOptions)
+    delete m_tagOptions;
+}
+
+bool SamiTagConvertor::Init()
+{
+  m_tags = new CRegExp(true);
+  if (!m_tags->RegComp("(<[^>]*>)"))
+    return false;
+
+  m_tagOptions = new CRegExp(true);
+  if (!m_tagOptions->RegComp("([a-z]+)[ \t]*=[ \t]*(?:[\"'])?([^\"'> ]+)(?:[\"'])?(?:>)?"))
+    return false;
+
+  return true;
+}
+
+void SamiTagConvertor::ConvertLine(CDVDOverlayText* pOverlay, const char* line, int len)
+{
+  CStdStringA strUTF8;
+  strUTF8.assign(line, len);
+  strUTF8.Replace("\n", "");
+
+  int pos = 0;
+  while ((pos=m_tags->RegFind(strUTF8.c_str(), pos)) >= 0)
+  {
+    // Parse Tags
+    CStdString fullTag = m_tags->GetMatch(0);
+    fullTag.ToLower();
+    strUTF8.erase(pos, fullTag.length());
+    if (fullTag == "<b>")
+    {
+      tag_flag[0] = true;
+      strUTF8.insert(pos, "[B]");
+      pos += 3;
+    }
+    else if (fullTag == "</b>" && tag_flag[0])
+    {
+      tag_flag[0] = false;
+      strUTF8.insert(pos, "[/B]");
+      pos += 4;
+    }
+    else if (fullTag == "<i>")
+    {
+      tag_flag[1] = true;
+      strUTF8.insert(pos, "[I]");
+      pos += 3;
+    }
+    else if (fullTag == "</i>" && tag_flag[1])
+    {
+      tag_flag[1] = false;
+      strUTF8.insert(pos, "[/I]");
+      pos += 4;
+    }
+    else if (fullTag == "</font>" && tag_flag[2])
+    {
+      tag_flag[2] = false;
+      strUTF8.insert(pos, "[/COLOR]");
+      pos += 8;
+    }
+    else if (fullTag.Left(5) == "<font")
+    {
+      int pos2 = 5;
+      while ((pos2 = m_tagOptions->RegFind(fullTag.c_str(), pos2)) >= 0)
+      {
+        CStdString tagOptionName = m_tagOptions->GetMatch(1);
+        CStdString tagOptionValue = m_tagOptions->GetMatch(2);
+        pos2 += tagOptionName.length() + tagOptionValue.length();
+        if (tagOptionName == "color")
+        {
+          tag_flag[2] = true;
+          CStdString tempColorTag = "[COLOR ";
+          if (tagOptionValue[0] == '#')
+          {
+            tagOptionValue.erase(0, 1);
+            tempColorTag += "FF";
+          }
+          tempColorTag += tagOptionValue;
+          tempColorTag += "]";
+          strUTF8.insert(pos, tempColorTag);
+          pos += tempColorTag.length();
+        }
+      }
+    }
+  }
+
+  if (strUTF8.IsEmpty())
+    return;
+  // add a new text element to our container
+  pOverlay->AddElement(new CDVDOverlayText::CElementText(strUTF8.c_str()));
+}
+
+void SamiTagConvertor::CloseTag(CDVDOverlayText* pOverlay)
+{
+  if (tag_flag[0])
+  {
+    pOverlay->AddElement(new CDVDOverlayText::CElementText("[/B]"));
+    tag_flag[0] = false;
+  }
+  if (tag_flag[1])
+  {
+    pOverlay->AddElement(new CDVDOverlayText::CElementText("[/I]"));
+    tag_flag[1] = false;
+  }
+  if (tag_flag[2])
+  {
+    pOverlay->AddElement(new CDVDOverlayText::CElementText("[/COLOR]"));
+    tag_flag[2] = false;
+  }
+}
index 00bf9cc..532dd3f 100644 (file)
@@ -1,48 +1,48 @@
-#pragma once\r
-\r
-/*\r
- *      Copyright (C) 2005-2008 Team XBMC\r
- *      http://www.xbmc.org\r
- *\r
- *  This Program is free software; you can redistribute it and/or modify\r
- *  it under the terms of the GNU General Public License as published by\r
- *  the Free Software Foundation; either version 2, or (at your option)\r
- *  any later version.\r
- *\r
- *  This Program is distributed in the hope that it will be useful,\r
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- *  GNU General Public License for more details.\r
- *\r
- *  You should have received a copy of the GNU General Public License\r
- *  along with XBMC; see the file COPYING.  If not, write to\r
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.\r
- *  http://www.gnu.org/copyleft/gpl.html\r
- *\r
- */\r
-#include <stdio.h>\r
-\r
-class CDVDOverlayText;\r
-class CRegExp;\r
-\r
-class SamiTagConvertor\r
-{\r
-public:\r
-  SamiTagConvertor()\r
-  {\r
-    m_tags = NULL;\r
-    m_tagOptions = NULL;\r
-    tag_flag[0] = false;\r
-    tag_flag[1] = false;\r
-    tag_flag[2] = false;\r
-  }\r
-  virtual ~SamiTagConvertor();\r
-  bool Init();\r
-  void ConvertLine(CDVDOverlayText* pOverlay, const char* line, int len);\r
-  void CloseTag(CDVDOverlayText* pOverlay);\r
-\r
-private:\r
-  CRegExp *m_tags;\r
-  CRegExp *m_tagOptions;\r
-  bool tag_flag[3];\r
-};\r
+#pragma once
+
+/*
+ *      Copyright (C) 2005-2008 Team XBMC
+ *      http://www.xbmc.org
+ *
+ *  This Program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This Program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with XBMC; see the file COPYING.  If not, write to
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+#include <stdio.h>
+
+class CDVDOverlayText;
+class CRegExp;
+
+class SamiTagConvertor
+{
+public:
+  SamiTagConvertor()
+  {
+    m_tags = NULL;
+    m_tagOptions = NULL;
+    tag_flag[0] = false;
+    tag_flag[1] = false;
+    tag_flag[2] = false;
+  }
+  virtual ~SamiTagConvertor();
+  bool Init();
+  void ConvertLine(CDVDOverlayText* pOverlay, const char* line, int len);
+  void CloseTag(CDVDOverlayText* pOverlay);
+
+private:
+  CRegExp *m_tags;
+  CRegExp *m_tagOptions;
+  bool tag_flag[3];
+};