Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Any good C++ programmers? (Read 2670 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Any good C++ programmers?

Hi,

I am trying to read all the ID3 Tag's from a specific loaction (i.e a
CD containg .mp3 files)

I know how to read a single file's mp3 Tag and display the contents but I want to know how to do this for every track on the CD.

i.e. repeat the code below on every track on the CD

Can anyone help me with this?

I presume some iterative loop could be used, but I am unsure how to tackle it.

Thanks for your time,

winsocker

P.S If your really bored you can have a look at my code (BCB)



ID3Tag ID3;

// TRUE if ID3 tag present
BOOL TAG_PRESENT = FALSE;

// char string used to compare “TAG“ string
char tag[4]={0,0,0,0}; //should contain 'TAG' if it exists

// open a file for reading
FILE *InFileTmp=fopen("File.mp3", "rb");

// seek to last 128 bytes
fseek( InFileTmp, -128, SEEK_END);

// read into ID3 struct
fread((void*)&ID3, 1, sizeof(ID3), InFileTmp);

// reading Tag-Info - the first 3 bytes of ID3 should be ‘TAG’
tag[0]=ID3.Tag[0];
tag[1]=ID3.Tag[1];
tag[2]=ID3.Tag[2];

if (!strcmp(tag,"TAG")) TAG_PRESENT = TRUE;
else TAG_PRESENT = FALSE;

if(TAG_PRESENT)
{
txttitle->Text = ID3.Title; // edit boxes used to display retrieved ID3 Information
txtartist->Text = ID3.Artist;
txtalbum->Text = ID3.Album;
txtyear->Text = ID3.Year;
txtcomment->Text = ID3.Comment;

{
char Tag[3];
char Title[30];
char Artist[30];
char Album[30];
char Year[4];
char Comment[30];
BYTE Genre; // an integer which corresponds to a particular genre of music
} ID3Tag;