/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ //#include #include //#include "functions.c" struct tagInfo{ int mode; int cbr; int bitrate; unsigned int freq; char *artist; char *title; char *album; char *comment; char *genre; //int genre; //int track; }; static int RATES[2][3][15]={ {//mpeg2 {-1,8,16,24,32,64,80,56,64,128,160,112,128,256,320},//layer3 (V2) {-1,32,48,56,64,80,96,112,128,160,192,224,256,320,384},//layer2 (V2) {-1,32,64,96,128,160,192,224,256,288,320,352,384,416,448},//layer1 (V2) }, {//mpeg1 {-1,32,40,48,56,64,80,96,112,128,160,192,224,256,320},//layer3 (V1) {-1,32,48,56,64,80,96,112,128,160,192,224,256,320,384},//layer2 (V1) {-1,32,64,96,128,160,192,224,256,288,320,352,384,416,448},//layer1 (V1) }}; static int FREQS[2][4]={{22050,24000,16000,-1},{44100,48000,32000,-1}}; //static double FRATES[]={38.5,32.5,27.8,0.0}; static char GENRES[][50]={"Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop","Jazz","Metal", "New Age","Oldies","Other","Pop","R&B","Rap","Reggae","Rock","Techno","Industrial", "Alternative","Ska","Death Metal","Pranks","Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk", "Fusion","Trance","Classical","Instrumental","Acid","House","Game","Sound Clip","Gospel","Noise", "AlternRock","Bass","Soul","Punk","Space","Meditative","Instrumental Pop","Instrumental Rock","Ethnic","Gothic", "Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance","Dream","Southern Rock","Comedy","Cult","Gangsta", "Top 40","Christian Rap","Pop/Funk","Jungle","Native American","Cabaret","New Wave","Psychadelic","Rave","Showtunes", "Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz","Polka","Retro","Musical","Rock & Roll","Hard Rock", //################## END OF OFFICIAL ID3 TAGS, WINAMP TAGS BELOW ######################################## "Folk","Folk/Rock","National Folk","Swing","Fast Fusion","Bebob","Latin","Revival","Celtic","Bluegrass", "Avantgarde","Gothic Rock","Progressive Rock","Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band","Chorus","Easy Listening","Acoustic", "Humour","Speech","Chanson","Opera","Chamber Music","Sonata","Symphony","Booty Bass","Primus","Porn Groove", "Satire","Slow Jam","Club","Tango","Samba","Folklore","Ballad","Poweer Ballad","Rhytmic Soul","Freestyle", "Duet","Punk Rock","Drum Solo","A Capela","Euro-House","Dance Hall", //################## FOUND AT http://en.wikipedia.org/wiki/ID3 ########################################### "Goa","Drum & Bass","Club-House","Hardcore", "Terror","Indie","BritPop","Negerpunk","Polsk Punk","Beat","Christian Gangsta Rap","Heavy Metal","Black Metal","Crossover", "Contemporary Christian","Christian Rock","Merengue","Salsa","Thrash Metal","Anime","JPop","Synthpop" }; static char MODES [][13]={"Stereo","Joint-Stereo","Dual-Channel","Mono"}; int iPow(int x, int y){return (int)(pow((double)x,(double) y));} int str2int(char *text) { int ret = 0; size_t i; for (i = 1; i <= strlen(text); i++) { if ((text[strlen(text) - i] > 57) || (text[strlen(text) - i] < 48)) { hexchat_printf(ph, "invalid char in string: %i", (int) text[strlen(text) - i]); return 255; } re
void plugingui_open (void);
void plugingui_load (void);
layerB, bitrateB, freqB, modeB); //int Bitrate=RATES[versionB][layerB-1][bitrateB]; //int Freq=FREQS[versionB][freqB]; info.bitrate=RATES[versionB][layerB-1][bitrateB]; info.freq=FREQS[versionB][freqB]; info.mode=modeB; } fclose(f); //if (DEBUG==1) putlog("header readed"); return info; } /* static void printMp3Info(char *file){ //printf("\nScanning Mp3-File for Informations: %s\n",file); //printf("size:\t%10d byte\n",getSize(file)); struct tagInfo info =readHeader(file); printf("%s | %10d",file,getSize(file)); if (info.bitrate>0){ //printf("Bitrate: %i\nFreq: %i\nMode: %s\n",info.bitrate,info.freq,MODES[info.mode]); printf(" | %i kbps | %i kHz | %s",info.bitrate,info.freq,MODES[info.mode]); //if (info.artist!=NULL) printf("\nArtist: %s\nTitle: %s\nAlbum: %s\nComment: %s\nGenre: %s\n",info.artist,info.title,info.album,info.comment,info.genre); if (info.artist!=NULL) { printf("| %s | %s | %s | %s | %s",info.artist,info.title,info.album,info.comment,info.genre); //printf("| %s ",info.title);//,info.title,info.album,info.comment,info.genre } } printf("\n"); } */