int main(int argc, char **argv) { if (argc != 2) { std::cout << "usage: " << argv[0] << " file.mp3" << std::endl; exit(1); } char *filename = argv[1]; Vorbis::File file(filename); Ogg::XiphComment *tag = file.tag(); tag->setTitle("Title"); tag->setArtist("Artist"); tag->setAlbum("Album"); tag->setComment("Comment"); tag->setGenre("Pop"); tag->setYear(2011); tag->setTrack(7); tag->addField("VERSION", "original"); tag->addField("PERFORMER", "Performer"); tag->addField("COPYRIGHT", "2011 Me, myself and I"); tag->addField("LICENSE", "Any Use Permitted"); tag->addField("ORGANIZATION", "Organization"); tag->addField("DESCRIPTION", "Test file"); tag->addField("LOCATION", "Earth"); tag->addField("CONTACT", "Contact"); tag->addField("MULTIPLE", "A"); tag->addField("MULTIPLE", "B", false); file.save(); }
void testSetTrack() { Ogg::XiphComment cmt; cmt.addField("TRACKNUM", "7"); cmt.addField("TRACKNUMBER", "8"); cmt.setTrack(3); CPPUNIT_ASSERT(cmt.fieldListMap()["TRACKNUM"].isEmpty()); CPPUNIT_ASSERT_EQUAL(String("3"), cmt.fieldListMap()["TRACKNUMBER"].front()); }