mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
Merge branch 'master' of ssh://bitbucket.org/smil3y/kde-extraapps
This commit is contained in:
commit
5d2f941cd4
1 changed files with 21 additions and 13 deletions
|
@ -65,6 +65,7 @@ bool ATCreator::create(const QString &path, int /*w*/, int /*h*/, QImage &img)
|
|||
if (type->is("audio/mpeg")) {
|
||||
TagLib::MPEG::File mp3File(path.toUtf8());
|
||||
TagLib::ID3v2::Tag *mp3Tag = mp3File.ID3v2Tag();
|
||||
|
||||
if (mp3Tag) {
|
||||
TagLib::ID3v2::FrameList fList = mp3Tag->frameList("APIC");
|
||||
TagLib::ID3v2::AttachedPictureFrame *pic = static_cast<TagLib::ID3v2::AttachedPictureFrame *>(fList.front());
|
||||
|
@ -87,10 +88,16 @@ bool ATCreator::create(const QString &path, int /*w*/, int /*h*/, QImage &img)
|
|||
}
|
||||
} else if (type->is("audio/mp4")) {
|
||||
TagLib::MP4::File mp4file(path.toUtf8());
|
||||
TagLib::MP4::Tag *tag = mp4file.tag();
|
||||
TagLib::MP4::ItemListMap map = tag->itemListMap();
|
||||
TagLib::MP4::Tag *mp4tag = mp4file.tag();
|
||||
|
||||
if (mp4tag) {
|
||||
#if TAGLIB_MAJOR_VERSION >= 2
|
||||
TagLib::MP4::ItemMap map = mp4tag->itemMap();
|
||||
for (TagLib::MP4::ItemMap::ConstIterator it = map.begin(); it != map.end(); ++it) {
|
||||
#else
|
||||
TagLib::MP4::ItemListMap map = mp4tag->itemListMap();
|
||||
for (TagLib::MP4::ItemListMap::ConstIterator it = map.begin(); it != map.end(); ++it) {
|
||||
#endif
|
||||
TagLib::MP4::CoverArtList coverList = (*it).second.toCoverArtList();
|
||||
if (!coverList.isEmpty()) {
|
||||
TagLib::MP4::CoverArt cover = coverList.front();
|
||||
|
@ -100,12 +107,13 @@ bool ATCreator::create(const QString &path, int /*w*/, int /*h*/, QImage &img)
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (type->is("audio/x-vorbis+ogg") || type->is("audio/ogg")) {
|
||||
TagLib::Ogg::Vorbis::File file(path.toUtf8());
|
||||
TagLib::Ogg::XiphComment *tag = file.tag();
|
||||
TagLib::Ogg::XiphComment *oggtag = file.tag();
|
||||
|
||||
if (tag) {
|
||||
TagLib::List<TagLib::FLAC::Picture*> picturelist = tag->pictureList();
|
||||
if (oggtag) {
|
||||
TagLib::List<TagLib::FLAC::Picture*> picturelist = oggtag->pictureList();
|
||||
for (int i = 0; i < picturelist.size(); i++) {
|
||||
// qDebug() << Q_FUNC_INFO << picturelist[i]->code();
|
||||
switch (picturelist[i]->code()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue