This is how you would look through the folder and rename them:
Code:
#include <iostream>
#include <fstream>
#include <windows.h>
#include <direct.h>
using namespace std;
void DoSomethingWithMP3S(string fileName)
{
// Do something with MP3's
cout << fileName << endl;
}
int main()
{
HANDLE hFind;
WIN32_FIND_DATA FindData;
hFind = FindFirstFile ("C:\\My Folder\\*.mp3", &FindData); // The *.mp3 tells it search for all files with the extension mp3
DoSomethingWithMP3S(FindData.cFileName);
while (FindNextFile(hFind, &FindData))
{
DoSomethingWithMP3S(FindData.cFileName);
}
}
I agree with CornedBee about id3lib. I had a lot of trouble before getting it to work, so I'll try and help you:
1. Go to downloads, download Windows binaries and id3lib. That's what you want.
2. Next, put the extract the id3lib folder somewhere, and put the .lib and .dll files in the folder with your program.
3. Include the folder \id3lib-3.8.3\include and \id3lib-3.8.3\include\id3 to your project.
4. Add #include <id3/tag.h> to the top of your project.
5. Lastly, link the id3lib.lib to your project, either through the settings or like this: #pragma comment(lib, "id3lib.lib")
I think that's everything I did to make it work, I hope this helps because I spent hours trying to figure out how to do this.