summary refs log blame commit diff stats
path: root/plugins/winamp/winamp.c
blob: 7201a87596c3b3efe15a8bca0a293be3ff140396 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
generated by cgit-pink 1.4.1 (git 2.36.1) at 2024-12-26 07:34:30 +0000
(!stricmp("NEXT", word[2])) { SendMessage(hwndWinamp, WM_COMMAND, 40048, 0); xchat_printf(ph, "Winamp: next playlist entry"); } else if (!stricmp("PREV", word[2])) { SendMessage(hwndWinamp, WM_COMMAND, 40044, 0); xchat_printf(ph, "Winamp: previous playlist entry"); } else if (!stricmp("START", word[2])) { SendMessage(hwndWinamp, WM_COMMAND, 40154, 0); xchat_printf(ph, "Winamp: playlist start"); } else if (!word_eol[2][0]) { GetWindowText(hwndWinamp, current_play, sizeof(current_play)); if (strchr(current_play, '-')) { p = current_play + strlen(current_play) - 8; while (p >= current_play) { if (!strnicmp(p, "- Winamp", 8)) break; p--; } if (p >= current_play) p--; while (p >= current_play && *p == ' ') p--; *++p=0; p = strchr(current_play, '.') + 1; song_strcpy(p_esc, p); song_strcpy(cur_esc, current_play); if (p) { sprintf(truc, "me is now playing:%s", p_esc); } else { sprintf(truc, "me is now playing:%s", cur_esc); } xchat_commandf(ph, truc); } else xchat_print(ph, "Winamp: Nothing being played."); } else xchat_printf(ph, "Usage: /WINAMP [PAUSE|PLAY|STOP|NEXT|PREV|START]\n"); } } else { xchat_print(ph, "Winamp not found.\n"); } return XCHAT_EAT_ALL; } 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 XChat"; *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 */ } int xchat_plugin_deinit(void) { xchat_command (ph, "MENU DEL \"Window/Display Current Song (Winamp)\""); xchat_print (ph, "Winamp plugin unloaded\n"); return 1; }