本文整理汇总了C++中taglib::id3v2::AttachedPictureFrame::description方法的典型用法代码示例。如果您正苦于以下问题:C++ AttachedPictureFrame::description方法的具体用法?C++ AttachedPictureFrame::description怎么用?C++ AttachedPictureFrame::description使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类taglib::id3v2::AttachedPictureFrame
的用法示例。
在下文中一共展示了AttachedPictureFrame::description方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
// Preference is TXXX frames, RVA2 frame, then LAME header
auto trackGainFrame = TagLib::ID3v2::UserTextIdentificationFrame::find(const_cast<TagLib::ID3v2::Tag *>(tag), "REPLAYGAIN_TRACK_GAIN");
auto trackPeakFrame = TagLib::ID3v2::UserTextIdentificationFrame::find(const_cast<TagLib::ID3v2::Tag *>(tag), "REPLAYGAIN_TRACK_PEAK");
auto albumGainFrame = TagLib::ID3v2::UserTextIdentificationFrame::find(const_cast<TagLib::ID3v2::Tag *>(tag), "REPLAYGAIN_ALBUM_GAIN");
auto albumPeakFrame = TagLib::ID3v2::UserTextIdentificationFrame::find(const_cast<TagLib::ID3v2::Tag *>(tag), "REPLAYGAIN_ALBUM_PEAK");
if(!trackGainFrame)
trackGainFrame = TagLib::ID3v2::UserTextIdentificationFrame::find(const_cast<TagLib::ID3v2::Tag *>(tag), "replaygain_track_gain");
if(trackGainFrame) {
SFB::CFString str(trackGainFrame->fieldList().back().toCString(true), kCFStringEncodingUTF8);
double num = CFStringGetDoubleValue(str);
AddDoubleToDictionary(dictionary, Metadata::kTrackGainKey, num);
AddDoubleToDictionary(dictionary, Metadata::kReferenceLoudnessKey, 89.0);
foundReplayGain = true;
}
if(!trackPeakFrame)
trackPeakFrame = TagLib::ID3v2::UserTextIdentificationFrame::find(const_cast<TagLib::ID3v2::Tag *>(tag), "replaygain_track_peak");
if(trackPeakFrame) {
SFB::CFString str(trackPeakFrame->fieldList().back().toCString(true), kCFStringEncodingUTF8);
double num = CFStringGetDoubleValue(str);
AddDoubleToDictionary(dictionary, Metadata::kTrackPeakKey, num);
}
if(!albumGainFrame)
albumGainFrame = TagLib::ID3v2::UserTextIdentificationFrame::find(const_cast<TagLib::ID3v2::Tag *>(tag), "replaygain_album_gain");
if(albumGainFrame) {
SFB::CFString str(albumGainFrame->fieldList().back().toCString(true), kCFStringEncodingUTF8);
double num = CFStringGetDoubleValue(str);
AddDoubleToDictionary(dictionary, Metadata::kAlbumGainKey, num);
AddDoubleToDictionary(dictionary, Metadata::kReferenceLoudnessKey, 89.0);
foundReplayGain = true;
}
if(!albumPeakFrame)
albumPeakFrame = TagLib::ID3v2::UserTextIdentificationFrame::find(const_cast<TagLib::ID3v2::Tag *>(tag), "replaygain_album_peak");
if(albumPeakFrame) {
SFB::CFString str(albumPeakFrame->fieldList().back().toCString(true), kCFStringEncodingUTF8);
double num = CFStringGetDoubleValue(str);
AddDoubleToDictionary(dictionary, Metadata::kAlbumPeakKey, num);
}
// If nothing found check for RVA2 frame
if(!foundReplayGain) {
frameList = tag->frameListMap()["RVA2"];
for(auto frameIterator : tag->frameListMap()["RVA2"]) {
TagLib::ID3v2::RelativeVolumeFrame *relativeVolume = dynamic_cast<TagLib::ID3v2::RelativeVolumeFrame *>(frameIterator);
if(!relativeVolume)
continue;
// Attempt to use the master volume if present
auto channels = relativeVolume->channels();
auto channelType = TagLib::ID3v2::RelativeVolumeFrame::MasterVolume;
// Fall back on whatever else exists in the frame
if(!channels.contains(TagLib::ID3v2::RelativeVolumeFrame::MasterVolume))
channelType = channels.front();
float volumeAdjustment = relativeVolume->volumeAdjustment(channelType);
if(TagLib::String("track", TagLib::String::Latin1) == relativeVolume->identification()) {
if((int)volumeAdjustment)
AddFloatToDictionary(dictionary, Metadata::kTrackGainKey, volumeAdjustment);
}
else if(TagLib::String("album", TagLib::String::Latin1) == relativeVolume->identification()) {
if((int)volumeAdjustment)
AddFloatToDictionary(dictionary, Metadata::kAlbumGainKey, volumeAdjustment);
}
// Fall back to track gain if identification is not specified
else {
if((int)volumeAdjustment)
AddFloatToDictionary(dictionary, Metadata::kTrackGainKey, volumeAdjustment);
}
}
}
// Extract album art if present
for(auto it : tag->frameListMap()["APIC"]) {
TagLib::ID3v2::AttachedPictureFrame *frame = dynamic_cast<TagLib::ID3v2::AttachedPictureFrame *>(it);
if(frame) {
SFB::CFData data((const UInt8 *)frame->picture().data(), (CFIndex)frame->picture().size());
SFB::CFString description;
if(!frame->description().isEmpty())
description = CFString(frame->description().toCString(true), kCFStringEncodingUTF8);
attachedPictures.push_back(std::make_shared<AttachedPicture>(data, (AttachedPicture::Type)frame->type(), description));
}
}
return true;
}
示例2: if
//.........这里部分代码省略.........
m_szTextWriter = QString::fromStdWString((*it)->toString().toWString());
else if(!szID.compare("TOLY"))
m_szOriginalTextWriter = QString::fromStdWString((*it)->toString().toWString());
else if(!szID.compare("TCOM"))
m_szComposer = QString::fromStdWString((*it)->toString().toWString());
else if(!szID.compare("TENC"))
m_szEncodedBy = QString::fromStdWString((*it)->toString().toWString());
else if(!szID.compare("TBPM"))
m_iBeatsPerMinute = QString::fromStdWString((*it)->toString().toWString()).toInt();
else if(!szID.compare("TLEN") && m_iLength == 0)
m_iLength = QString::fromStdWString((*it)->toString().toWString()).toInt();
else if(!szID.compare("TLAN"))
m_szLanguage = QString::fromStdWString((*it)->toString().toWString()).split("\r\n");
else if(!szID.compare("TCON"))
m_szContentType = QString::fromStdWString((*it)->toString().toWString()).split("\r\n");
else if(!szID.compare("TFLT"))
m_szFileType = QString::fromStdWString((*it)->toString().toWString());
else if(!szID.compare("TMED"))
m_szMediaType = QString::fromStdWString((*it)->toString().toWString()).split("\r\n");
else if(!szID.compare("TMOO"))
m_szMood = QString::fromStdWString((*it)->toString().toWString());
else if(!szID.compare("TCOP"))
m_szCopyright = QString::fromStdWString((*it)->toString().toWString());
else if(!szID.compare("TPRO"))
m_szProducedNotice = QString::fromStdWString((*it)->toString().toWString());
else if(!szID.compare("TPUB"))
m_szPublisher = QString::fromStdWString((*it)->toString().toWString());
else if(!szID.compare("TOWN"))
m_szFileOwner = QString::fromStdWString((*it)->toString().toWString());
else if(!szID.compare("TRSN"))
m_szInternetRadioStationName = QString::fromStdWString((*it)->toString().toWString());
else if(!szID.compare("TRSO"))
m_szInternetRadioStationOwner = QString::fromStdWString((*it)->toString().toWString());
else if(!szID.compare("TOFN"))
m_szOriginalFilename = QString::fromStdWString((*it)->toString().toWString());
else if(!szID.compare("TDLY"))
m_iPlaylistDelay = QString::fromStdWString((*it)->toString().toWString()).toInt();
else if(!szID.compare("TDEN"))
m_encodingTime = str2TS(QString::fromStdWString((*it)->toString().toWString()));
else if(!szID.compare("TDOR"))
m_originalReleaseTime = str2TS(QString::fromStdWString((*it)->toString().toWString()));
else if(!szID.compare("TDRC"))
m_recordingTime = str2TS(QString::fromStdWString((*it)->toString().toWString()));
else if(!szID.compare("TDRL"))
m_releaseTime = str2TS(QString::fromStdWString((*it)->toString().toWString()));
else if(!szID.compare("TDTG"))
m_taggingTime = str2TS(QString::fromStdWString((*it)->toString().toWString()));
else if(!szID.compare("TSSE"))
m_szswhwSettings = QString(QString::fromStdWString((*it)->toString().toWString())).split("\r\n");
else if(!szID.compare("TSOA"))
m_szAlbumSortOrder = QString::fromStdWString((*it)->toString().toWString());
else if(!szID.compare("TSOP"))
m_szPerformerSortOrder = QString::fromStdWString((*it)->toString().toWString());
else if(!szID.compare("TSOT"))
m_szTitleSortOrder = QString::fromStdWString((*it)->toString().toWString());
else if(!szID.compare("SYLT"))
{
TagLib::ID3v2::SynchronizedLyricsFrame* lpLyrics = static_cast<TagLib::ID3v2::SynchronizedLyricsFrame *> (*it);
m_szSynchronizedLyricsLanguage = QString(lpLyrics->language().data()).left(3);
String::Type type = lpLyrics->textEncoding();
m_szSynchronizedLyricsDescription = QString::fromStdWString(lpLyrics->description().toWString());
TagLib::ID3v2::SynchronizedLyricsFrame::SynchedTextList list = lpLyrics->synchedText();
for(ID3v2::SynchronizedLyricsFrame::SynchedTextList::ConstIterator it1 = list.begin(); it1 != list.end();it1++)
{
ID3v2::SynchronizedLyricsFrame::SynchedText t = *(it1);
m_szSynchronizedLyrics.add(t.time, QString::fromStdWString(t.text.toWString()));
}
}
else if(!szID.compare("USLT"))
{
TagLib::ID3v2::UnsynchronizedLyricsFrame* lpLyrics = static_cast<TagLib::ID3v2::UnsynchronizedLyricsFrame *> (*it);
m_szUnsynchronizedLyricsLanguage = QString(lpLyrics->language().data()).left(3);
String::Type type = lpLyrics->textEncoding();
m_szUnsynchronizedLyricsDescription = QString::fromStdWString(lpLyrics->description().toWString());
QString szText = QString::fromStdWString(lpLyrics->text().toWString());
if(szText.contains("\r\n"))
m_szUnsynchronizedLyrics = szText.split("\r\n");
else if(szText.contains("\r"))
m_szUnsynchronizedLyrics = szText.split("\r");
else if(szText.contains("\n"))
m_szUnsynchronizedLyrics = szText.split("\n");
else
m_szUnsynchronizedLyrics.append(szText);
}
else if(!szID.compare("APIC"))
{
TagLib::ID3v2::AttachedPictureFrame* lpPicture = static_cast<TagLib::ID3v2::AttachedPictureFrame *> (*it);
TagLib::ID3v2::AttachedPictureFrame::Type t = lpPicture->type();
QString szDescription;
szDescription = QString::fromStdWString(lpPicture->description().toWString());
QByteArray pictureData = QByteArray(lpPicture->picture().data(), lpPicture->picture().size());
m_pixmapList.add(pictureData, m_szFileName, (cPixmap::ImageType)t, szDescription);
}
}
}