]> granicus.if.org Git - taglib/commitdiff
Fix USLT frame creation in Frame::createTextualFrame()
authorMichael Helmling <helmling@mathematik.uni-kl.de>
Sun, 26 Feb 2012 09:43:08 +0000 (10:43 +0100)
committerMichael Helmling <helmling@mathematik.uni-kl.de>
Sun, 26 Feb 2012 09:43:08 +0000 (10:43 +0100)
taglib/mpeg/id3v2/id3v2frame.cpp
taglib/mpeg/id3v2/id3v2frame.h

index 16b02d554f52a2b26ea77f49e034d5a7c2c9f180..be566ca1a44ed46ef8b84ca6dc37ea1a8195d429 100644 (file)
@@ -102,6 +102,7 @@ ByteVector Frame::textDelimiter(String::Type t)
 
 const String Frame::instrumentPrefix("PERFORMER:");
 const String Frame::commentPrefix("COMMENT:");
+const String Frame::lyricsPrefix("LYRICS:");
 const String Frame::urlPrefix("URL:");
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -125,8 +126,9 @@ Frame *Frame::createTextualFrame(const String &key, const StringList &values) //
   }
   // now we check if it's one of the "special" cases:
   // -LYRICS: depending on the number of values, use USLT or TXXX (with description=LYRICS)
-  if(key == "LYRICS" && values.size() == 1){
+  if((key == "LYRICS" || key.startsWith(lyricsPrefix)) && values.size() == 1){
     UnsynchronizedLyricsFrame *frame = new UnsynchronizedLyricsFrame();
+    frame->setDescription(key == "LYRICS" ? key : key.substr(lyricsPrefix.size()));
     frame->setText(values.front());
     return frame;
   }
index 3a9ade267f2e9ead63984ca69a770253fef206dd..95c4070b4fd4d9ba5c895265a9ac9455636ad6e8 100644 (file)
@@ -146,6 +146,11 @@ namespace TagLib {
        * frame for a non-standard key. In the current implementation, this is "COMMENT:".
        */
       static const String commentPrefix;
+      /*!
+       * The PropertyMap key prefix which triggers the use of a USLT frame instead of a TXXX
+       * frame for a non-standard key. In the current implementation, this is "LYRICS:".
+       */
+      static const String lyricsPrefix;
       /*!
        * The PropertyMap key prefix which triggers the use of a WXXX frame instead of a TXX
        * frame for a non-standard key. In the current implementation, this is "URL:".