Deals with song/artist info inside of a music file. In the case of mp3, this means ID3 version 1 tags. For ogg vorbis, it means just grabbing this information out of the comments.
Included Files
- #include </usr/lib/gcc-lib/i486-pc-linux-gnu/3.2.3/include/stdio.h>
- #include </usr/include/stdlib.h>
- #include </usr/include/unistd.h>
- #include </usr/include/string.h>
char PROCNAME[128]
struct tm* CUR_TIME
ubs_table GLOBAL
int LOGLEVEL
Sees if any part of any tag in file2 is present in file1
int check_against_tags ( char* file1, char* file2 )
- int check_against_tags
- Returns YES if a match is found, FAIL if either get_media_tag() call is bad, or NO if no match is found
- char* file1
- File to check against
- char* file2
- File to check
Determines the type of file (mp3 or ogg are supported at the moment), and calls the appropriate function to grab the song information
int get_media_tag ( char* sname, struct media_tag* song_tag )
- int get_media_tag
- Returns value of get_mp3_tag()/get_ogg_tag() on success, FAIL if an unknown extension is given, FAIL if libvorbis isn't around and an ogg was given anyways
- char* sname
- The filename of the music file
- struct media_tag* song_tag
- The structure that will be filled in with the relevant information from the song's ID3 or vorbis tag
Gets information from an ID3 version 1 tag, which is the "old" mp3 tagging format. This is done by just opening up the file and reading the last 128 bytes.
int get_mp3_tag ( char* sname, struct media_tag* song_tag )
- int get_mp3_tag
- Returns OK on success, NO_FILE if the file can't be opened
- char* sname
- The song filename to scan
- struct media_tag* song_tag
- The structure to fill
Gets the song information from an ogg vorbis tag. This is done via the ogg vorbis libraries.
int get_ogg_tag ( char* sname, struct media_tag* song_tag )
- int get_ogg_tag
- Returns OK on success, NO_FILE if the file can't be opened
- char* sname
- The song filename to scan
- struct media_tag* song_tag
- The structure to write data to