Parse Filenames for extracting Tags
-
Hi everybody. I'm looking for a nice algo which I can use for parsing audio-files and extracting tags. The algo should have the possibility to define the structure of the filenames via a mask and wildcards. Several programmes make use of such a method, for example Tag&Rename: http://iserver.hta.fhz.ch/~iasummer/stuff/tagrename.gif I haven't found a good and free avaiable source code for parsing files like that, so any links or general information would be great!
-
Hi everybody. I'm looking for a nice algo which I can use for parsing audio-files and extracting tags. The algo should have the possibility to define the structure of the filenames via a mask and wildcards. Several programmes make use of such a method, for example Tag&Rename: http://iserver.hta.fhz.ch/~iasummer/stuff/tagrename.gif I haven't found a good and free avaiable source code for parsing files like that, so any links or general information would be great!
Are you wanting a masked edit control, or are you wanting to find files based on special characters (in addition to "*" and "?" which are already supported).
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
-
Are you wanting a masked edit control, or are you wanting to find files based on special characters (in addition to "*" and "?" which are already supported).
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
me think he want to do the following : for a filename like "01-Pink Floyd-The Dark Side Of The Moog-Money.mp3" he wants to extract the song number, artist, album and track name. basically, a sscan.
Maximilien Lincourt Your Head A Splode - Strong Bad
-
me think he want to do the following : for a filename like "01-Pink Floyd-The Dark Side Of The Moog-Money.mp3" he wants to extract the song number, artist, album and track name. basically, a sscan.
Maximilien Lincourt Your Head A Splode - Strong Bad
Maximilien wrote: basically, a sscan. I assume you mean
sscanf()
. If so, then something like the following would work:char *lp = "01-Pink Floyd-The Dark Side Of The Moog-Money.mp3",
szNumber[8], szArtist[16], szAlbum[32], szTrack[16];
sscanf(lp, "%[0-9]%*c%[^-]%*c%[^-]%*c%[^.]", szNumber, szArtist, szAlbum, szTrack);
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
-
Maximilien wrote: basically, a sscan. I assume you mean
sscanf()
. If so, then something like the following would work:char *lp = "01-Pink Floyd-The Dark Side Of The Moog-Money.mp3",
szNumber[8], szArtist[16], szAlbum[32], szTrack[16];
sscanf(lp, "%[0-9]%*c%[^-]%*c%[^-]%*c%[^.]", szNumber, szArtist, szAlbum, szTrack);
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
-
Maximilien wrote: basically, a sscan. I assume you mean
sscanf()
. If so, then something like the following would work:char *lp = "01-Pink Floyd-The Dark Side Of The Moog-Money.mp3",
szNumber[8], szArtist[16], szAlbum[32], szTrack[16];
sscanf(lp, "%[0-9]%*c%[^-]%*c%[^-]%*c%[^.]", szNumber, szArtist, szAlbum, szTrack);
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
Yeah, sscanf looks like the thing I need. I have to write a programme where the user can specify the structure of a file to get the tags from the filename. E.g. if you have an MP3 Files with the structure like this: "01-Pink Floyd-Dark Side Of The Moon_SPEAK TO ME.mp3" "02-Pink Floyd-Dark Side Of The Moon_breathe in the air.mp3" The user should have the possibility to enter the mask like this %t-%a_%s (or -_) the programme should now parse the filename and set the params for track album and song. I've seen a mask editor in several programmes (e.g. Tag&Rename). If you could provide me with some more codesamples, that would be great (I'm a newbie to C++). BTW, In a next step, our programme should analyze the filenames and suggest a mask by itself.