Пример #1
0
Файл: id3.c Проект: agranum/libv
int main()
{
	struct id3 id3;
	struct id3 tmp;
	
	strcpy(tmp.title, "Englishman in New York");
	strcpy(tmp.artist, "Sting");
	strcpy(tmp.album, "Album");
	strcpy(tmp.year, "Year");
	strcpy(tmp.comment, "Comment");
	tmp.genre = 24;
	tmp.track = 4;

	id3_write("sting.mp3", &tmp);
	id3_read("sting.mp3", &id3);
	id3_print(&id3);

	return(0);
}
Пример #2
0
bool CatalogueFile (const Fileinfo * finfo)
{
	ID3Tag  tag;
	bool    retval = true;

	if (mp3fGetAssume (&flags) || hasMP3Ext (fiGetFilename (finfo)))
	{
		const char *temp;
		bool    changedid3;

		id3_create (&tag);

		id3_read (&tag, fiGetFilename (finfo), ID3V1);
		changedid3 = id3_copyvals (&tag, &changetag);
		if (retval)
		{
			debug ("Artist: %s\n", id3_getArtist (&tag));
			debug ("Songname: %s\n", id3_getSongname (&tag));
			debug ("Album: %s\n", id3_getAlbum (&tag));
			debug ("Comment: %s\n", id3_getComment (&tag));
			debug ("Track: %d\n", (int) id3_getTrack (&tag));
		}

		if (changedid3)
		{
			debug ("Setting ID3 tag\n");
			if (!id3_write (&tag, fiGetFilename (finfo), ID3V1))
				debug ("Error writing id3 tag!! file: %s\n", fiGetFilename (finfo));
		}

		id3_destroy (&tag);

	}


	return true;
}