Created
September 25, 2014 20:52
-
-
Save scotchi/2291f29328a75dfd911f to your computer and use it in GitHub Desktop.
Example of how to pull the raw data out a deprecated frame type with TagLib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <mpegfile.h> | |
#include <id3v2tag.h> | |
#include <unknownframe.h> | |
int main(int argc, char *argv[]) | |
{ | |
for(int i = 1; i < argc; i++) | |
{ | |
TagLib::MPEG::File f(argv[i]); | |
TagLib::ID3v2::Tag *t = f.ID3v2Tag(false); | |
if(!t) | |
continue; | |
TagLib::ID3v2::UnknownFrame *tdat = | |
dynamic_cast<TagLib::ID3v2::UnknownFrame *>(t->frameList("TDAT").front()); | |
if(!tdat) | |
continue; | |
TagLib::String date(tdat->data().mid(1), TagLib::String::Type(tdat->data()[0])); | |
std::cout << date << std::endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment