mirror of
https://github.com/taglib/taglib.git
synced 2025-09-12 16:24:18 -04:00
Fix USLT frame creation in Frame::createTextualFrame()
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
@ -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:".
|
||||
|
Reference in New Issue
Block a user