summary refs log tree commit diff stats
path: root/build
AgeCommit message (Expand)Author
2010-10-02make enchant a separate install componentberkeviktor@aol.com
2010-10-02typofixberkeviktor@aol.com
2010-10-02fix enchant pathberkeviktor@aol.com
2010-10-02even more cleanupberkeviktor@aol.com
2010-10-02some cleanupberkeviktor@aol.com
2010-10-02spelling for x64 using own enchant buildberkeviktor@aol.com
2010-10-02update dependenciesberkeviktor@aol.com
2010-10-01add batch file for extracting deb files (myspell)berkeviktor@aol.com
2010-10-01taking care of enchant libsberkeviktor@aol.com
2010-10-01add enchant as dependencyberkeviktor@aol.com
2010-10-01update gtk+berkeviktor@aol.com
2010-10-01copy libenchant.dll tooberkeviktor@aol.com
2010-10-01spelling supportberkeviktor@aol.com
2010-09-29add separate gdk-pixbuf packages to dependenciesberkeviktor@aol.com
2010-09-29update dependencies for x86berkeviktor@aol.com
2010-09-29turn on auto-mnemonics (gtk 2.20 feature)berkeviktor@aol.com
2010-09-29move gtk includes to makefileberkeviktor@aol.com
2010-09-20don't build mmx_cmod since it ain't speeding up anything (and it's x86-only btw)berkeviktor@aol.com
2010-09-20remove themes from the installerberkeviktor@aol.com
2010-09-19update xchat to 1468berkeviktor@aol.com
2010-09-07rename updater pluginberkeviktor@aol.com
2010-09-06stupid copy-pasteberkeviktor@aol.com
2010-09-06installer support for updaterberkeviktor@aol.com
2010-09-06fix perl plugin breakageberkeviktor@aol.com
2010-08-31copy portable-mode file first to save a few secondsberkeviktor@aol.com
2010-08-30remove "r" from versionberkeviktor@aol.com
2010-08-30about dialog cosmeticsberkeviktor@aol.com
2010-08-30add small xchat logo to the installerberkeviktor@aol.com
2010-08-30make xtray defaultberkeviktor@aol.com
2010-08-30installer tasks and features reworkedberkeviktor@aol.com
2010-08-30re-enable xtray, disable plugin-tray if installedberkeviktor@aol.com
2010-08-30supress messages for new perl makefilesberkeviktor@aol.com
2010-08-29add black theme option for portableberkeviktor@aol.com
2010-08-29only ask for perl version if perl interface is selected for installberkeviktor@aol.com
2010-08-29version mismatchberkeviktor@aol.com
2010-08-29make perl version selectableberkeviktor@aol.com
2010-08-26clean fe-text before building for x64berkeviktor@aol.com
2010-08-26update version numberberkeviktor@aol.com
2010-08-25update xchat to r1462berkeviktor@aol.com
2010-08-24eh, i knew i forgot sgberkeviktor@aol.com
2010-08-24some more reworkberkeviktor@aol.com
2010-08-24even more cleanupberkeviktor@aol.com
2010-08-24huge cleanup on build systemberkeviktor@aol.com
2010-08-24we do need glibberkeviktor@aol.com
2010-08-24remove a few dependenciesberkeviktor@aol.com
2010-08-24add dependency listsberkeviktor@aol.com
2010-08-24libgthread is required only for gtk 2.20berkeviktor@aol.com
2010-08-24add installer image file to repoberkeviktor@aol.com
2010-08-23don't uninstall when portable install is performedberkeviktor@aol.com
2010-08-23some more work on mergerberkeviktor@aol.com
or TingPing <tingping@tingping.se> 2015-04-13 16:21:14 -0400 committer TingPing <tingping@tingping.se> 2015-04-13 16:25:37 -0400 winamp: Clean up formatting' href='/git-repos/torxchat.git/commit/plugins/winamp/winamp.c?h=feature/tor-i2p-dcc&id=a8392c7f9590e2d5bd27c36520fb156a4d0162ab'>a8392c7f ^
174db0eb ^
a8392c7f ^
174db0eb ^

a8392c7f ^
174db0eb ^
a8392c7f ^
174db0eb ^
d03d6e60 ^
174db0eb ^



a8392c7f ^






d03d6e60 ^


a8392c7f ^
d03d6e60 ^
45d4fa58 ^
d03d6e60 ^


e681eafa ^
a8392c7f ^



d03d6e60 ^
507af191 ^
d03d6e60 ^


fe3df241 ^
72d7f64f ^
d03d6e60 ^
e681eafa ^
bed00e52 ^
d03d6e60 ^
e681eafa ^
d03d6e60 ^
a8392c7f ^
d03d6e60 ^


e681eafa ^
d03d6e60 ^
e681eafa ^

d03d6e60 ^

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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154














                                                                       
                 
 
                           



                 
                                                
 


                                                      










































                                                                                        


                                                                                                         
 





                                                                                              
 
                                                      
                         
                                                                             

                                                                            
                                 


                                                                        
                                 
 




                                                                      
                                            
 

                                                                     
                                      
                                               
                                    
                                                         
 



                                                                                                 






                                                                                                 


            
                                                         
         
                               


   
                                                  



                                                                
 
                                                                       


                                
                                                   
                                
 
                                                                                                                                                                               
                                                                                                                
 
                                                     
 
                                                     


   
                           
 

                                                                                  

                 
/********************* Winamp Plugin 0.3******************************
 *
 *   Distribution: GPL
 *
 *   Originally written by: Leo - leo.nard@free.fr
 *   Modified by: SilvereX - SilvereX@karklas.mif.vu.lt
 *   Modified again by: Derek Buitenhuis - daemon404@gmail.com
 *   Modified yet again by: Berke Viktor - berkeviktor@aol.com
 *********************************************************************/

#include "windows.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>

#include "hexchat-plugin.h"

#define PLAYING 1
#define PAUSED 3

static hexchat_plugin *ph;   /* plugin handle */

static int
winamp(char *word[], char *word_eol[], void *userdata)
{
	HWND hwndWinamp = FindWindowW(L"Winamp v1.x",NULL);

	if (hwndWinamp)
	{
		if (!stricmp("PAUSE", word[2]))
		{
			if (SendMessage(hwndWinamp,WM_USER, 0, 104))
			{
				SendMessage(hwndWinamp, WM_COMMAND, 40046, 0);
			
				if (SendMessage(hwndWinamp, WM_USER, 0, 104) == PLAYING)
					hexchat_printf(ph, "Winamp: playing");
				else
					hexchat_printf(ph, "Winamp: paused");
			}
		}
		else if (!stricmp("STOP", word[2]))
		{
			SendMessage(hwndWinamp, WM_COMMAND, 40047, 0);
			hexchat_printf(ph, "Winamp: stopped");
		}
		else if (!stricmp("PLAY", word[2]))
		{
			SendMessage(hwndWinamp, WM_COMMAND, 40045, 0);
			hexchat_printf(ph, "Winamp: playing");
		}
		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]))
		{
			SendMessage(hwndWinamp, WM_COMMAND, 40044, 0);
			hexchat_printf(ph, "Winamp: previous playlist entry");
		}
		else if (!stricmp("START", word[2]))
		{
			SendMessage(hwndWinamp, WM_COMMAND, 40154, 0);
			hexchat_printf(ph, "Winamp: playlist start");
		}
		else if (!word_eol[2][0])
		{
			wchar_t wcurrent_play[2048];
			char *current_play, *p;
			int len = GetWindowTextW(hwndWinamp, wcurrent_play, G_N_ELEMENTS(wcurrent_play));

			current_play = g_utf16_to_utf8 (wcurrent_play, len, NULL, NULL, NULL);
			if (!current_play)
			{
				hexchat_print (ph, "Winamp: Error getting song information.");
				return HEXCHAT_EAT_ALL;
			}

			if (strchr(current_play, '-'))
			{
				/* Remove any trailing text and whitespace */
				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';

				/* Ignore any leading track number */
				p = strstr (current_play, ". ");
				if (p)
					p += 2;
				else
					p = current_play;

				if (*p != '\0')
					hexchat_commandf (ph, "me is now playing: %s", p);
				else
					hexchat_print (ph, "Winamp: No song information found.");
				g_free (current_play);
			}
			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");
	}
	return HEXCHAT_EAT_ALL;
}

int
hexchat_plugin_init(hexchat_plugin *plugin_handle,
					  char **plugin_name,
					  char **plugin_desc,
					  char **plugin_version,
					  char *arg)
{
	/* we need to save this for use with any hexchat_* functions */
	ph = plugin_handle;

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

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

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

	return 1;	   /* return 1 for success */
}

int
hexchat_plugin_deinit(void)
{
	hexchat_command (ph, "MENU DEL \"Window/Display Current Song (Winamp)\"");
	hexchat_print (ph, "Winamp plugin unloaded\n");
	return 1;
}