From e681eafa78262d0c177832d67900687f2c938081 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Tue, 30 Oct 2012 08:42:48 +0100 Subject: Rebranding for the rest of plugin* --- plugins/mpcinfo/functions.c | 2 +- plugins/mpcinfo/mp3Info.c | 46 ++++++++++++++++++++++----------------------- plugins/mpcinfo/mpcInfo.c | 40 +++++++++++++++++++-------------------- plugins/mpcinfo/mpcinfo.def | 4 ++-- plugins/mpcinfo/oggInfo.c | 2 +- plugins/mpcinfo/theme.c | 22 +++++++++++----------- 6 files changed, 58 insertions(+), 58 deletions(-) (limited to 'plugins/mpcinfo') diff --git a/plugins/mpcinfo/functions.c b/plugins/mpcinfo/functions.c index ed0632d4..ba6ba519 100644 --- a/plugins/mpcinfo/functions.c +++ b/plugins/mpcinfo/functions.c @@ -117,7 +117,7 @@ char *readLine(FILE *f){ else buffer[pos]=(char)cc;pos++; } } - if (buffer[pos]==EOF) xchat_printf(ph,"EOF: %i\n",pos); + if (buffer[pos]==EOF) hexchat_printf(ph,"EOF: %i\n",pos); return buffer; } diff --git a/plugins/mpcinfo/mp3Info.c b/plugins/mpcinfo/mp3Info.c index f75ba9c4..c08e9663 100644 --- a/plugins/mpcinfo/mp3Info.c +++ b/plugins/mpcinfo/mp3Info.c @@ -81,12 +81,12 @@ int str2int(char *text){ int ret=0; for (i=1;i<=strlen(text);i++){ if ((text[strlen(text)-i]>57)||(text[strlen(text)-i]<48)){ - xchat_printf(ph,"invalid char in string: %i",text[strlen(text)-i]); + hexchat_printf(ph,"invalid char in string: %i",text[strlen(text)-i]); return 255; } ret+=((int)text[strlen(text)-i]-48)*iPow(10,i-1); } - //xchat_printf(ph, "str2int(%s)=%i",text,ret); + //hexchat_printf(ph, "str2int(%s)=%i",text,ret); //if (DEBUG==1) putlog("int converted"); return ret; } @@ -135,7 +135,7 @@ static char *tagExtract(char *tag, int tagLen, char* info){ //if (DEBUG==1) putlog("extracting tag"); int pos, len, i; pos=inStr(tag,tagLen,info); -//xchat_printf(ph,"pos=%i",pos); +//hexchat_printf(ph,"pos=%i",pos); if (pos==-1) return "";//NULL; //printf("position of %s = %i\n",info,pos); len=0; @@ -163,7 +163,7 @@ struct tagInfo readID3V1(char *file){ ret.artist=NULL; f=fopen(file,"rb"); if (f==NULL){ - xchat_print(ph,"file not found while trying to read id3v1"); + hexchat_print(ph,"file not found while trying to read id3v1"); //if (DEBUG==1) putlog("file not found while trying to read id3v1"); return ret; } @@ -174,14 +174,14 @@ struct tagInfo readID3V1(char *file){ //printf("position= %li\n",pos); for (i=0;i<128;i++) { c=fgetc(f); - if (c==EOF) {xchat_printf(ph,"read ID3V1 failed\n");fclose(f);return ret;} + if (c==EOF) {hexchat_printf(ph,"read ID3V1 failed\n");fclose(f);return ret;} tag[i]=(char)c; } fclose(f); //printf("tag readed: \n"); id=substring(tag,0,3); //printf("header: %s\n",id); - if (strcmp(id,"TAG")!=0){xchat_printf(ph,"no id3 v1 found\n");return ret;} + if (strcmp(id,"TAG")!=0){hexchat_printf(ph,"no id3 v1 found\n");return ret;} ret.title=subString(tag,3,30,1); ret.artist=subString(tag,33,30,1); ret.album=subString(tag,63,30,1); @@ -191,15 +191,15 @@ struct tagInfo readID3V1(char *file){ val=(int)tmp[0]; if (val<0)val+=256; - //xchat_printf(ph, "tmp[0]=%i (%i)",val,tmp[0]); + //hexchat_printf(ph, "tmp[0]=%i (%i)",val,tmp[0]); if ((val<148)&&(val>=0)) ret.genre=GENRES[val];//#############changed else { ret.genre="unknown"; - //xchat_printf(ph, "tmp[0]=%i (%i)",val,tmp[0]); + //hexchat_printf(ph, "tmp[0]=%i (%i)",val,tmp[0]); } - //xchat_printf(ph, "tmp: \"%s\" -> %i",tmp,tmp[0]); - //xchat_printf(ph,"genre \"%s\"",ret.genre); + //hexchat_printf(ph, "tmp: \"%s\" -> %i",tmp,tmp[0]); + //hexchat_printf(ph,"genre \"%s\"",ret.genre); //if (DEBUG==1) putlog("id3v1 extracted"); return ret; } @@ -214,7 +214,7 @@ char *extractID3Genre(char *tag){ } else{ int i; - //xchat_print(ph, "Using 2 criteria"); + //hexchat_print(ph, "Using 2 criteria"); for (i=0;i #include #include "hexchat-plugin.h" -static xchat_plugin *ph; +static hexchat_plugin *ph; #include "functions.c" #include "mp3Info.c" @@ -46,23 +46,23 @@ static int mpc_tell(char *word[], char *word_eol[], void *userdata){ char *tTitle, *zero, *oggLine, *line; struct tagInfo info; HWND hwnd = FindWindow("MediaPlayerClassicW",NULL); - if (hwnd==0) {xchat_command(ph, randomLine(notRunTheme));return HEXCHAT_EAT_ALL;} + if (hwnd==0) {hexchat_command(ph, randomLine(notRunTheme));return HEXCHAT_EAT_ALL;} tTitle=(char*)malloc(sizeof(char)*1024); GetWindowText(hwnd, tTitle, 1024); zero=strstr(tTitle," - Media Player Classic"); if (zero!=NULL) zero[0]=0; - else xchat_print(ph,"pattern not found"); + else hexchat_print(ph,"pattern not found"); if ((tTitle[1]==':')&&(tTitle[2]=='\\')){ - //xchat_print(ph,"seams to be full path"); + //hexchat_print(ph,"seams to be full path"); if (endsWith(tTitle,".mp3")==1){ - //xchat_print(ph,"seams to be a mp3 file"); + //hexchat_print(ph,"seams to be a mp3 file"); info = readHeader(tTitle); if ((info.artist!=NULL)&&(strcmp(info.artist,"")!=0)){ char *mode=MODES[info.mode]; - //xchat_printf(ph,"mode: %s\n",mode); + //hexchat_printf(ph,"mode: %s\n",mode); char *mp3Line=randomLine(mp3Theme); mp3Line=replace(mp3Line,"%art",info.artist); mp3Line=replace(mp3Line,"%tit",info.title); @@ -82,19 +82,19 @@ static int mpc_tell(char *word[], char *word_eol[], void *userdata){ //mp3Line=intReplace(mp3Line,"%perc",perc); //mp3Line=replace(mp3Line,"%plTitle",title); mp3Line=replace(mp3Line,"%file",tTitle); - xchat_command(ph, mp3Line); + hexchat_command(ph, mp3Line); return HEXCHAT_EAT_ALL; } } if (endsWith(tTitle,".ogg")==1){ - xchat_printf(ph,"Ogg detected\n"); + hexchat_printf(ph,"Ogg detected\n"); info = getOggHeader(tTitle); if (info.artist!=NULL){ char *cbr; if (info.cbr==1) cbr="CBR"; else cbr="VBR"; oggLine=randomLine(oggTheme); //if (cue==1) oggLine=cueLine; - //xchat_printf(ph,"ogg-line: %s\n",oggLine); + //hexchat_printf(ph,"ogg-line: %s\n",oggLine); oggLine=replace(oggLine,"%art",info.artist); oggLine=replace(oggLine,"%tit",info.title); oggLine=replace(oggLine,"%alb",info.album); @@ -111,39 +111,39 @@ static int mpc_tell(char *word[], char *word_eol[], void *userdata){ //oggLine=intReplace(oggLine,"%perc",perc); //oggLine=replace(oggLine,"%plTitle",title); oggLine=replace(oggLine,"%file",tTitle); - xchat_command(ph, oggLine); + hexchat_command(ph, oggLine); return HEXCHAT_EAT_ALL; } } } line=randomLine(titleTheme); line=replace(line,"%title", tTitle); - xchat_command(ph,line); + hexchat_command(ph,line); return HEXCHAT_EAT_ALL; } -int xchat_plugin_init(xchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg){ +int hexchat_plugin_init(hexchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg){ ph = plugin_handle; *plugin_name = "mpcInfo"; *plugin_desc = "Information-Script for Media Player Classic"; *plugin_version=VERSION; - xchat_hook_command(ph, "mpc", HEXCHAT_PRI_NORM, mpc_tell,"no help text", 0); - xchat_hook_command(ph, "mpc_themes", HEXCHAT_PRI_NORM, print_themes,"no help text", 0); - xchat_hook_command(ph, "mpc_reloadthemes", HEXCHAT_PRI_NORM, mpc_themeReload,"no help text", 0); - xchat_command (ph, "MENU -ietc\\music.png ADD \"Window/Display Current Song (MPC)\" \"MPC\""); + hexchat_hook_command(ph, "mpc", HEXCHAT_PRI_NORM, mpc_tell,"no help text", 0); + hexchat_hook_command(ph, "mpc_themes", HEXCHAT_PRI_NORM, print_themes,"no help text", 0); + hexchat_hook_command(ph, "mpc_reloadthemes", HEXCHAT_PRI_NORM, mpc_themeReload,"no help text", 0); + hexchat_command (ph, "MENU -ietc\\music.png ADD \"Window/Display Current Song (MPC)\" \"MPC\""); themeInit(); loadThemes(); - xchat_printf(ph, "%s %s plugin loaded\n",*plugin_name, VERSION); + hexchat_printf(ph, "%s %s plugin loaded\n",*plugin_name, VERSION); return 1; } int -xchat_plugin_deinit (void) +hexchat_plugin_deinit (void) { - xchat_command (ph, "MENU DEL \"Window/Display Current Song (MPC)\""); - xchat_print (ph, "mpcInfo plugin unloaded\n"); + hexchat_command (ph, "MENU DEL \"Window/Display Current Song (MPC)\""); + hexchat_print (ph, "mpcInfo plugin unloaded\n"); return 1; } diff --git a/plugins/mpcinfo/mpcinfo.def b/plugins/mpcinfo/mpcinfo.def index 77670bf2..e560f50f 100644 --- a/plugins/mpcinfo/mpcinfo.def +++ b/plugins/mpcinfo/mpcinfo.def @@ -1,3 +1,3 @@ EXPORTS -xchat_plugin_init -xchat_plugin_deinit +hexchat_plugin_init +hexchat_plugin_deinit diff --git a/plugins/mpcinfo/oggInfo.c b/plugins/mpcinfo/oggInfo.c index 83c2beb5..64c9c512 100644 --- a/plugins/mpcinfo/oggInfo.c +++ b/plugins/mpcinfo/oggInfo.c @@ -51,7 +51,7 @@ struct tagInfo getOggHeader(char *file){ info.artist=NULL; f = fopen(file,"rb"); if (f==NULL){ - xchat_print(ph,"file not found while trying to read ogg header"); + hexchat_print(ph,"file not found while trying to read ogg header"); //if (DEBUG==1) putlog("file not found while trying to read ogg header"); return info; } diff --git a/plugins/mpcinfo/theme.c b/plugins/mpcinfo/theme.c index 000c00b1..fc218267 100644 --- a/plugins/mpcinfo/theme.c +++ b/plugins/mpcinfo/theme.c @@ -39,14 +39,14 @@ void themeInit(){ void printTheme(struct theme data){ int i; - for (i=0;i 0) { @@ -118,7 +118,7 @@ void loadThemes(){ if (strcmp(toUpper(line),"OGG_LINE")==0) mp3Theme=themeAdd(oggTheme,val); } fclose(f); - xchat_print(ph, "theme loaded successfull\n"); + hexchat_print(ph, "theme loaded successfull\n"); } if (notRunTheme.size==0) notRunTheme=themeAdd(notRunTheme,"say Media Player Classic not running"); if (titleTheme.size==0) titleTheme=themeAdd(titleTheme,"say Playing %title in Media Player Classic"); -- cgit 1.4.1