Example #1
0
int
xchat_plugin_deinit(void)
{
	xchat_command (ph, "MENU DEL \"Window/Display Current Song (Winamp)\"");
	xchat_print (ph, "Winamp plugin unloaded\n");
	return 1;
}
Example #2
0
int
xchat_plugin_deinit (void)
{
	xchat_command (ph, "MENU DEL \"Window/Display System Info\"");
	xchat_printf (ph, "%s plugin unloaded\n", name);
	return 1;
}
Example #3
0
void xchat_commandf(xchat_plugin *ph, const char *format, ...)
{
	va_list args;
	char *buf;

	va_start(args, format);
	buf = g_strdup_vprintf(format, args);
	va_end(args);

	xchat_command(ph, buf);
	g_free(buf);
}
Example #4
0
static VALUE static_ruby_xchat_command( VALUE klass,
                                        VALUE command )
{
  char *cmd;

  Check_Type( command, T_STRING );
  cmd = StringValueCStr( command );

  xchat_command( static_plugin_handle,
                 cmd );

  return Qnil;
}
Example #5
0
/* Xchat::Internal::command(command) */
static
XS (XS_Xchat_command)
{
	char *cmd = NULL;

	dXSARGS;
	if (items != 1) {
		xchat_print (ph, "Usage: Xchat::Internal::command(command)");
	} else {
		cmd = SvPV_nolen (ST (0));
		xchat_command (ph, cmd);

	}
	XSRETURN_EMPTY;
}
Example #6
0
static int timeout_cb(timer *tim)
{
        if (xchat_set_context(ph, tim->context)) {
                xchat_command(ph, tim->command);

                if (tim->forever)
                        return 1;

                tim->repeat--;
                if (tim->repeat > 0)
                        return 1;
        }

        timer_del(tim);
        return 0;
}
Example #7
0
int xchat_plugin_init(xchat_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", XCHAT_PRI_NORM, mpc_tell,"no help text", 0);
	xchat_hook_command(ph, "mpc_themes", XCHAT_PRI_NORM, print_themes,"no help text", 0);
	xchat_hook_command(ph, "mpc_reloadthemes", XCHAT_PRI_NORM, mpc_themeReload,"no help text", 0);
	xchat_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);

	return 1;
}
Example #8
0
int
xchat_plugin_init (xchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg)
{
	ph = plugin_handle;

	*plugin_name = name;
	*plugin_desc = desc;
	*plugin_version = version;

	firstRun = 1;

	xchat_hook_command (ph, "WINSYS", XCHAT_PRI_NORM, printInfo, NULL, NULL);
	xchat_command (ph, "MENU -ietc\\system.png ADD \"Window/Display System Info\" \"WINSYS\"");

	xchat_printf (ph, "%s plugin loaded\n", name);

	return 1;       /* return 1 for success */
}
Example #9
0
int
xchat_plugin_init(xchat_plugin *plugin_handle,
                      char **plugin_name,
                      char **plugin_desc,
                      char **plugin_version,
                      char *arg)
{
	/* we need to save this for use with any xchat_* functions */
	ph = plugin_handle;

	*plugin_name = "Winamp";
	*plugin_desc = "Winamp plugin for HexChat";
	*plugin_version = "0.5";

	xchat_hook_command (ph, "WINAMP", XCHAT_PRI_NORM, winamp, "Usage: /WINAMP [PAUSE|PLAY|STOP|NEXT|PREV|START] - control Winamp or show what's currently playing", 0);
   	xchat_command (ph, "MENU -ietc\\music.png ADD \"Window/Display Current Song (Winamp)\" \"WINAMP\"");

	xchat_print (ph, "Winamp plugin loaded\n");

	return 1;       /* return 1 for success */
}
Example #10
0
static void
disconnect_from_network (gchar *key, xchat_context *context, gpointer data)
{
	xchat_set_context (ph, context);
	xchat_command (ph, "DISCON");
}
Example #11
0
/* 
 * lua:  xchat.command(command) 
 * desc: executes a command as if it were typed in xchat's input box. 
 * ret:  none
 * args: 
 *       * command (string): command to execute, without the forward slash "/". 
 */
static int lxc_command(lua_State *L)
{
	const char *command = luaL_checkstring(L, 1);
	xchat_command(ph, command);
	return 0;
}
Example #12
0
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 XCHAT_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");
       
       if ((tTitle[1]==':')&&(tTitle[2]=='\\')){
          //xchat_print(ph,"seams to be full path");
          if (endsWith(tTitle,".mp3")==1){
             //xchat_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);
                char *mp3Line=randomLine(mp3Theme);
                mp3Line=replace(mp3Line,"%art",info.artist);
                mp3Line=replace(mp3Line,"%tit",info.title);
                mp3Line=replace(mp3Line,"%alb",info.album);
                mp3Line=replace(mp3Line,"%com",info.comment);
                mp3Line=replace(mp3Line,"%gen",info.genre);
                //mp3Line=replace(mp3Line,"%time",pos);
                //mp3Line=replace(mp3Line,"%length",len);
                //mp3Line=replace(mp3Line,"%ver",waVers);
                //mp3Line=intReplace(mp3Line,"%br",br);
                //mp3Line=intReplace(mp3Line,"%frq",frq);
                
                mp3Line=intReplace(mp3Line,"%br",info.bitrate);
                mp3Line=intReplace(mp3Line,"%frq",info.freq);
                mp3Line=replace(mp3Line,"%mode",mode);
                //mp3Line=replace(mp3Line,"%size",size);
                //mp3Line=intReplace(mp3Line,"%perc",perc);
                //mp3Line=replace(mp3Line,"%plTitle",title);
                mp3Line=replace(mp3Line,"%file",tTitle);
                xchat_command(ph, mp3Line);
                return XCHAT_EAT_ALL;
             }
          }
          if (endsWith(tTitle,".ogg")==1){
             xchat_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);
                oggLine=replace(oggLine,"%art",info.artist);
                oggLine=replace(oggLine,"%tit",info.title);
                oggLine=replace(oggLine,"%alb",info.album);
                oggLine=replace(oggLine,"%com",info.comment);
                oggLine=replace(oggLine,"%gen",info.genre);
                //oggLine=replace(oggLine,"%time",pos);
                //oggLine=replace(oggLine,"%length",len);
                //oggLine=replace(oggLine,"%ver",waVers);
                oggLine=intReplace(oggLine,"%chan",info.mode);
                oggLine=replace(oggLine,"%cbr",cbr);
                oggLine=intReplace(oggLine,"%br",info.bitrate/1000);//br);
                oggLine=intReplace(oggLine,"%frq",info.freq);
                //oggLine=replace(oggLine,"%size",size);
                //oggLine=intReplace(oggLine,"%perc",perc);
                //oggLine=replace(oggLine,"%plTitle",title);
                oggLine=replace(oggLine,"%file",tTitle);
                xchat_command(ph, oggLine);
                return XCHAT_EAT_ALL;
             }
          }
       }
       line=randomLine(titleTheme);
       line=replace(line,"%title", tTitle);
       xchat_command(ph,line); 
       return XCHAT_EAT_ALL;
}