Add support for displaying lyrics from a Vorbis comment (#5495)
* Added support for displaying lyrics from Vorbis Comments. * Fixed style issues
This commit is contained in:
parent
e5ab3e786f
commit
622a3e478a
|
@ -568,6 +568,11 @@ void TagReader::ParseOggTag(const TagLib::Ogg::FieldListMap& map,
|
||||||
.trimmed()
|
.trimmed()
|
||||||
.toFloat() *
|
.toFloat() *
|
||||||
100);
|
100);
|
||||||
|
|
||||||
|
if (!map["LYRICS"].isEmpty())
|
||||||
|
Decode(map["LYRICS"].front(), codec, song->mutable_lyrics());
|
||||||
|
else if (!map["UNSYNCEDLYRICS"].isEmpty())
|
||||||
|
Decode(map["UNSYNCEDLYRICS"].front(), codec, song->mutable_lyrics());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TagReader::SetVorbisComments(
|
void TagReader::SetVorbisComments(
|
||||||
|
@ -593,9 +598,15 @@ void TagReader::SetVorbisComments(
|
||||||
true);
|
true);
|
||||||
|
|
||||||
// Try to be coherent, the two forms are used but the first one is preferred
|
// Try to be coherent, the two forms are used but the first one is preferred
|
||||||
|
|
||||||
vorbis_comments->addField("ALBUMARTIST",
|
vorbis_comments->addField("ALBUMARTIST",
|
||||||
StdStringToTaglibString(song.albumartist()), true);
|
StdStringToTaglibString(song.albumartist()), true);
|
||||||
vorbis_comments->removeField("ALBUM ARTIST");
|
vorbis_comments->removeField("ALBUM ARTIST");
|
||||||
|
|
||||||
|
vorbis_comments->addField("LYRICS",
|
||||||
|
StdStringToTaglibString(song.lyrics()), true);
|
||||||
|
vorbis_comments->removeField("UNSYNCEDLYRICS");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TagReader::SetFMPSStatisticsVorbisComments(
|
void TagReader::SetFMPSStatisticsVorbisComments(
|
||||||
|
|
|
@ -26,7 +26,7 @@ void TagLyricsInfoProvider::FetchInfo(int id, const Song& metadata) {
|
||||||
if (!lyrics.isEmpty()) {
|
if (!lyrics.isEmpty()) {
|
||||||
CollapsibleInfoPane::Data data;
|
CollapsibleInfoPane::Data data;
|
||||||
data.id_ = "tag/lyrics";
|
data.id_ = "tag/lyrics";
|
||||||
data.title_ = tr("Lyrics from the ID3v2 tag");
|
data.title_ = tr("Lyrics from the tag");
|
||||||
data.type_ = CollapsibleInfoPane::Data::Type_Lyrics;
|
data.type_ = CollapsibleInfoPane::Data::Type_Lyrics;
|
||||||
|
|
||||||
SongInfoTextView* editor = new SongInfoTextView;
|
SongInfoTextView* editor = new SongInfoTextView;
|
||||||
|
|
Loading…
Reference in New Issue