本文整理汇总了C++中taglib::Tag::grouping方法的典型用法代码示例。如果您正苦于以下问题:C++ Tag::grouping方法的具体用法?C++ Tag::grouping怎么用?C++ Tag::grouping使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类taglib::Tag
的用法示例。
在下文中一共展示了Tag::grouping方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
for(int i = 1; i < argc; i++) {
cout << "******************** \"" << argv[i] << "\" ********************" << endl;
TagLib::FileRef f(argv[i]);
if(!f.isNull() && f.tag()) {
TagLib::Tag *tag = f.tag();
cout << "-- TAG --" << endl;
cout << "title - \"" << tag->title() << "\"" << endl;
cout << "artist - \"" << tag->artist() << "\"" << endl;
cout << "album artist - \"" << tag->albumArtist() << "\"" << endl;
cout << "album - \"" << tag->album() << "\"" << endl;
cout << "year - \"" << tag->year() << "\"" << endl;
cout << "comment - \"" << tag->comment() << "\"" << endl;
cout << "track - \"" << tag->track() << "\"" << endl;
cout << "genre - \"" << tag->genre() << "\"" << endl;
cout << "grouping - \"" << tag->grouping() << "\"" << endl;
TagLib::Ogg::XiphComment *comment = NULL;
TagLib::FLAC::File *flac = dynamic_cast<TagLib::FLAC::File *>(f.file());
if (flac) {
cout << "flac:" << endl;
cout << "id3v1 - \"" << flac->ID3v1Tag() << "\"" << endl;
cout << "id3v2 - \"" << flac->ID3v2Tag() << "\"" << endl;
cout << "xiph - \"" << flac->xiphComment() << "\"" << endl;
comment = flac->xiphComment();
}
if (!comment) {
comment = dynamic_cast<TagLib::Ogg::XiphComment *>(tag);
}
if (comment) {
TagLib::Ogg::FieldListMap fields = comment->fieldListMap();
for(TagLib::Ogg::FieldListMap::ConstIterator it = fields.begin(), end = fields.end(); it != end; it++) {
if (!it->second.isEmpty())
cout << "xiph:" << it->first << " \"" << it->second[0].substr(0,3) << "\"" << endl;
}
}
cout << "pictures- \"" << f.file()->pictures().size() << "\"" << endl;
TagLib::File::PictureList l = f.file()->pictures();
for (TagLib::File::_PictureList::ConstIterator i = l.begin(), end = l.end(); i != end; i++) {
cout << "\t" << (*i)->typeName() << ' ' << (*i)->mimeType() << ' ' << (*i)->base64data().size() << endl;
}
cout << "pictures- \"" << tag->pictures().size() << "\"" << endl;
}
if(!f.isNull() && f.audioProperties()) {
TagLib::AudioProperties *properties = f.audioProperties();
int seconds = properties->length() % 60;
int minutes = (properties->length() - seconds) / 60;
cout << "-- AUDIO --" << endl;
cout << "bitrate - " << properties->bitrate() << endl;
cout << "sample rate - " << properties->sampleRate() << endl;
cout << "channels - " << properties->channels() << endl;
cout << "length - " << minutes << ":" << formatSeconds(seconds) << endl;
}
}
return 0;
}