Skip to content

Instantly share code, notes, and snippets.

@scotchi
Created September 25, 2014 20:52
Show Gist options
  • Save scotchi/2291f29328a75dfd911f to your computer and use it in GitHub Desktop.
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
#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