I`m doing this program that edits the mp3 tags, the thing is that it write the drirectory name as the Artist and the filename as the Song Title. So the program is working fine but at the moment to write it doesn´t work. Here is the code:
Code:
void __fastcall TForm1::DirectoryListBox1Change(TObject *Sender)
{
FileListBox1->Directory = DirectoryListBox1->Directory;
char buff[124];
char artist[30];
char name[30];
int i;
TSearchRec sr;
if (FindFirst(DirectoryListBox1->Directory + "\\\\*.mp3", faArchive, sr) == 0)
{
do
{
if ((sr.Attr & faArchive) == sr.Attr)
{
fstream stream(sr.Name.c_str(),ios::in | ios::out);
stream.seekg(sr.Size-125);
stream.getline(buff,124);
for(i=0;i<30;i++)
{
artist[i]='\0';
name[i]='\0';
}
strcpy(artist,Form1->DirectoryListBox1->Directory.c_str());
strcpy(name,sr.Name.c_str());
stream.seekg(sr.Size-125);
stream.write(artist,30);
stream.write(name,30);
stream.close();
}
} while (FindNext(sr) == 0);
FindClose(sr);
}
}
//---------------------------------------------------------------------------
Looking forward your awnser
Code tags added by Hammer
Disable Smilies in This Post by Salem