Skip to content

Instantly share code, notes, and snippets.

@jacobvosmaer
Last active August 29, 2015 13:57
Show Gist options
  • Save jacobvosmaer/9697549 to your computer and use it in GitHub Desktop.
Save jacobvosmaer/9697549 to your computer and use it in GitHub Desktop.
Reproducing TagLib 1.9.1 errors on OS X 10.9.2
#include <stdio.h>
#include <stdlib.h>
#include <taglib/tstringlist.h>
int main(int argc, char **argv) {
TagLib::StringList mylist;
mylist.append("one");
mylist.append("two");
mylist.append("three");
printf("expect: one two three\n");
printf("mylist.toString():\t%s\n", mylist.toString().toCString());
printf("mylist ConstIterator:\t");
for (TagLib::StringList::ConstIterator it = mylist.begin(); it != mylist.end(); it++) {
printf("%s ", it->toCString());
}
printf("\n");
}
LDFLAGS = -ltag
test: all
./enumeration_order
./mp4-loop mp4.m4a
all: mp4-loop enumeration_order
mp4-loop: mp4-loop.cpp
enumeration_order: enumeration_order.cpp
#include <stdio.h>
#include <taglib/taglib.h>
#include <taglib/mp4file.h>
using namespace TagLib;
int main(int argc, char **argv) {
if (argc != 2) {
printf("usage: %s file.m4a\n", argv[0]);
exit(1);
}
char *filename = argv[1];
MP4::File file(filename);
MP4::Tag *tag = file.tag();
MP4::ItemListMap item_list_map = tag->itemListMap();
for (MP4::ItemListMap::Iterator it = item_list_map.begin(); it != item_list_map.end(); it++) {
printf("item is %s: %s\n", ((it->second).isValid() ? "valid": "invalid"), it->first.toCString());
}
}
// vim: set filetype=cpp sw=2 ts=2 expandtab:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment