int main( int argc, char *argv[])
{
  ID3D_INIT_DOUT();
  ID3D_INIT_WARNING();
  ID3D_INIT_NOTICE();

  ID3_Tag tag;
  ID3_Frame frame;
  
  tag.Link("test-230-compressed.tag");
  tag.Strip(ID3TT_ALL);
  tag.Clear();
  
  frame.SetID(ID3FID_USERTEXT);
  frame.GetField(ID3FN_DESCRIPTION)->Set("compression example");
  frame.GetField(ID3FN_TEXT)->Set("This sample user text frame came from an ID3v2-3.0 tag.  The frame has the 'compression' bit set in it's frame header.  This is the new method for compressing frames, which supercedes the 2.01 Compressed Data Metaframe.");
  frame.SetCompression(true);
  tag.AddFrame(frame);
  
  tag.SetPadding(false);
  tag.SetUnsync(false);
  tag.Update(ID3TT_ID3V2);

  return 0;
}
Beispiel #2
0
int main(int argc, char ** argv) {
	if (argc != 2) {
		cout << "usage: " << argv[0] << " output.mp3" << endl;
		return 1;
	}

	const char * filename = argv[1];

	ID3_Tag tag;
	tag.Link(filename);

	AddTextFrame(tag, ID3FID_TITLE, "Dummy Title");
	AddTextFrame(tag, ID3FID_LEADARTIST, "Dummy Artist");
	AddTextFrame(tag, ID3FID_ALBUM, "Dummy Album");
	AddTextFrame(tag, ID3FID_TRACKNUM, "1/10");
	AddTextFrame(tag, ID3FID_YEAR, "2000");
	AddTextFrame(tag, ID3FID_COMMENT, "Dummy Comment");
	AddTextFrame(tag, ID3FID_COMMENT, "Dummy Comment 2");
	AddTextFrame(tag, ID3FID_CONTENTTYPE, "Pop");

	ID3_Frame userFrame(ID3FID_USERTEXT);
	userFrame.Field(ID3FN_DESCRIPTION).Set("MusicBrainz Album Id");
	userFrame.Field(ID3FN_TEXT).Set("992dc19a-5631-40f5-b252-fbfedbc328a9");
	tag.AddFrame(userFrame);
	
	tag.Update();
	return 0;
}
Beispiel #3
0
int main( int argc, char *argv[])
{
  ID3_Tag tag;
  ID3_Frame frame;
  
  tag.Link("test-230-unicode.tag");
  tag.Strip(ID3TT_ALL);
  tag.Clear();
  
  frame.SetID(ID3FID_USERTEXT);
  frame.GetField(ID3FN_DESCRIPTION)->Set("example text frame");
  frame.GetField(ID3FN_TEXT)->Set("This text and the description should be in Unicode.");
  frame.GetField(ID3FN_TEXTENC)->Set(ID3TE_UNICODE);
  tag.AddFrame(frame);
  
  tag.SetPadding(false);
  tag.SetUnsync(false);
  tag.Update(ID3TT_ID3V2);

  return 0;
}
Beispiel #4
0
void AddTextFrame( ID3_Tag & tag, ID3_FrameID frameid, char * text ) {
	ID3_Frame frame(frameid);
	frame.Field(ID3FN_TEXT).Set(text);
	tag.AddFrame(frame);
}
Beispiel #5
0
int main( int argc, char *argv[])
{
  ID3D_INIT_DOUT();
  ID3D_INIT_WARNING();
  ID3D_INIT_NOTICE();

  ID3_Tag tag;
  ID3_Frame frame;
  
  tag.Link("test-230-picture.tag");
  tag.Strip(ID3TT_ALL);
  tag.Clear();
  
  frame.SetID(ID3FID_TITLE);
  frame.GetField(ID3FN_TEXT)->Set("Aquarium");
  tag.AddFrame(frame);
  
  frame.SetID(ID3FID_CONTENTGROUP);
  frame.GetField(ID3FN_TEXT)->Set("Short fraction of 'Carnival of the Animals: A Grand Zoological Fantasy'");
  tag.AddFrame(frame);
  
  frame.SetID(ID3FID_COMPOSER);
  frame.GetField(ID3FN_TEXT)->Set("Camille Saint-Saëns");
  tag.AddFrame(frame);
  
  frame.SetID(ID3FID_BAND);
  frame.GetField(ID3FN_TEXT)->Set("Slovakia Radio Symphony Orchestra");
  tag.AddFrame(frame);
  
  frame.SetID(ID3FID_CONDUCTOR);
  frame.GetField(ID3FN_TEXT)->Set("Ondrej Lenárd");
  tag.AddFrame(frame);
  
  frame.SetID(ID3FID_COPYRIGHT);
  frame.GetField(ID3FN_TEXT)->Set("1996 HNH international Ltd.");
  tag.AddFrame(frame);
  
  frame.SetID(ID3FID_CONTENTTYPE);
  frame.GetField(ID3FN_TEXT)->Set("(32)");
  tag.AddFrame(frame);
  
  frame.SetID(ID3FID_INVOLVEDPEOPLE);
  frame.GetField(ID3FN_TEXT)->Add("Producer");
  frame.GetField(ID3FN_TEXT)->Add("Martin Sauer");
  frame.GetField(ID3FN_TEXT)->Add("Piano");
  frame.GetField(ID3FN_TEXT)->Add("Peter Toperczer");
  tag.AddFrame(frame);
  
  frame.SetID(ID3FID_PICTURE);
  frame.GetField(ID3FN_MIMETYPE)->Set("image/jpeg");
  frame.GetField(ID3FN_PICTURETYPE)->Set(11);
  frame.GetField(ID3FN_DESCRIPTION)->Set("B/W picture of Saint-Saëns");
  frame.GetField(ID3FN_DATA)->FromFile("composer.jpg");
  tag.AddFrame(frame);
  
  tag.SetPadding(false);
  tag.SetUnsync(true);
  tag.Update(ID3TT_ID3V2);

  return 0;
}
Beispiel #6
0
int main( int argc, char *argv[])
{
    ID3_Tag tag;
    ID3_Frame frame;

    if (argc == 2)
    {
        tag.Link(argv[1]);
        cerr << "removed " << RemoveFrame(tag, ID3FID_COMMENT, "") << " descriptionless comment frames" << endl;
        tag.Update();

    }
    else
    {
        tag.Link("test-remove.tag");
        tag.Strip(ID3TT_ALL);
        tag.Clear();

        frame.SetID(ID3FID_TITLE);
        frame.GetField(ID3FN_TEXT)->Set("Test title");
        tag.AddFrame(frame);

        frame.SetID(ID3FID_COMPOSER);
        frame.GetField(ID3FN_TEXT)->Set("Test composer");
        tag.AddFrame(frame);

        frame.SetID(ID3FID_BAND);
        frame.GetField(ID3FN_TEXT)->Set("Test band");
        tag.AddFrame(frame);

        frame.SetID(ID3FID_CONDUCTOR);
        frame.GetField(ID3FN_TEXT)->Set("Test conductor");
        tag.AddFrame(frame);

        frame.SetID(ID3FID_COMMENT);
        frame.GetField(ID3FN_LANGUAGE)->Set("eng");
        frame.GetField(ID3FN_TEXT)->Set("Test comment");
        frame.GetField(ID3FN_DESCRIPTION)->Set("A Description");
        tag.AddFrame(frame);

        frame.SetID(ID3FID_COMMENT);
        frame.GetField(ID3FN_LANGUAGE)->Set("eng");
        frame.GetField(ID3FN_TEXT)->Set("Test comment 2");
        frame.GetField(ID3FN_DESCRIPTION)->Set("");
        tag.AddFrame(frame);

        frame.SetID(ID3FID_COMMENT);
        frame.GetField(ID3FN_LANGUAGE)->Set("eng");
        frame.GetField(ID3FN_TEXT)->Set("ID3v1 comment text?");
        frame.GetField(ID3FN_DESCRIPTION)->Set(STR_V1_COMMENT_DESC);
        tag.AddFrame(frame);

        tag.SetPadding(false);
        tag.Update(ID3TT_ID3V2);

        cerr << "removed " << ID3_RemoveArtists(&tag) << " artist frames" << endl;
        tag.Update();
        cerr << "removed " << ID3_RemoveTitles(&tag) << " title frames" << endl;
        tag.Update();
        cerr << "removed " << RemoveFrame(tag, ID3FID_COMMENT, "") << " descriptionless comment frames" << endl;
        tag.Update();
    }

    return 0;
}