winamp: Clean up formatting

This commit is contained in:
TingPing 2015-04-13 16:21:14 -04:00
parent 72d7f64f8b
commit a8392c7f95
1 changed files with 96 additions and 109 deletions

View File

@ -50,16 +50,14 @@ song_strcpy (char *dest, char *src)
static int
winamp(char *word[], char *word_eol[], void *userdata)
{
wchar_t wcurrent_play[2048];
char *current_play, *p;
char p_esc[2048];
char cur_esc[2048];
char truc[2048];
HWND hwndWinamp = FindWindowW(L"Winamp v1.x",NULL);
wchar_t wcurrent_play[2048];
char *current_play, *p;
char p_esc[2048];
char cur_esc[2048];
char truc[2048];
HWND hwndWinamp = FindWindowW(L"Winamp v1.x",NULL);
if (hwndWinamp)
{
{
if (!stricmp("PAUSE", word[2]))
{
@ -73,43 +71,32 @@ HWND hwndWinamp = FindWindowW(L"Winamp v1.x",NULL);
hexchat_printf(ph, "Winamp: paused");
}
}
else
if (!stricmp("STOP", word[2]))
else if (!stricmp("STOP", word[2]))
{
SendMessage(hwndWinamp, WM_COMMAND, 40047, 0);
hexchat_printf(ph, "Winamp: stopped");
}
else
if (!stricmp("PLAY", word[2]))
else if (!stricmp("PLAY", word[2]))
{
SendMessage(hwndWinamp, WM_COMMAND, 40045, 0);
hexchat_printf(ph, "Winamp: playing");
}
else
if (!stricmp("NEXT", word[2]))
else if (!stricmp("NEXT", word[2]))
{
SendMessage(hwndWinamp, WM_COMMAND, 40048, 0);
hexchat_printf(ph, "Winamp: next playlist entry");
}
else
if (!stricmp("PREV", word[2]))
else if (!stricmp("PREV", word[2]))
{
SendMessage(hwndWinamp, WM_COMMAND, 40044, 0);
hexchat_printf(ph, "Winamp: previous playlist entry");
}
else
if (!stricmp("START", word[2]))
else if (!stricmp("START", word[2]))
{
SendMessage(hwndWinamp, WM_COMMAND, 40154, 0);
hexchat_printf(ph, "Winamp: playlist start");
}
else
if (!word_eol[2][0])
else if (!word_eol[2][0])
{
int len = GetWindowTextW(hwndWinamp, wcurrent_play, sizeof(wcurrent_play));
@ -130,12 +117,13 @@ HWND hwndWinamp = FindWindowW(L"Winamp v1.x",NULL);
p--;
}
if (p >= current_play) p--;
if (p >= current_play)
p--;
while (p >= current_play && *p == ' ') p--;
while (p >= current_play && *p == ' ')
p--;
*++p=0;
p = strchr(current_play, '.') + 1;
song_strcpy(p_esc, p);
@ -153,13 +141,12 @@ HWND hwndWinamp = FindWindowW(L"Winamp v1.x",NULL);
hexchat_commandf(ph, truc);
g_free (current_play);
}
else hexchat_print(ph, "Winamp: Nothing being played.");
else
hexchat_print(ph, "Winamp: Nothing being played.");
}
else
hexchat_printf(ph, "Usage: /WINAMP [PAUSE|PLAY|STOP|NEXT|PREV|START]\n");
}
}
else
{
hexchat_print(ph, "Winamp not found.\n");