rtoss - Blame information for rev 182

Subversion Repositories:
Rev:
Rev Author Line No. Line
181 roytam 1 /*
182 roytam 2 ** Copyright (C) 1997-2008 Nullsoft, Inc.
181 roytam 3 **
4 ** This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held
5 ** liable for any damages arising from the use of this software.
6 **
7 ** Permission is granted to anyone to use this software for any purpose, including commercial applications, and to
8 ** alter it and redistribute it freely, subject to the following restrictions:
9 **
10 **   1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
11 **      If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12 **
13 **   2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
14 **
15 **   3. This notice may not be removed or altered from any source distribution.
16 **
17 */
18  
19 #ifndef _WA_IPC_H_
20 #define _WA_IPC_H_
21  
182 roytam 22 #include <windows.h>
23 #include <stddef.h>
24 #if (_MSC_VER <= 1200)
25 typedef int intptr_t;
26 #endif
181 roytam 27 /*
28 ** This is the modern replacement for the classic 'frontend.h'. Most of these
29 ** updates are designed for in-process use, i.e. from a plugin.
30 **
31 */
32  
182 roytam 33 /* Most of the IPC_* messages involve sending the message in the form of:
34 ** result = SendMessage(hwnd_winamp,WM_WA_IPC,(parameter),IPC_*);
35 ** Where different then this is specified (typically with WM_COPYDATA variants)
36 **
37 ** When you use SendMessage(hwnd_winamp,WM_WA_IPC,(parameter),IPC_*) and specify a IPC_*
38 ** which is not currently implemented/supported by the Winamp version being used then it
39 ** will return 1 for 'result'. This is a good way of helping to check if an api being
40 ** used which returns a function pointer, etc is even going to be valid.
181 roytam 41 */
182 roytam 42  
181 roytam 43 #define WM_WA_IPC WM_USER
44  
182 roytam 45 #define WINAMP_VERSION_MAJOR(winampVersion) ((winampVersion & 0x0000FF00) >> 12)
46 #define WINAMP_VERSION_MINOR(winampVersion) (winampVersion & 0x000000FF)  // returns, i.e. 0x12 for 5.12 and 0x10 for 5.1...
47  
48  
181 roytam 49 #define IPC_GETVERSION 0
50 /* int version = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION);
51 **
182 roytam 52 ** The version returned will be 0x20yx for Winamp 2.yx.
53 ** Versions previous to Winamp 2.0 typically (but not always) use 0x1zyx for 1.zx.
54 ** Just a bit weird but that's the way it goes.
55 **
56 ** For Winamp 5.x it uses the format 0x50yx for Winamp 5.yx
57 ** e.g.   5.01 -> 0x5001
58 **        5.09 -> 0x5009
59 **        5.1  -> 0x5010
60 **
61 ** Notes: For 5.02 this api will return the same value as for a 5.01 build.
62 **        For 5.07 this api will return the same value as for a 5.06 build.
181 roytam 63 */
64  
182 roytam 65  
66 #define IPC_GETVERSIONSTRING 1
67  
68  
181 roytam 69 #define IPC_GETREGISTEREDVERSION 770
182 roytam 70 /* (requires Winamp 5.0+)
71 ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETREGISTEREDVERSION);
72 **
73 ** This will open the Winamp Preferences and show the Winamp Pro page.
74 */
181 roytam 75  
76  
77 typedef struct {
182 roytam 78   const char *filename;
79   const char *title;
181 roytam 80   int length;
81 } enqueueFileWithMetaStruct; // send this to a IPC_PLAYFILE in a non WM_COPYDATA,
82 // and you get the nice desired result. if title is NULL, it is treated as a "thing",
83 // otherwise it's assumed to be a file (for speed)
84  
182 roytam 85 typedef struct {
86   const wchar_t *filename;
87   const wchar_t *title;
88   int length;
89 } enqueueFileWithMetaStructW;
90  
181 roytam 91 #define IPC_PLAYFILE 100  // dont be fooled, this is really the same as enqueufile
92 #define IPC_ENQUEUEFILE 100
182 roytam 93 #define IPC_PLAYFILEW 1100
94 #define IPC_ENQUEUEFILEW 1100
95 /* This is sent as a WM_COPYDATA with IPC_PLAYFILE as the dwData member and the string
96 ** of the file / playlist to be enqueued into the playlist editor as the lpData member.
97 ** This will just enqueue the file or files since you can use this to enqueue a playlist.
98 ** It will not clear the current playlist or change the playback state.
99 **
100 ** COPYDATASTRUCT cds = {0};
101 **   cds.dwData = IPC_ENQUEUEFILE;
102 **   cds.lpData = (void*)"c:\\test\\folder\\test.mp3";
103 **   cds.cbData = lstrlen((char*)cds.lpData)+1;  // include space for null char
104 **   SendMessage(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
105 **
106 **
107 ** With 2.9+ and all of the 5.x versions you can send this as a normal WM_WA_IPC
108 ** (non WM_COPYDATA) with an enqueueFileWithMetaStruct as the param.
109 ** If the title member is null then it is treated as a "thing" otherwise it will be
110 ** assumed to be a file (for speed).
111 **
112 ** enqueueFileWithMetaStruct eFWMS = {0};
113 **   eFWMS.filename = "c:\\test\\folder\\test.mp3";
114 **   eFWMS.title = "Whipping Good";
115 **   eFWMS.length = 300;  // this is the number of seconds for the track
116 **   SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&eFWMS,IPC_ENQUEUEFILE);
181 roytam 117 */
118  
119  
120 #define IPC_DELETE 101
182 roytam 121 #define IPC_DELETE_INT 1101
181 roytam 122 /* SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_DELETE);
182 roytam 123 ** Use this api to clear Winamp's internal playlist.
124 ** You should not need to use IPC_DELETE_INT since it is used internally by Winamp when
125 ** it is dealing with some lame Windows Explorer issues (hard to believe that!).
181 roytam 126 */
127  
128  
182 roytam 129 #define IPC_STARTPLAY 102  
130 #define IPC_STARTPLAY_INT 1102
131 /* SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_STARTPLAY);
132 ** Sending this will start playback and is almost the same as hitting the play button.
133 ** The IPC_STARTPLAY_INT version is used internally and you should not need to use it
134 ** since it won't be any fun.
135 */
181 roytam 136  
137  
138 #define IPC_CHDIR 103
182 roytam 139 /* This is sent as a WM_COPYDATA type message with IPC_CHDIR as the dwData value and the
140 ** directory you want to change to as the lpData member.
141 **
142 ** COPYDATASTRUCT cds = {0};
143 **   cds.dwData = IPC_CHDIR;
144 **   cds.lpData = (void*)"c:\\download";
145 **   cds.cbData = lstrlen((char*)cds.lpData)+1; // include space for null char
146 **   SendMessage(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
147 **
148 ** The above example will make Winamp change to the directory 'C:\download'.
181 roytam 149 */
150  
151  
152 #define IPC_ISPLAYING 104
153 /* int res = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISPLAYING);
182 roytam 154 ** This is sent to retrieve the current playback state of Winamp.
155 ** If it returns 1, Winamp is playing.
156 ** If it returns 3, Winamp is paused.
157 ** If it returns 0, Winamp is not playing.
181 roytam 158 */
159  
160  
161 #define IPC_GETOUTPUTTIME 105
162 /* int res = SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETOUTPUTTIME);
182 roytam 163 ** This api can return two different sets of information about current playback status.
164 **
165 ** If mode = 0 then it will return the position (in ms) of the currently playing track.
166 ** Will return -1 if Winamp is not playing.
167 **
168 ** If mode = 1 then it will return the current track length (in seconds).
169 ** Will return -1 if there are no tracks (or possibly if Winamp cannot get the length).
170 **
171 ** If mode = 2 then it will return the current track length (in milliseconds).
172 ** Will return -1 if there are no tracks (or possibly if Winamp cannot get the length).
181 roytam 173 */
174  
175  
176 #define IPC_JUMPTOTIME 106
177 /* (requires Winamp 1.60+)
178 ** SendMessage(hwnd_winamp,WM_WA_IPC,ms,IPC_JUMPTOTIME);
182 roytam 179 ** This api sets the current position (in milliseconds) for the currently playing song.
180 ** The resulting playback position may only be an approximate time since some playback
181 ** formats do not provide exact seeking e.g. mp3
182 ** This returns -1 if Winamp is not playing, 1 on end of file, or 0 if it was successful.
181 roytam 183 */
184  
182 roytam 185  
181 roytam 186 #define IPC_GETMODULENAME 109
187 #define IPC_EX_ISRIGHTEXE 666
188 /* usually shouldnt bother using these, but here goes:
189 ** send a WM_COPYDATA with IPC_GETMODULENAME, and an internal
190 ** flag gets set, which if you send a normal WM_WA_IPC message with
191 ** IPC_EX_ISRIGHTEXE, it returns whether or not that filename
192 ** matches. lame, I know.
193 */
194  
182 roytam 195  
181 roytam 196 #define IPC_WRITEPLAYLIST 120
197 /* (requires Winamp 1.666+)
182 roytam 198 ** int cur = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_WRITEPLAYLIST);
181 roytam 199 **
182 roytam 200 ** IPC_WRITEPLAYLIST will write the current playlist to '<winampdir>\\Winamp.m3u' and
201 ** will also return the current playlist position (see IPC_GETLISTPOS).
202 **
203 ** This is kinda obsoleted by some of the newer 2.x api items but it still is good for
204 ** use with a front-end program (instead of a plug-in) and you want to see what is in the
205 ** current playlist.
206 **
207 ** This api will only save out extended file information in the #EXTINF entry if Winamp
208 ** has already read the data such as if the file was played of scrolled into view. If
209 ** Winamp has not read the data then you will only find the file with its filepath entry
210 ** (as is the base requirements for a m3u playlist).
181 roytam 211 */
212  
213  
214 #define IPC_SETPLAYLISTPOS 121
215 /* (requires Winamp 2.0+)
216 ** SendMessage(hwnd_winamp,WM_WA_IPC,position,IPC_SETPLAYLISTPOS)
182 roytam 217 ** IPC_SETPLAYLISTPOS sets the playlist position to the specified 'position'.
218 ** It will not change playback status or anything else. It will just set the current
219 ** position in the playlist and will update the playlist view if necessary.
220 **
221 ** If you use SendMessage(hwnd_winamp,WM_COMMAND,MAKEWPARAM(WINAMP_BUTTON2,0),0);
222 ** after using IPC_SETPLAYLISTPOS then Winamp will start playing the file at 'position'.
181 roytam 223 */
224  
225  
226 #define IPC_SETVOLUME 122
227 /* (requires Winamp 2.0+)
228 ** SendMessage(hwnd_winamp,WM_WA_IPC,volume,IPC_SETVOLUME);
182 roytam 229 ** IPC_SETVOLUME sets the volume of Winamp (between the range of 0 to 255).
230 **
231 ** If you pass 'volume' as -666 then the message will return the current volume.
232 ** int curvol = SendMessage(hwnd_winamp,WM_WA_IPC,-666,IPC_SETVOLUME);
181 roytam 233 */
234  
235  
182 roytam 236 #define IPC_GETVOLUME(hwnd_winamp) SendMessage(hwnd_winamp,WM_WA_IPC,-666,IPC_SETVOLUME)
237 /* (requires Winamp 2.0+)
238 ** int curvol = IPC_GETVOLUME(hwnd_winamp);
239 ** This will return the current volume of Winamp or
240 */
241  
242  
181 roytam 243 #define IPC_SETPANNING 123
244 /* (requires Winamp 2.0+)
245 ** SendMessage(hwnd_winamp,WM_WA_IPC,panning,IPC_SETPANNING);
182 roytam 246 ** IPC_SETPANNING sets the panning of Winamp from 0 (left) to 255 (right).
247 **
248 ** At least in 5.x+ this works from -127 (left) to 127 (right).
249 **
250 ** If you pass 'panning' as -666 to this api then it will return the current panning.
251 ** int curpan = SendMessage(hwnd_winamp,WM_WA_IPC,-666,IPC_SETPANNING);
181 roytam 252 */
253  
254  
255 #define IPC_GETLISTLENGTH 124
256 /* (requires Winamp 2.0+)
257 ** int length = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTLENGTH);
182 roytam 258 ** IPC_GETLISTLENGTH returns the length of the current playlist as the number of tracks.
181 roytam 259 */
260  
261  
262 #define IPC_GETLISTPOS 125
263 /* (requires Winamp 2.05+)
264 ** int pos=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS);
182 roytam 265 ** IPC_GETLISTPOS returns the current playlist position (which is shown in the playlist
266 ** editor as a differently coloured text entry e.g is yellow for the classic skin).
267 **
268 ** This api is a lot like IPC_WRITEPLAYLIST but a lot faster since it does not have to
269 ** write out the whole of the current playlist first.
181 roytam 270 */
271  
272  
273 #define IPC_GETINFO 126
274 /* (requires Winamp 2.05+)
275 ** int inf=SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETINFO);
276 ** IPC_GETINFO returns info about the current playing song. The value
277 ** it returns depends on the value of 'mode'.
278 ** Mode      Meaning
279 ** ------------------
182 roytam 280 ** 0         Samplerate, in kilohertz (i.e. 44)
181 roytam 281 ** 1         Bitrate  (i.e. 128)
282 ** 2         Channels (i.e. 2)
283 ** 3 (5+)    Video LOWORD=w HIWORD=h
284 ** 4 (5+)    > 65536, string (video description)
182 roytam 285 ** 5 (5.25+) Samplerate, in hertz (i.e. 44100)
181 roytam 286 */
287  
288  
289 #define IPC_GETEQDATA 127
290 /* (requires Winamp 2.05+)
291 ** int data=SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA);
292 ** IPC_GETEQDATA queries the status of the EQ.
293 ** The value returned depends on what 'pos' is set to:
294 ** Value      Meaning
295 ** ------------------
296 ** 0-9        The 10 bands of EQ data. 0-63 (+20db - -20db)
297 ** 10         The preamp value. 0-63 (+20db - -20db)
298 ** 11         Enabled. zero if disabled, nonzero if enabled.
299 ** 12         Autoload. zero if disabled, nonzero if enabled.
300 */
301  
302  
303 #define IPC_SETEQDATA 128
304 /* (requires Winamp 2.05+)
305 ** SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA);
306 ** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SETEQDATA);
307 ** IPC_SETEQDATA sets the value of the last position retrieved
308 ** by IPC_GETEQDATA. This is pretty lame, and we should provide
309 ** an extended version that lets you do a MAKELPARAM(pos,value).
310 ** someday...
311  
312   new (2.92+):
313     if the high byte is set to 0xDB, then the third byte specifies
314     which band, and the bottom word specifies the value.
315 */
316  
182 roytam 317  
181 roytam 318 #define IPC_ADDBOOKMARK 129
182 roytam 319 #define IPC_ADDBOOKMARKW 131
181 roytam 320 /* (requires Winamp 2.4+)
182 roytam 321 ** This is sent as a WM_COPYDATA using IPC_ADDBOOKMARK as the dwData value and the
322 ** directory you want to change to as the lpData member. This will add the specified
323 ** file / url to the Winamp bookmark list.
324 **
325 ** COPYDATASTRUCT cds = {0};
326 **   cds.dwData = IPC_ADDBOOKMARK;
327 **   cds.lpData = (void*)"http://www.blah.com/listen.pls";
328 **   cds.cbData = lstrlen((char*)cds.lpData)+1; // include space for null char
329 **   SendMessage(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
330 **
331 **
332 ** In Winamp 5.0+ we use this as a normal WM_WA_IPC and the string is null separated as
333 ** the filename and then the title of the entry.
334 **
335 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(char*)"filename\0title\0",IPC_ADDBOOKMARK);
336 **
337 ** This will notify the library / bookmark editor that a bookmark was added.
338 ** Note that using this message in this context does not actually add the bookmark.
339 ** Do not use, it is essentially just a notification type message :)
181 roytam 340 */
341  
342  
343 #define IPC_INSTALLPLUGIN 130
182 roytam 344 /* This is not implemented (and is very unlikely to be done due to safety concerns).
345 ** If it was then you could do a WM_COPYDATA with a path to a .wpz and it would then
346 ** install the plugin for you.
347 **
348 ** COPYDATASTRUCT cds = {0};
349 **   cds.dwData = IPC_INSTALLPLUGIN;
350 **   cds.lpData = (void*)"c:\\path\\to\\file.wpz";
351 **   cds.cbData = lstrlen((char*)cds.lpData)+1; // include space for null char
352 **   SendMessage(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
181 roytam 353 */
354  
355  
356 #define IPC_RESTARTWINAMP 135
357 /* (requires Winamp 2.2+)
358 ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_RESTARTWINAMP);
182 roytam 359 ** IPC_RESTARTWINAMP will restart Winamp (isn't that obvious ? :) )
360 ** If this fails to make Winamp start after closing then there is a good chance one (or
361 ** more) of the currently installed plugins caused Winamp to crash on exit (either as a
362 ** silent crash or a full crash log report before it could call itself start again.
181 roytam 363 */
364  
365  
366 #define IPC_ISFULLSTOP 400
367 /* (requires winamp 2.7+ I think)
182 roytam 368 ** int ret=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISFULLSTOP);
369 ** This is useful for when you're an output plugin and you want to see if the stop/close
370 ** happening is a full stop or if you are just between tracks. This returns non zero if
371 ** it is a full stop or zero if it is just a new track.
372 ** benski> i think it's actually the other way around -
373 **         !0 for EOF and 0 for user pressing stop
181 roytam 374 */
375  
376  
377 #define IPC_INETAVAILABLE 242
378 /* (requires Winamp 2.05+)
182 roytam 379 ** int val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_INETAVAILABLE);
380 ** IPC_INETAVAILABLE will return 1 if an Internet connection is available for Winamp and
381 ** relates to the internet connection type setting on the main general preferences page
382 ** in the Winamp preferences.
181 roytam 383 */
384  
385  
386 #define IPC_UPDTITLE 243
387 /* (requires Winamp 2.2+)
388 ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_UPDTITLE);
182 roytam 389 ** IPC_UPDTITLE will ask Winamp to update the information about the current title and
390 ** causes GetFileInfo(..) in the input plugin associated with the current playlist entry
391 ** to be called. This can be called such as when an input plugin is buffering a file so
392 ** that it can cause the buffer percentage to appear in the playlist.
181 roytam 393 */
394  
395  
396 #define IPC_REFRESHPLCACHE 247
397 /* (requires Winamp 2.2+)
398 ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_REFRESHPLCACHE);
182 roytam 399 ** IPC_REFRESHPLCACHE will flush the playlist cache buffer and you send this if you want
400 ** Winamp to go refetch the titles for all of the entries in the current playlist.
401 **
402 ** 5.3+: pass a wchar_t * string in wParam, and it'll do a strnicmp() before clearing the cache
181 roytam 403 */
404  
405  
406 #define IPC_GET_SHUFFLE 250
407 /* (requires Winamp 2.4+)
182 roytam 408 ** int val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_SHUFFLE);
409 ** IPC_GET_SHUFFLE returns the status of the shuffle option.
410 ** If set then it will return 1 and if not set then it will return 0.
181 roytam 411 */
412  
413  
414 #define IPC_GET_REPEAT 251
415 /* (requires Winamp 2.4+)
182 roytam 416 ** int val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_REPEAT);
417 ** IPC_GET_REPEAT returns the status of the repeat option.
418 ** If set then it will return 1 and if not set then it will return 0.
181 roytam 419 */
420  
421  
422 #define IPC_SET_SHUFFLE 252
423 /* (requires Winamp 2.4+)
424 ** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_SHUFFLE);
182 roytam 425 ** IPC_SET_SHUFFLE sets the status of the shuffle option.
426 ** If 'value' is 1 then shuffle is turned on.
427 ** If 'value' is 0 then shuffle is turned off.
181 roytam 428 */
429  
430  
431 #define IPC_SET_REPEAT 253
432 /* (requires Winamp 2.4+)
433 ** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_REPEAT);
182 roytam 434 ** IPC_SET_REPEAT sets the status of the repeat option.
435 ** If 'value' is 1 then shuffle is turned on.
436 ** If 'value' is 0 then shuffle is turned off.
181 roytam 437 */
438  
439  
440 #define IPC_ENABLEDISABLE_ALL_WINDOWS 259 // 0xdeadbeef to disable
441 /* (requires Winamp 2.9+)
182 roytam 442 ** SendMessage(hwnd_winamp,WM_WA_IPC,(enable?0:0xdeadbeef),IPC_ENABLEDISABLE_ALL_WINDOWS);
443 ** Sending this message with 0xdeadbeef as the param will disable all winamp windows and
444 ** any other values will enable all of the Winamp windows again. When disabled you won't
445 ** get any response on clicking or trying to do anything to the Winamp windows. If the
446 ** taskbar icon is shown then you may still have control ;)
181 roytam 447 */
448  
449  
450 #define IPC_GETWND 260
451 /* (requires Winamp 2.9+)
452 ** HWND h=SendMessage(hwnd_winamp,WM_WA_IPC,IPC_GETWND_xxx,IPC_GETWND);
453 ** returns the HWND of the window specified.
454 */
455   #define IPC_GETWND_EQ 0 // use one of these for the param
456   #define IPC_GETWND_PE 1
457   #define IPC_GETWND_MB 2
458   #define IPC_GETWND_VIDEO 3
459 #define IPC_ISWNDVISIBLE 261 // same param as IPC_GETWND
460  
461  
462 /************************************************************************
463 ***************** in-process only (WE LOVE PLUGINS)
464 ************************************************************************/
465  
182 roytam 466 #define IPC_SETSKINW 199
181 roytam 467 #define IPC_SETSKIN 200
468 /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
469 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)"skinname",IPC_SETSKIN);
470 ** IPC_SETSKIN sets the current skin to "skinname". Note that skinname
471 ** can be the name of a skin, a skin .zip file, with or without path.
472 ** If path isn't specified, the default search path is the winamp skins
473 ** directory.
474 */
475  
476  
477 #define IPC_GETSKIN 201
182 roytam 478 #define IPC_GETSKINW 1201
181 roytam 479 /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
480 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)skinname_buffer,IPC_GETSKIN);
481 ** IPC_GETSKIN puts the directory where skin bitmaps can be found
482 ** into  skinname_buffer.
483 ** skinname_buffer must be MAX_PATH characters in length.
484 ** When using a .zip'd skin file, it'll return a temporary directory
485 ** where the ZIP was decompressed.
486 */
487  
488  
489 #define IPC_EXECPLUG 202
490 /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
491 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)"vis_file.dll",IPC_EXECPLUG);
492 ** IPC_EXECPLUG executes a visualization plug-in pointed to by WPARAM.
493 ** the format of this string can be:
494 ** "vis_whatever.dll"
495 ** "vis_whatever.dll,0" // (first mod, file in winamp plug-in dir)
496 ** "C:\\dir\\vis_whatever.dll,1"
497 */
498  
499  
500 #define IPC_GETPLAYLISTFILE 211
182 roytam 501 #define IPC_GETPLAYLISTFILEW 214
181 roytam 502 /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
503 ** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTFILE);
504 ** IPC_GETPLAYLISTFILE gets the filename of the playlist entry [index].
505 ** returns a pointer to it. returns NULL on error.
506 */
507  
508  
509 #define IPC_GETPLAYLISTTITLE 212
182 roytam 510 #define IPC_GETPLAYLISTTITLEW 213
181 roytam 511 /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
512 ** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTTITLE);
513 **
514 ** IPC_GETPLAYLISTTITLE gets the title of the playlist entry [index].
515 ** returns a pointer to it. returns NULL on error.
516 */
517  
518  
519 #define IPC_GETHTTPGETTER 240
520 /* retrieves a function pointer to a HTTP retrieval function.
521 ** if this is unsupported, returns 1 or 0.
522 ** the function should be:
523 ** int (*httpRetrieveFile)(HWND hwnd, char *url, char *file, char *dlgtitle);
524 ** if you call this function, with a parent window, a URL, an output file, and a dialog title,
525 ** it will return 0 on successful download, 1 on error.
526 */
527  
528  
182 roytam 529 #define IPC_GETHTTPGETTERW 1240
530 /* int (*httpRetrieveFileW)(HWND hwnd, char *url, wchar_t *file, wchar_t *dlgtitle); */
531  
532  
181 roytam 533 #define IPC_MBOPEN 241
534 /* (requires Winamp 2.05+)
535 ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_MBOPEN);
536 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPEN);
537 ** IPC_MBOPEN will open a new URL in the minibrowser. if url is NULL, it will open the Minibrowser window.
538 */
539  
540  
541 #define IPC_CHANGECURRENTFILE 245
542 /* (requires Winamp 2.05+)
543 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_CHANGECURRENTFILE);
544 ** IPC_CHANGECURRENTFILE will set the current playlist item.
545 */
546  
547  
182 roytam 548 #define IPC_CHANGECURRENTFILEW 1245
549 /* (requires Winamp 5.3+)
550 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_CHANGECURRENTFILEW);
551 ** IPC_CHANGECURRENTFILEW will set the current playlist item.
552 */
553  
554  
181 roytam 555 #define IPC_GETMBURL 246
556 /* (requires Winamp 2.2+)
557 ** char buffer[4096]; // Urls can be VERY long
558 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)buffer,IPC_GETMBURL);
559 ** IPC_GETMBURL will retrieve the current Minibrowser URL into buffer.
560 ** buffer must be at least 4096 bytes long.
561 */
562  
563  
564 #define IPC_MBBLOCK 248
565 /* (requires Winamp 2.4+)
566 ** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_MBBLOCK);
567 **
568 ** IPC_MBBLOCK will block the Minibrowser from updates if value is set to 1
569 */
570  
182 roytam 571  
181 roytam 572 #define IPC_MBOPENREAL 249
573 /* (requires Winamp 2.4+)
574 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPENREAL);
575 **
576 ** IPC_MBOPENREAL works the same as IPC_MBOPEN except that it will works even if
577 ** IPC_MBBLOCK has been set to 1
578 */
579  
182 roytam 580  
181 roytam 581 #define IPC_ADJUST_OPTIONSMENUPOS 280
582 /* (requires Winamp 2.9+)
583 ** int newpos=SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)adjust_offset,IPC_ADJUST_OPTIONSMENUPOS);
584 ** moves where winamp expects the Options menu in the main menu. Useful if you wish to insert a
585 ** menu item above the options/skins/vis menus.
586 */
587  
182 roytam 588  
181 roytam 589 #define IPC_GET_HMENU 281
590 /* (requires Winamp 2.9+)
591 ** HMENU hMenu=SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)0,IPC_GET_HMENU);
592 ** values for data:
593 ** 0 : main popup menu
594 ** 1 : main menubar file menu
595 ** 2 : main menubar options menu
596 ** 3 : main menubar windows menu
597 ** 4 : main menubar help menu
598 ** other values will return NULL.
599 */
600  
182 roytam 601  
181 roytam 602 #define IPC_GET_EXTENDED_FILE_INFO 290 //pass a pointer to the following struct in wParam
603 #define IPC_GET_EXTENDED_FILE_INFO_HOOKABLE 296
604 /* (requires Winamp 2.9+)
605 ** to use, create an extendedFileInfoStruct, point the values filename and metadata to the
606 ** filename and metadata field you wish to query, and ret to a buffer, with retlen to the
607 ** length of that buffer, and then SendMessage(hwnd_winamp,WM_WA_IPC,&struct,IPC_GET_EXTENDED_FILE_INFO);
608 ** the results should be in the buffer pointed to by ret.
609 ** returns 1 if the decoder supports a getExtendedFileInfo method
610 */
611 typedef struct {
182 roytam 612   const char *filename;
613   const char *metadata;
181 roytam 614   char *ret;
182 roytam 615   size_t retlen;
181 roytam 616 } extendedFileInfoStruct;
617  
182 roytam 618  
181 roytam 619 #define IPC_GET_BASIC_FILE_INFO 291 //pass a pointer to the following struct in wParam
620 typedef struct {
182 roytam 621   const char *filename;
181 roytam 622  
623   int quickCheck; // set to 0 to always get, 1 for quick, 2 for default (if 2, quickCheck will be set to 0 if quick wasnot used)
624  
625   // filled in by winamp
626   int length;
627   char *title;
628   int titlelen;
629 } basicFileInfoStruct;
630  
182 roytam 631  
632 #define IPC_GET_BASIC_FILE_INFOW 1291 //pass a pointer to the following struct in wParam
633 typedef struct {
634   const wchar_t *filename;
635  
636   int quickCheck; // set to 0 to always get, 1 for quick, 2 for default (if 2, quickCheck will be set to 0 if quick wasnot used)
637  
638   // filled in by winamp
639   int length;
640   wchar_t *title;
641   int titlelen;
642 } basicFileInfoStructW;
643  
644  
181 roytam 645 #define IPC_GET_EXTLIST 292 //returns doublenull delimited. GlobalFree() it when done. if data is 0, returns raw extlist, if 1, returns something suitable for getopenfilename
182 roytam 646 #define IPC_GET_EXTLISTW 1292 // wide char version of above
181 roytam 647  
182 roytam 648  
181 roytam 649 #define IPC_INFOBOX 293
650 typedef struct {
651   HWND parent;
652   char *filename;
653 } infoBoxParam;
654  
182 roytam 655  
656 #define IPC_INFOBOXW 1293
657 typedef struct {
658   HWND parent;
659   const wchar_t *filename;
660 } infoBoxParamW;
661  
662  
181 roytam 663 #define IPC_SET_EXTENDED_FILE_INFO 294 //pass a pointer to the a extendedFileInfoStruct in wParam
664 /* (requires Winamp 2.9+)
665 ** to use, create an extendedFileInfoStruct, point the values filename and metadata to the
666 ** filename and metadata field you wish to write in ret. (retlen is not used). and then
667 ** SendMessage(hwnd_winamp,WM_WA_IPC,&struct,IPC_SET_EXTENDED_FILE_INFO);
668 ** returns 1 if the metadata is supported
669 ** Call IPC_WRITE_EXTENDED_FILE_INFO once you're done setting all the metadata you want to update
670 */
671  
182 roytam 672  
181 roytam 673 #define IPC_WRITE_EXTENDED_FILE_INFO 295
674 /* (requires Winamp 2.9+)
675 ** writes all the metadata set thru IPC_SET_EXTENDED_FILE_INFO to the file
676 ** returns 1 if the file has been successfully updated, 0 if error
677 */
678  
182 roytam 679  
181 roytam 680 #define IPC_FORMAT_TITLE 297
681 typedef struct
682 {
683   char *spec; // NULL=default winamp spec
684   void *p;
685  
686   char *out;
687   int out_len;
688  
182 roytam 689   char * (*TAGFUNC)(const char * tag, void * p); //return 0 if not found
181 roytam 690   void (*TAGFREEFUNC)(char * tag,void * p);
691 } waFormatTitle;
692  
693  
182 roytam 694 #define IPC_FORMAT_TITLE_EXTENDED 298 // similiar to IPC_FORMAT_TITLE, but falls back to Winamp's %tags% if your passed tag function doesn't handle it
695 typedef struct
696 {
697   const wchar_t *filename;
698   int useExtendedInfo; // set to 1 if you want the Title Formatter to query the input plugins for any tags that your tag function fails on
699   const wchar_t *spec; // NULL=default winamp spec
700   void *p;
701  
702   wchar_t *out;
703   int out_len;
704  
705   wchar_t * (*TAGFUNC)(const wchar_t * tag, void * p); //return 0 if not found, -1 for empty tag
706   void (*TAGFREEFUNC)(wchar_t *tag, void *p);
707 } waFormatTitleExtended;
708  
709  
710 #define IPC_COPY_EXTENDED_FILE_INFO 299
711 typedef struct
712 {
713   const char *source;
714   const char *dest;
715 } copyFileInfoStruct;
716  
717  
718 #define IPC_COPY_EXTENDED_FILE_INFOW 1299
719 typedef struct
720 {
721   const wchar_t *source;
722   const wchar_t *dest;
723 } copyFileInfoStructW;
724  
725  
181 roytam 726 typedef struct {
727   int (*inflateReset)(void *strm);
728   int (*inflateInit_)(void *strm,const char *version, int stream_size);
729   int (*inflate)(void *strm, int flush);
730   int (*inflateEnd)(void *strm);
731   unsigned long (*crc32)(unsigned long crc, const unsigned  char *buf, unsigned int len);
732 } wa_inflate_struct;
733  
182 roytam 734 #define IPC_GETUNCOMPRESSINTERFACE 331
735 /* returns a function pointer to uncompress().
736 ** int (*uncompress)(unsigned char *dest, unsigned long *destLen, const unsigned char *source, unsigned long sourceLen);
737 ** right out of zlib, useful for decompressing zlibbed data.
738 ** if you pass the parm of 0x10100000, it will return a wa_inflate_struct * to an inflate API.
739 */
181 roytam 740  
182 roytam 741  
742 typedef struct _prefsDlgRec {
743   HINSTANCE hInst;  // dll instance containing the dialog resource
744   int dlgID;        // resource identifier of the dialog
745   void *proc;       // window proceedure for handling the dialog defined as
746                     // LRESULT CALLBACK PrefsPage(HWND,UINT,WPARAM,LPARAM)
747  
748   char *name;       // name shown for the prefs page in the treelist
749   intptr_t where;   // section in the treelist the prefs page is to be added to
750                     // 0 for General Preferences
751                     // 1 for Plugins
752                     // 2 for Skins
753                     // 3 for Bookmarks (no longer in the 5.0+ prefs)
754                     // 4 for Prefs     (the old 'Setup' section - no longer in 5.0+)
755  
756   intptr_t _id;
757   struct _prefsDlgRec *next; // no longer implemented as a linked list, now used by Winamp for other means
758 } prefsDlgRec;
759  
760 typedef struct _prefsDlgRecW {
761   HINSTANCE hInst;  // dll instance containing the dialog resource
762   int dlgID;        // resource identifier of the dialog
763   void *proc;       // window proceedure for handling the dialog defined as
764                     // LRESULT CALLBACK PrefsPage(HWND,UINT,WPARAM,LPARAM)
765  
766   wchar_t *name;    // name shown for the prefs page in the treelist
767   intptr_t where;   // section in the treelist the prefs page is to be added to
768                     // 0 for General Preferences
769                     // 1 for Plugins
770                     // 2 for Skins
771                     // 3 for Bookmarks (no longer in the 5.0+ prefs)
772                     // 4 for Prefs     (the old 'Setup' section - no longer in 5.0+)
773  
774   intptr_t _id;
775   struct _prefsDlgRec *next; // no longer implemented as a linked list, now used by Winamp for other means
776 } prefsDlgRecW;
777  
181 roytam 778 #define IPC_ADD_PREFS_DLG 332
182 roytam 779 #define IPC_ADD_PREFS_DLGW 1332
181 roytam 780 #define IPC_REMOVE_PREFS_DLG 333
781 /* (requires Winamp 2.9+)
182 roytam 782 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_ADD_PREFS_DLG);
783 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_REMOVE_PREFS_DLG);
181 roytam 784 **
182 roytam 785 ** IPC_ADD_PREFS_DLG:
786 ** To use this you need to allocate a prefsDlgRec structure (either on the heap or with
787 ** some global data but NOT on the stack) and then initialise the members of the structure
788 ** (see the definition of the prefsDlgRec structure above).
181 roytam 789 **
182 roytam 790 **   hInst  -  dll instance of where the dialog resource is located.
791 **   dlgID  -  id of the dialog resource.
792 **   proc   -  dialog window procedure for the prefs dialog.
793 **   name   -  name of the prefs page as shown in the preferences list.
794 **   where  -  see above for the valid locations the page can be added.
795 **
796 ** Then you do SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_ADD_PREFS_DLG);
797 **
798 ** example:
799 **
800 ** prefsDlgRec* prefsRec = 0;
801 **   prefsRec = GlobalAlloc(GPTR,sizeof(prefsDlgRec));
802 **   prefsRec->hInst = hInst;
803 **   prefsRec->dlgID = IDD_PREFDIALOG;
804 **   prefsRec->name = "Pref Page";
805 **   prefsRec->where = 0;
806 **   prefsRec->proc = PrefsPage;
807 **   SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_ADD_PREFS_DLG);
808 **
809 **
810 ** IPC_REMOVE_PREFS_DLG:
811 ** To use you pass the address of the same prefsRec you used when adding the prefs page
812 ** though you shouldn't really ever have to do this but it's good to clean up after you
813 ** when you're plugin is being unloaded.
814 **
815 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_REMOVE_PREFS_DLG);
816 **
817 ** IPC_ADD_PREFS_DLGW
818 ** requires Winamp 5.53+
181 roytam 819 */
820  
821  
182 roytam 822 #define IPC_OPENPREFSTOPAGE 380
823 /* SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_OPENPREFSTOPAGE);
824 **
825 ** There are two ways of opening a preferences page.
826 **
827 ** The first is to pass an id of a builtin preferences page (see below for ids) or a
828 ** &prefsDlgRec of the preferences page to open and this is normally done if you are
829 ** opening a prefs page you added yourself.
830 **
831 ** If the page id does not or the &prefsRec is not valid then the prefs dialog will be
832 ** opened to the first page available (usually the Winamp Pro page).
833 **
834 ** (requires Winamp 5.04+)
835 ** Passing -1 for param will open the preferences dialog to the last page viewed.
836 **
837 ** Note: v5.0 to 5.03 had a bug in this api
838 **      
839 ** On the first call then the correct prefs page would be opened to but on the next call
840 ** the prefs dialog would be brought to the front but the page would not be changed to the
841 ** specified.
842 ** In 5.04+ it will change to the prefs page specified if the prefs dialog is already open.
843 */
181 roytam 844  
182 roytam 845 /* Builtin Preference page ids (valid for 5.0+)
846 ** (stored in the lParam member of the TVITEM structure from the tree item)
847 **
848 ** These can be useful if you want to detect a specific prefs page and add things to it
849 ** yourself or something like that ;)
850 **
851 ** Winamp Pro           20
852 ** General Preferences  0
853 ** File Types           1
854 ** Playlist             23
855 ** Titles               21
856 ** Playback             42 (added in 5.25)
857 ** Station Info         41 (added in 5.11 & removed in 5.5)
858 ** Video                24
859 ** Localization         25 (added in 5.5)
860 ** Skins                40
861 ** Classic Skins        22
862 ** Plugins              30
863 ** Input                31
864 ** Output               32
865 ** Visualisation        33
866 ** DSP/Effect           34
867 ** General Purpose      35
868 **
869 ** Note:
870 ** Custom page ids begin from 60
871 ** The value of the normal custom pages (Global Hotkeys, Jump To File, etc) is not
872 ** guaranteed since it depends on the order in which the plugins are loaded which can
873 ** change on different systems.
874 **
875 ** Global Hotkeys, Jump To File, Media Library (under General Preferences and child pages),
876 ** Media Library (under Plugins), Portables, CD Ripping and Modern Skins are custom pages
877 ** created by the plugins shipped with Winamp.
878 */
181 roytam 879  
880  
182 roytam 881 #define IPC_GETINIFILE 334
882 /* (requires Winamp 2.9+)
883 ** char *ini=(char*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETINIFILE);
884 ** This returns a pointer to the full file path of winamp.ini.
885 **
886 ** char ini_path[MAX_PATH] = {0};
887 **
888 ** void GetIniFilePath(HWND hwnd){
889 **   if(SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION) >= 0x2900){
890 **     // this gets the string of the full ini file path
891 **     lstrcpyn(ini_path,(char*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETINIFILE),sizeof(ini_path));
892 **   }
893 **   else{
894 **   char* p = ini_path;
895 **     p += GetModuleFileName(0,ini_path,sizeof(ini_path)) - 1;
896 **     while(p && *p != '.'){p--;}
897 **     lstrcpyn(p+1,"ini",sizeof(ini_path));
898 **   }
899 ** }
900 */
181 roytam 901  
902  
182 roytam 903 #define IPC_GETINIDIRECTORY 335
904 /* (requires Winamp 2.9+)
905 ** char *dir=(char*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETINIDIRECTORY);
906 ** This returns a pointer to the directory where winamp.ini can be found and is
907 ** useful if you want store config files but you don't want to use winamp.ini.
908 */
909  
910  
911 #define IPC_GETPLUGINDIRECTORY 336
912 /* (requires Winamp 5.11+)
913 ** char *plugdir=(char*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETPLUGINDIRECTORY);
914 ** This returns a pointer to the directory where Winamp has its plugins stored and is
915 ** useful if you want store config files in plugins.ini in the plugins folder or for
916 ** accessing any local files in the plugins folder.
917 */
918  
919  
920 #define IPC_GETM3UDIRECTORY 337
921 /* (requires Winamp 5.11+)
922 ** char *m3udir=(char*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETM3UDIRECTORY);
923 ** This returns a pointer to the directory where winamp.m3u (and winamp.m3u8 if supported) is stored in.
924 */
925  
926  
927 #define IPC_GETM3UDIRECTORYW 338
928 /* (requires Winamp 5.3+)
929 ** wchar_t *m3udirW=(wchar_t*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETM3UDIRECTORYW);
930 ** This returns a pointer to the directory where winamp.m3u (and winamp.m3u8 if supported) is stored in.
931 */
932  
933  
181 roytam 934 #define IPC_SPAWNBUTTONPOPUP 361 // param =
935 // 0 = eject
936 // 1 = previous
937 // 2 = next
938 // 3 = pause
939 // 4 = play
940 // 5 = stop
941  
942  
182 roytam 943 #define IPC_OPENURLBOX 360
944 /* (requires Winamp 5.0+)
945 ** HGLOBAL hglobal = (HGLOBAL)SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)parent,IPC_OPENURLBOX);
946 ** You pass a hwnd for the dialog to be parented to (which modern skin support uses).
947 ** This will return a HGLOBAL that needs to be freed with GlobalFree() if this worked.
948 */
181 roytam 949  
950  
182 roytam 951 #define IPC_OPENFILEBOX 362
952 /* (requires Winamp 5.0+)
953 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)parent,IPC_OPENFILEBOX);
954 ** You pass a hwnd for the dialog to be parented to (which modern skin support uses).
955 */
181 roytam 956  
182 roytam 957  
958 #define IPC_OPENDIRBOX 363
959 /* (requires Winamp 5.0+)
960 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)parent,IPC_OPENDIRBOX);
961 ** You pass a hwnd for the dialog to be parented to (which modern skin support uses).
962 */
963  
964  
965 #define IPC_SETDIALOGBOXPARENT 364
966 /* (requires Winamp 5.0+)
967 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)parent,IPC_SETDIALOGBOXPARENT);
968 ** Pass 'parent' as the window which will be used as the parent for a number of the built
969 ** in Winamp dialogs and is useful when you are taking over the whole of the UI so that
970 ** the dialogs will not appear at the bottom right of the screen since the main winamp
971 ** window is located at 3000x3000 by gen_ff when this is used.  Call this again with
972 ** parent = null to reset the parent back to the orginal Winamp window.
973 */
974  
975 #define IPC_GETDIALOGBOXPARENT 365
976 /* (requires Winamp 5.51+)
977 ** HWND hwndParent = SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)0, IPC_GETDIALOGBOXPARENT);
978 ** hwndParent can/must be passed to all modal dialogs (including MessageBox) thats uses winamp as a parent
979 */
980  
981 #define IPC_UPDATEDIALOGBOXPARENT 366
982 /* (requires Winamp 5.53+)
983 ** if you previous called IPC_SETDIALOGBOXPARENT, call this every time your window resizes
984 */
985  
986 #define IPC_DRO_MIN 401 // reserved for DrO
987 #define IPC_SET_JTF_COMPARATOR 409
988 /* pass me an int (__cdecl *)(const char *, const char *) in wParam */
989 #define IPC_SET_JTF_COMPARATOR_W 410
990 /* pass me an int (__cdecl *)(const wchar_t *, const wchar_t *) in wParam ... maybe someday :) */
991 #define IPC_SET_JTF_DRAWTEXT 416
992  
993 #define IPC_DRO_MAX 499
994  
995  
181 roytam 996 // pass 0 for a copy of the skin HBITMAP
997 // pass 1 for name of font to use for playlist editor likeness
998 // pass 2 for font charset
999 // pass 3 for font size
1000 #define IPC_GET_GENSKINBITMAP 503
1001  
1002  
1003 typedef struct
1004 {
1005   HWND me; //hwnd of the window
1006  
182 roytam 1007   #define EMBED_FLAGS_NORESIZE 0x1
1008   // set this bit to keep window from being resizable
181 roytam 1009  
182 roytam 1010   #define EMBED_FLAGS_NOTRANSPARENCY 0x2
1011   // set this bit to make gen_ff turn transparency off for this window
181 roytam 1012  
182 roytam 1013   #define EMBED_FLAGS_NOWINDOWMENU 0x4
1014   // set this bit to prevent gen_ff from automatically adding your window to the right-click menu
181 roytam 1015  
182 roytam 1016   #define EMBED_FLAGS_GUID 0x8
1017   // (5.31+) call SET_EMBED_GUID(yourEmbedWindowStateStruct, GUID) to define a GUID for this window
1018  
1019   #define SET_EMBED_GUID(windowState, windowGUID) { windowState->flags |= EMBED_FLAGS_GUID; *((GUID *)&windowState->extra_data[4])=windowGUID; }
1020   #define GET_EMBED_GUID(windowState) (*((GUID *)&windowState->extra_data[4]))
1021  
1022   int flags;  // see above
1023  
1024   RECT r;
1025   void *user_ptr;       // for application use
1026   int extra_data[64];   // for internal winamp use
181 roytam 1027 } embedWindowState;
1028  
182 roytam 1029 #define IPC_GET_EMBEDIF 505
1030 /* (requires Winamp 2.9+)
1031 ** HWND myframe = (HWND)SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&wa_wnd,IPC_GET_EMBEDIF);
1032 **
1033 ** or
1034 **
1035 ** HWND myframe = 0;
1036 ** HWND (*embed)(embedWindowState *params)=0;
1037 **   *(void**)&embed = (void*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_EMBEDIF);
1038 **   myframe = embed(&wa_wnd);
1039 **
1040 ** You pass an embedWindowState* and it will return a hwnd for the frame window or if you
1041 ** pass wParam as null then it will return a HWND embedWindow(embedWindowState *);
1042 */
181 roytam 1043  
182 roytam 1044 #define IPC_SKINWINDOW  534
181 roytam 1045  
182 roytam 1046 typedef struct __SKINWINDOWPARAM
1047 {
1048         HWND hwndToSkin;
1049         GUID windowGuid;
1050 } SKINWINDOWPARAM;
1051  
1052  
1053  
181 roytam 1054 #define IPC_EMBED_ENUM 532
1055 typedef struct embedEnumStruct
1056 {
1057   int (*enumProc)(embedWindowState *ws, struct embedEnumStruct *param); // return 1 to abort
1058   int user_data; // or more :)
1059 } embedEnumStruct;
1060   // pass
1061  
182 roytam 1062  
181 roytam 1063 #define IPC_EMBED_ISVALID 533
182 roytam 1064 /* (requires Winamp 2.9+)
1065 ** int valid = SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)embedhwnd,IPC_EMBED_ISVALID);
1066 ** Pass a hwnd in the wParam to this to check if the hwnd is a valid embed window or not.
1067 */
181 roytam 1068  
182 roytam 1069  
181 roytam 1070 #define IPC_CONVERTFILE 506
1071 /* (requires Winamp 2.92+)
1072 ** Converts a given file to a different format (PCM, MP3, etc...)
1073 ** To use, pass a pointer to a waFileConvertStruct struct
1074 ** This struct can be either on the heap or some global
1075 ** data, but NOT on the stack. At least, until the conversion is done.
1076 **
1077 ** eg: SendMessage(hwnd_winamp,WM_WA_IPC,&myConvertStruct,IPC_CONVERTFILE);
1078 **
1079 ** Return value:
1080 ** 0: Can't start the conversion. Look at myConvertStruct->error for details.
1081 ** 1: Conversion started. Status messages will be sent to the specified callbackhwnd.
1082 **    Be sure to call IPC_CONVERTFILE_END when your callback window receives the
1083 **    IPC_CB_CONVERT_DONE message.
1084 */
1085 typedef struct
1086 {
1087   char *sourcefile;  // "c:\\source.mp3"
1088   char *destfile;    // "c:\\dest.pcm"
182 roytam 1089   intptr_t destformat[8]; // like 'PCM ',srate,nch,bps.
1090   //hack alert! you can set destformat[6]=mmioFOURCC('I','N','I',' '); and destformat[7]=(int)my_ini_file; (where my_ini_file is a char*)
181 roytam 1091   HWND callbackhwnd; // window that will receive the IPC_CB_CONVERT notification messages
1092  
1093   //filled in by winamp.exe
1094   char *error;        //if IPC_CONVERTFILE returns 0, the reason will be here
1095  
1096   int bytes_done;     //you can look at both of these values for speed statistics
1097   int bytes_total;
1098   int bytes_out;
1099  
1100   int killswitch;     // don't set it manually, use IPC_CONVERTFILE_END
182 roytam 1101   intptr_t extra_data[64]; // for internal winamp use
181 roytam 1102 } convertFileStruct;
1103  
182 roytam 1104  
1105 #define IPC_CONVERTFILEW 515
1106 // (requires Winamp 5.36+)
1107 typedef struct
1108 {
1109   wchar_t *sourcefile;  // "c:\\source.mp3"
1110   wchar_t *destfile;    // "c:\\dest.pcm"
1111   intptr_t destformat[8]; // like 'PCM ',srate,nch,bps.
1112   //hack alert! you can set destformat[6]=mmioFOURCC('I','N','I',' '); and destformat[7]=(int)my_ini_file; (where my_ini_file is a char*)
1113   HWND callbackhwnd; // window that will receive the IPC_CB_CONVERT notification messages
1114  
1115   //filled in by winamp.exe
1116   wchar_t *error;        //if IPC_CONVERTFILE returns 0, the reason will be here
1117  
1118   int bytes_done;     //you can look at both of these values for speed statistics
1119   int bytes_total;
1120   int bytes_out;
1121  
1122   int killswitch;     // don't set it manually, use IPC_CONVERTFILE_END
1123   intptr_t extra_data[64]; // for internal winamp use
1124 } convertFileStructW;
1125  
1126  
181 roytam 1127 #define IPC_CONVERTFILE_END 507
1128 /* (requires Winamp 2.92+)
1129 ** Stop/ends a convert process started from IPC_CONVERTFILE
1130 ** You need to call this when you receive the IPC_CB_CONVERTDONE message or when you
1131 ** want to abort a conversion process
1132 **
1133 ** eg: SendMessage(hwnd_winamp,WM_WA_IPC,&myConvertStruct,IPC_CONVERTFILE_END);
1134 **
1135 ** No return value
1136 */
1137  
182 roytam 1138  
1139 #define IPC_CONVERTFILEW_END 516
1140 // (requires Winamp 5.36+)
1141  
181 roytam 1142 typedef struct {
1143   HWND hwndParent;
1144   int format;
1145  
1146   //filled in by winamp.exe
1147   HWND hwndConfig;
1148   int extra_data[8];
182 roytam 1149   //hack alert! you can set extra_data[6]=mmioFOURCC('I','N','I',' '); and extra_data[7]=(int)my_ini_file; (where my_ini_file is a char*)
181 roytam 1150 } convertConfigStruct;
182 roytam 1151  
1152  
181 roytam 1153 #define IPC_CONVERT_CONFIG 508
1154 #define IPC_CONVERT_CONFIG_END 509
1155  
1156 typedef struct
1157 {
182 roytam 1158   void (*enumProc)(intptr_t user_data, const char *desc, int fourcc);
1159   intptr_t user_data;
181 roytam 1160 } converterEnumFmtStruct;
1161 #define IPC_CONVERT_CONFIG_ENUMFMTS 510
1162 /* (requires Winamp 2.92+)
1163 */
1164  
1165 typedef struct
1166 {
1167   char cdletter;
1168   char *playlist_file;
1169   HWND callback_hwnd;
1170  
1171   //filled in by winamp.exe
1172   char *error;
1173 } burnCDStruct;
1174 #define IPC_BURN_CD 511
1175 /* (requires Winamp 5.0+)
1176 */
1177  
1178 typedef struct
1179 {
1180   convertFileStruct *cfs;
1181   int priority;
1182 } convertSetPriority;
182 roytam 1183  
1184  
181 roytam 1185 #define IPC_CONVERT_SET_PRIORITY 512
1186  
1187 typedef struct
1188 {
182 roytam 1189   convertFileStructW *cfs;
1190   int priority;
1191 } convertSetPriorityW;
1192  
1193  
1194 #define IPC_CONVERT_SET_PRIORITYW 517
1195 // (requires Winamp 5.36+)
1196  
1197 typedef struct
1198 {
1199   unsigned int format; //fourcc value
1200   char *item; // config item, eg "bitrate"
1201   char *data; // buffer to recieve, or buffer that contains the data
1202   int len; // length of the data buffer (only used when getting a config item)
1203   char *configfile; // config file to read from
1204 } convertConfigItem;
1205  
1206  
1207 #define IPC_CONVERT_CONFIG_SET_ITEM 513 // returns TRUE if successful
1208 #define IPC_CONVERT_CONFIG_GET_ITEM 514 // returns TRUE if successful
1209  
1210  
1211 typedef struct
1212 {
1213   const char *filename;
181 roytam 1214   char *title; // 2048 bytes
1215   int length;
1216   int force_useformatting; // can set this to 1 if you want to force a url to use title formatting shit
1217 } waHookTitleStruct;
182 roytam 1218  
181 roytam 1219 #define IPC_HOOK_TITLES 850
182 roytam 1220 /* (requires Winamp 5.0+)
1221 ** If you hook this message and modify the information then make sure to return TRUE.
1222 ** If you don't hook the message then make sure you pass it on through the subclass chain.
1223 **
1224 ** LRESULT CALLBACK WinampWndProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
1225 ** {
1226 **   LRESULT ret = CallWindowProc((WNDPROC)WinampProc,hwnd,umsg,wParam,lParam);
1227 **
1228 **   if(message==WM_WA_IPC && lParam==IPC_HOOK_TITLES)
1229 **   {
1230 **     waHookTitleStruct *ht = (waHookTitleStruct *) wParam;
1231 **     // Doing ATF stuff with ht->title, whatever...
1232 **     return TRUE;
1233 **   }
1234 **   return ret;
1235 ** }
1236 */
181 roytam 1237  
182 roytam 1238 typedef struct
1239 {
1240   const wchar_t *filename;
1241   wchar_t *title; // 2048 characters
1242   int length;
1243   int force_useformatting; // can set this to 1 if you want to force a url to use title formatting shit
1244 } waHookTitleStructW;
1245 #define IPC_HOOK_TITLESW 851
1246 /* (requires Winamp 5.3+)
1247 ** See information on IPC_HOOK_TITLES for how to process this.
1248 */
1249  
1250  
181 roytam 1251 #define IPC_GETSADATAFUNC 800
1252 // 0: returns a char *export_sa_get() that returns 150 bytes of data
1253 // 1: returns a export_sa_setreq(int want);
1254  
182 roytam 1255  
1256 #define IPC_GETVUDATAFUNC 801
1257 // 0: returns a int export_vu_get(int channel) that returns 0-255 (or -1 for bad channel)
1258  
1259  
181 roytam 1260 #define IPC_ISMAINWNDVISIBLE 900
182 roytam 1261 /* (requires Winamp 5.0+)
1262 ** int visible=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISMAINWNDVISIBLE);
1263 ** You send this to Winamp to query if the main window is visible or not such as by
1264 ** unchecking the option in the main right-click menu. If the main window is visible then
1265 ** this will return 1 otherwise it returns 0.
1266 */
181 roytam 1267  
1268  
1269 typedef struct
1270 {
1271   int numElems;
1272   int *elems;
1273   HBITMAP bm; // set if you want to override
1274 } waSetPlColorsStruct;
1275  
182 roytam 1276 #define IPC_SETPLEDITCOLORS 920
1277 /* (requires Winamp 5.0+)
1278 ** This is sent by gen_ff when a modern skin is being loaded to set the colour scheme for
1279 ** the playlist editor. When sent numElems is usually 6 and matches with the 6 possible
1280 ** colours which are provided be pledit.txt from the classic skins. The elems array is
1281 ** defined as follows:
1282 **
1283 ** elems = 0  =>  normal text
1284 ** elems = 1  =>  current text
1285 ** elems = 2  =>  normal background
1286 ** elems = 3  =>  selected background
1287 ** elems = 4  =>  minibroswer foreground
1288 ** elems = 5  =>  minibroswer background
1289 **
1290 ** if(uMsg == WM_WA_IPC && lParam == IPC_SETPLEDITCOLORS)
1291 ** {
1292 **   waSetPlColorsStruct* colStr = (waSetPlColorsStruct*)wp;
1293 **   if(colStr)
1294 **   {
1295 **      // set or inspect the colours being used (basically for gen_ff's benefit)
1296 **   }
1297 ** }
1298 */
181 roytam 1299  
1300  
1301 typedef struct
1302 {
1303   HWND wnd;
1304   int xpos; // in screen coordinates
1305   int ypos;
1306 } waSpawnMenuParms;
1307  
1308 // waSpawnMenuParms2 is used by the menubar submenus
1309 typedef struct
1310 {
1311   HWND wnd;
1312   int xpos; // in screen coordinates
1313   int ypos;
1314   int width;
1315   int height;
1316 } waSpawnMenuParms2;
1317  
182 roytam 1318 // the following IPC use waSpawnMenuParms as parameter
1319 #define IPC_SPAWNEQPRESETMENU 933
1320 #define IPC_SPAWNFILEMENU 934 //menubar
1321 #define IPC_SPAWNOPTIONSMENU 935 //menubar
1322 #define IPC_SPAWNWINDOWSMENU 936 //menubar
1323 #define IPC_SPAWNHELPMENU 937 //menubar
1324 #define IPC_SPAWNPLAYMENU 938 //menubar
1325 #define IPC_SPAWNPEFILEMENU 939 //menubar
1326 #define IPC_SPAWNPEPLAYLISTMENU 940 //menubar
1327 #define IPC_SPAWNPESORTMENU 941 //menubar
1328 #define IPC_SPAWNPEHELPMENU 942 //menubar
1329 #define IPC_SPAWNMLFILEMENU 943 //menubar
1330 #define IPC_SPAWNMLVIEWMENU 944 //menubar
1331 #define IPC_SPAWNMLHELPMENU 945 //menubar
1332 #define IPC_SPAWNPELISTOFPLAYLISTS 946
181 roytam 1333  
182 roytam 1334  
181 roytam 1335 #define WM_WA_SYSTRAY WM_USER+1
182 roytam 1336 /* This is sent by the system tray when an event happens (you might want to simulate it).
1337 **
1338 ** if(uMsg == WM_WA_SYSTRAY)
1339 ** {
1340 **   switch(lParam)
1341 **   {
1342 **     // process the messages sent from the tray
1343 **   }
1344 ** }
1345 */
181 roytam 1346  
182 roytam 1347  
181 roytam 1348 #define WM_WA_MPEG_EOF WM_USER+2
182 roytam 1349 /* Input plugins send this when they are done playing back the current file to inform
1350 ** Winamp or anyother installed plugins that the current
1351 **
1352 ** if(uMsg == WM_WA_MPEG_EOF)
1353 ** {
1354 **   // do what is needed here
1355 ** }
1356 */
181 roytam 1357  
1358  
1359 //// video stuff
1360  
1361 #define IPC_IS_PLAYING_VIDEO 501 // returns >1 if playing, 0 if not, 1 if old version (so who knows):)
1362 #define IPC_GET_IVIDEOOUTPUT 500 // see below for IVideoOutput interface
1363 #define VIDEO_MAKETYPE(A,B,C,D) ((A) | ((B)<<8) | ((C)<<16) | ((D)<<24))
1364 #define VIDUSER_SET_INFOSTRING 0x1000
1365 #define VIDUSER_GET_VIDEOHWND  0x1001
1366 #define VIDUSER_SET_VFLIP      0x1002
182 roytam 1367 #define VIDUSER_SET_TRACKSELINTERFACE 0x1003 // give your ITrackSelector interface as param2
1368 #define VIDUSER_OPENVIDEORENDERER 0x1004
1369 #define VIDUSER_CLOSEVIDEORENDERER 0x1005
1370 #define VIDUSER_GETPOPUPMENU 0x1006
1371 #define VIDUSER_SET_INFOSTRINGW 0x1007
181 roytam 1372  
182 roytam 1373 typedef struct
1374 {
1375   int w;
1376   int h;
1377   int vflip;
1378   double aspectratio;
1379   unsigned int fmt;
1380 } VideoOpenStruct;
1381  
181 roytam 1382 #ifndef NO_IVIDEO_DECLARE
1383 #ifdef __cplusplus
1384  
1385 class VideoOutput;
1386 class SubsItem;
1387  
182 roytam 1388 #ifndef _NSV_DEC_IF_H_
1389 struct YV12_PLANE {
1390   unsigned char* baseAddr;
1391   long rowBytes;
1392 } ;
181 roytam 1393  
182 roytam 1394 struct YV12_PLANES {
1395   YV12_PLANE y;
1396   YV12_PLANE u;
1397   YV12_PLANE v;
1398 };
1399 #endif
181 roytam 1400  
1401 class IVideoOutput
1402 {
1403   public:
1404     virtual ~IVideoOutput() { }
1405     virtual int open(int w, int h, int vflip, double aspectratio, unsigned int fmt)=0;
182 roytam 1406     virtual void setcallback(LRESULT (*msgcallback)(void *token, HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam), void *token) { (void)token; (void)msgcallback; /* to eliminate warning C4100 */ }
181 roytam 1407     virtual void close()=0;
1408     virtual void draw(void *frame)=0;
182 roytam 1409     virtual void drawSubtitle(SubsItem *item) {UNREFERENCED_PARAMETER(item);  }
1410     virtual void showStatusMsg(const char *text) {UNREFERENCED_PARAMETER(text);  }
181 roytam 1411     virtual int get_latency() { return 0; }
182 roytam 1412     virtual void notifyBufferState(int bufferstate) { UNREFERENCED_PARAMETER(bufferstate); } /* 0-255*/
1413         virtual INT_PTR extended(INT_PTR param1, INT_PTR param2, INT_PTR param3) { UNREFERENCED_PARAMETER(param1); UNREFERENCED_PARAMETER(param2); UNREFERENCED_PARAMETER(param3); return 0; } // Dispatchable, eat this!
1414 };
181 roytam 1415  
182 roytam 1416 class ITrackSelector
1417 {
1418   public:
1419     virtual int getNumAudioTracks()=0;
1420     virtual void enumAudioTrackName(int n, const char *buf, int size)=0;
1421     virtual int getCurAudioTrack()=0;
1422     virtual int getNumVideoTracks()=0;
1423     virtual void enumVideoTrackName(int n, const char *buf, int size)=0;
1424     virtual int getCurVideoTrack()=0;
1425  
1426     virtual void setAudioTrack(int n)=0;
1427     virtual void setVideoTrack(int n)=0;
181 roytam 1428 };
182 roytam 1429  
181 roytam 1430 #endif //cplusplus
1431 #endif//NO_IVIDEO_DECLARE
1432  
1433 // these messages are callbacks that you can grab by subclassing the winamp window
1434  
1435 // wParam =
1436 #define IPC_CB_WND_EQ 0 // use one of these for the param
1437 #define IPC_CB_WND_PE 1
1438 #define IPC_CB_WND_MB 2
1439 #define IPC_CB_WND_VIDEO 3
1440 #define IPC_CB_WND_MAIN 4
1441  
1442 #define IPC_CB_ONSHOWWND 600
1443 #define IPC_CB_ONHIDEWND 601
1444  
1445 #define IPC_CB_GETTOOLTIP 602
1446  
1447 #define IPC_CB_MISC 603
182 roytam 1448     #define IPC_CB_MISC_TITLE 0  // start of playing/stop/pause
181 roytam 1449     #define IPC_CB_MISC_VOLUME 1 // volume/pan
182 roytam 1450     #define IPC_CB_MISC_STATUS 2 // start playing/stop/pause/ffwd/rwd
181 roytam 1451     #define IPC_CB_MISC_EQ 3
1452     #define IPC_CB_MISC_INFO 4
1453     #define IPC_CB_MISC_VIDEOINFO 5
182 roytam 1454     #define IPC_CB_MISC_TITLE_RATING 6 // (5.5+ for when the rating is changed via the songticker menu on current file)
181 roytam 1455  
182 roytam 1456 /* Example of using IPC_CB_MISC_STATUS to detect the start of track playback with 5.x
1457 **
1458 ** if(lParam == IPC_CB_MISC && wParam == IPC_CB_MISC_STATUS)
1459 ** {
1460 **   if(SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISPLAYING) == 1 &&
1461 **      !SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETOUTPUTTIME))
1462 **   {
1463 **     char* file = (char*)SendMessage(hwnd_winamp,WM_WA_IPC,
1464 **                  SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS),IPC_GETPLAYLISTFILE);
1465 **     // only output if a valid file was found
1466 **     if(file)
1467 **     {
1468 **       MessageBox(hwnd_winamp,file,"starting",0);
1469 **       // or do something else that you need to do
1470 **     }
1471 **   }
1472 ** }
1473 */
1474  
1475  
181 roytam 1476 #define IPC_CB_CONVERT_STATUS 604 // param value goes from 0 to 100 (percent)
1477 #define IPC_CB_CONVERT_DONE   605
1478  
182 roytam 1479  
181 roytam 1480 #define IPC_ADJUST_FFWINDOWSMENUPOS 606
1481 /* (requires Winamp 2.9+)
1482 ** int newpos=SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)adjust_offset,IPC_ADJUST_FFWINDOWSMENUPOS);
182 roytam 1483 ** This will move where Winamp expects the freeform windows in the menubar windows main
1484 ** menu. This is useful if you wish to insert a menu item above extra freeform windows.
181 roytam 1485 */
1486  
182 roytam 1487  
181 roytam 1488 #define IPC_ISDOUBLESIZE 608
182 roytam 1489 /* (requires Winamp 5.0+)
1490 ** int dsize=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISDOUBLESIZE);
1491 ** You send this to Winamp to query if the double size mode is enabled or not.
1492 ** If it is on then this will return 1 otherwise it will return 0.
1493 */
181 roytam 1494  
182 roytam 1495  
181 roytam 1496 #define IPC_ADJUST_FFOPTIONSMENUPOS 609
1497 /* (requires Winamp 2.9+)
1498 ** int newpos=SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)adjust_offset,IPC_ADJUST_FFOPTIONSMENUPOS);
182 roytam 1499 ** moves where winamp expects the freeform preferences item in the menubar windows main
1500 ** menu. This is useful if you wish to insert a menu item above the preferences item.
1501 **
1502 ** Note: This setting was ignored by gen_ff until it was fixed in 5.1
1503 **       gen_ff would assume thatthe menu position was 11 in all cases and so when you
1504 **       had two plugins attempting to add entries into the main right click menu it
1505 **       would cause the 'colour themes' submenu to either be incorrectly duplicated or
1506 **       to just disappear.instead.
181 roytam 1507 */
1508  
1509  
182 roytam 1510 #define IPC_GETTIMEDISPLAYMODE 610
1511 /* (requires Winamp 5.0+)
1512 ** int mode=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETTIMEDISPLAYMODE);
1513 ** This will return the status of the time display i.e. shows time elapsed or remaining.
1514 ** This returns 0 if Winamp is displaying time elapsed or 1 for the time remaining.
1515 */
1516  
1517  
1518 #define IPC_SETVISWND 611
1519 /* (requires Winamp 5.0+)
1520 ** int viswnd=(HWND)SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)viswnd,IPC_SETVISWND);
1521 ** This allows you to set a window to receive the following message commands (which are
1522 ** used as part of the modern skin integration).
1523 ** When you have finished or your visualisation is closed then send wParam as zero to
1524 ** ensure that things are correctly tidied up.
1525 */
1526  
1527 /* The following messages are received as the LOWORD(wParam) of the WM_COMMAND message.
1528 ** See %SDK%\winamp\wa5vis.txt for more info about visualisation integration in Winamp.
1529 */
181 roytam 1530 #define ID_VIS_NEXT                     40382
1531 #define ID_VIS_PREV                     40383
1532 #define ID_VIS_RANDOM                   40384
1533 #define ID_VIS_FS                       40389
1534 #define ID_VIS_CFG                      40390
1535 #define ID_VIS_MENU                     40391
1536  
182 roytam 1537  
1538 #define IPC_GETVISWND 612
1539 /* (requires Winamp 5.0+)
1540 ** int viswnd=(HWND)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVISWND);
1541 ** This returns a HWND to the visualisation command handler window if set by IPC_SETVISWND.
1542 */
1543  
1544  
181 roytam 1545 #define IPC_ISVISRUNNING 613
182 roytam 1546 /* (requires Winamp 5.0+)
1547 ** int visrunning=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISVISRUNNING);
1548 ** This will return 1 if a visualisation is currently running and 0 if one is not running.
1549 */
1550  
1551  
181 roytam 1552 #define IPC_CB_VISRANDOM 628 // param is status of random
1553  
1554  
182 roytam 1555 #define IPC_SETIDEALVIDEOSIZE 614
1556 /* (requires Winamp 5.0+)
1557 ** This is sent by Winamp back to itself so it can be trapped and adjusted as needed with
1558 ** the desired width in HIWORD(wParam) and the desired height in LOWORD(wParam).
1559 **
1560 ** if(uMsg == WM_WA_IPC){
1561 **   if(lParam == IPC_SETIDEALVIDEOSIZE){
1562 **      wParam = MAKEWPARAM(height,width);
1563 **   }
1564 ** }
1565 */
1566  
1567  
181 roytam 1568 #define IPC_GETSTOPONVIDEOCLOSE 615
182 roytam 1569 /* (requires Winamp 5.0+)
1570 ** int sovc=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETSTOPONVIDEOCLOSE);
1571 ** This will return 1 if 'stop on video close' is enabled and 0 if it is disabled.
1572 */
1573  
1574  
181 roytam 1575 #define IPC_SETSTOPONVIDEOCLOSE 616
182 roytam 1576 /* (requires Winamp 5.0+)
1577 ** int sovc=SendMessage(hwnd_winamp,WM_WA_IPC,enabled,IPC_SETSTOPONVIDEOCLOSE);
1578 ** Set enabled to 1 to enable and 0 to disable the 'stop on video close' option.
1579 */
181 roytam 1580  
182 roytam 1581  
181 roytam 1582 typedef struct {
1583   HWND hwnd;
1584   int uMsg;
182 roytam 1585   WPARAM wParam;
1586   LPARAM lParam;
181 roytam 1587 } transAccelStruct;
1588  
1589 #define IPC_TRANSLATEACCELERATOR 617
182 roytam 1590 /* (requires Winamp 5.0+)
1591 ** (deprecated as of 5.53x+)
1592 */
181 roytam 1593  
1594 typedef struct {
1595   int cmd;
1596   int x;
1597   int y;
1598   int align;
1599 } windowCommand; // send this as param to an IPC_PLCMD, IPC_MBCMD, IPC_VIDCMD
1600  
182 roytam 1601  
181 roytam 1602 #define IPC_CB_ONTOGGLEAOT 618
1603  
182 roytam 1604  
181 roytam 1605 #define IPC_GETPREFSWND 619
182 roytam 1606 /* (requires Winamp 5.0+)
1607 ** HWND prefs = (HWND)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETPREFSWND);
1608 ** This will return a handle to the preferences dialog if it is open otherwise it will
1609 ** return zero. A simple check with the OS api IsWindow(..) is a good test if it's valid.
1610 **
1611 ** e.g.  this will open (or close if already open) the preferences dialog and show if we
1612 **       managed to get a valid
1613 ** SendMessage(hwnd_winamp,WM_COMMAND,MAKEWPARAM(WINAMP_OPTIONS_PREFS,0),0);
1614 ** MessageBox(hwnd_winamp,(IsWindow((HWND)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETPREFSWND))?"Valid":"Not Open"),0,MB_OK);
1615 */
181 roytam 1616  
1617  
182 roytam 1618 #define IPC_SET_PE_WIDTHHEIGHT 620
1619 /* (requires Winamp 5.0+)
1620 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&point,IPC_SET_PE_WIDTHHEIGHT);
1621 ** You pass a pointer to a POINT structure which holds the width and height and Winamp
1622 ** will set the playlist editor to that size (this is used by gen_ff on skin changes).
1623 ** There does not appear to be any bounds limiting with this so it is possible to create
1624 ** a zero size playlist editor window (which is a pretty silly thing to do).
1625 */
1626  
1627  
181 roytam 1628 #define IPC_GETLANGUAGEPACKINSTANCE 621
182 roytam 1629 /* (requires Winamp 5.0+)
1630 ** HINSTANCE hInst = (HINSTANCE)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLANGUAGEPACKINSTANCE);
1631 ** This will return the HINSTANCE to the currently used language pack file for winamp.exe
1632 **
1633 ** (5.5+)
1634 ** If you pass 1 in wParam then you will have zero returned if a language pack is in use.
1635 ** if(!SendMessage(hwnd_winamp,WM_WA_IPC,1,IPC_GETLANGUAGEPACKINSTANCE)){
1636 **   // winamp is currently using a language pack
1637 ** }
1638 **
1639 ** If you pass 2 in wParam then you will get the path to the language pack folder.
1640 ** wchar_t* lngpackfolder = (wchar_t*)SendMessage(hwnd_winamp,WM_WA_IPC,2,IPC_GETLANGUAGEPACKINSTANCE);
1641 **
1642 ** If you pass 3 in wParam then you will get the path to the currently extracted language pack.
1643 ** wchar_t* lngpack = (wchar_t*)SendMessage(hwnd_winamp,WM_WA_IPC,3,IPC_GETLANGUAGEPACKINSTANCE);
1644 **
1645 ** If you pass 4 in wParam then you will get the name of the currently used language pack.
1646 ** wchar_t* lngname = (char*)SendMessage(hwnd_winamp,WM_WA_IPC,4,IPC_GETLANGUAGEPACKINSTANCE);
1647 */
1648 #define LANG_IDENT_STR 0
1649 #define LANG_LANG_CODE 1
1650 #define LANG_COUNTRY_CODE 2
1651 /*
1652 ** (5.51+)
1653 ** If you pass 5 in LOWORD(wParam) then you will get the ident string/code string
1654 ** (based on the param passed in the HIWORD(wParam) of the currently used language pack.
1655 ** The string returned with LANG_IDENT_STR is used to represent the language that the
1656 ** language pack is intended for following ISO naming conventions for consistancy.
1657 **
1658 ** wchar_t* ident_str = (wchar_t*)SendMessage(hwnd_winamp,WM_WA_IPC,MAKEWPARAM(5,LANG_XXX),IPC_GETLANGUAGEPACKINSTANCE);
1659 **
1660 ** e.g.
1661 ** For the default language it will return the following for the different LANG_XXX codes
1662 **    LANG_IDENT_STR ->     "en-US" (max buffer size of this is 9 wchar_t)
1663 **    LANG_LANG_CODE ->     "en"    (language code)
1664 **    LANG_COUNTRY_CODE ->  "US"    (country code)
1665 **
1666 ** On pre 5.51 installs you can get LANG_IDENT_STR using the following method
1667 ** (you'll have to custom process the string returned if you want the langugage or country but that's easy ;) )
1668 **
1669 ** #define LANG_PACK_LANG_ID 65534 (if you don't have lang.h)
1670 ** HINSTANCE hInst = (HINSTANCE)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLANGUAGEPACKINSTANCE);
1671 ** TCHAR buffer[9] = {0};
1672 ** LoadString(hInst,LANG_PACK_LANG_ID,buffer,sizeof(buffer));
1673 **
1674 **
1675 **
1676 ** The following example shows how using the basic api will allow you to load the playlist
1677 ** context menu resource from the currently loaded language pack or it will fallback to
1678 ** the default winamp.exe instance.
1679 **
1680 ** HINSTANCE lang = (HINSTANCE)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLANGUAGEPACKINSTANCE);
1681 ** HMENU popup = GetSubMenu(GetSubMenu((LoadMenu(lang?lang:GetModuleHandle(0),MAKEINTRESOURCE(101))),2),5);
1682 **   // do processing as needed on the menu before displaying it
1683 **   TrackPopupMenuEx(orig,TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,rc.left,rc.bottom,hwnd_owner,0);
1684 **   DestroyMenu(popup);
1685 **
1686 ** If you need a specific menu handle then look at IPC_GET_HMENU for more information.
1687 */
181 roytam 1688  
182 roytam 1689  
181 roytam 1690 #define IPC_CB_PEINFOTEXT 622 // data is a string, ie: "04:21/45:02"
1691  
182 roytam 1692  
181 roytam 1693 #define IPC_CB_OUTPUTCHANGED 623 // output plugin was changed in config
1694  
182 roytam 1695  
181 roytam 1696 #define IPC_GETOUTPUTPLUGIN 625
182 roytam 1697 /* (requires Winamp 5.0+)
1698 ** char* outdll = (char*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETOUTPUTPLUGIN);
1699 ** This returns a string of the current output plugin's dll name.
1700 ** e.g. if the directsound plugin was selected then this would return 'out_ds.dll'.
1701 */
181 roytam 1702  
182 roytam 1703  
181 roytam 1704 #define IPC_SETDRAWBORDERS 626
182 roytam 1705 /* (requires Winamp 5.0+)
1706 ** SendMessage(hwnd_winamp,WM_WA_IPC,enabled,IPC_SETDRAWBORDERS);
1707 ** Set enabled to 1 to enable and 0 to disable drawing of the playlist editor and winamp
1708 ** gen class windows (used by gen_ff to allow it to draw its own window borders).
1709 */
1710  
1711  
181 roytam 1712 #define IPC_DISABLESKINCURSORS 627
182 roytam 1713 /* (requires Winamp 5.0+)
1714 ** SendMessage(hwnd_winamp,WM_WA_IPC,enabled,IPC_DISABLESKINCURSORS);
1715 ** Set enabled to 1 to enable and 0 to disable the use of skinned cursors.
1716 */
1717  
1718  
1719 #define IPC_GETSKINCURSORS 628
1720 /* (requires Winamp 5.36+)
1721 ** data = (WACURSOR)cursorId. (check wa_dlg.h for values)
1722 */
1723  
1724  
181 roytam 1725 #define IPC_CB_RESETFONT 629
1726  
1727  
182 roytam 1728 #define IPC_IS_FULLSCREEN 630
1729 /* (requires Winamp 5.0+)
1730 ** int val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_IS_FULLSCREEN);
1731 ** This will return 1 if the video or visualisation is in fullscreen mode or 0 otherwise.
1732 */
1733  
1734  
1735 #define IPC_SET_VIS_FS_FLAG 631
1736 /* (requires Winamp 5.0+)
1737 ** A vis should send this message with 1/as param to notify winamp that it has gone to or has come back from fullscreen mode
1738 */
1739  
1740  
181 roytam 1741 #define IPC_SHOW_NOTIFICATION 632
1742  
182 roytam 1743  
181 roytam 1744 #define IPC_GETSKININFO 633
182 roytam 1745 #define IPC_GETSKININFOW 1633
1746 /* (requires Winamp 5.0+)
1747 ** This is a notification message sent to the main Winamp window by itself whenever it
1748 ** needs to get information to be shown about the current skin in the 'Current skin
1749 ** information' box on the main Skins page in the Winamp preferences.
1750 **
1751 ** When this notification is received and the current skin is one you are providing the
1752 ** support for then you return a valid buffer for Winamp to be able to read from with
1753 ** information about it such as the name of the skin file.
1754 **
1755 ** if(uMsg == WM_WA_IPC && lParam == IPC_GETSKININFO){
1756 **   if(is_our_skin()){
1757 **      return is_our_skin_name();
1758 **   }
1759 ** }
1760 */
181 roytam 1761  
1762  
182 roytam 1763 #define IPC_GET_MANUALPLADVANCE 634
1764 /* (requires Winamp 5.03+)
1765 ** int val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_MANUALPLADVANCE);
1766 ** IPC_GET_MANUALPLADVANCE returns the status of the Manual Playlist Advance.
1767 ** If enabled this will return 1 otherwise it will return 0.
1768 */
1769  
1770  
1771 #define IPC_SET_MANUALPLADVANCE 635
1772 /* (requires Winamp 5.03+)
1773 ** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_MANUALPLADVANCE);
1774 ** IPC_SET_MANUALPLADVANCE sets the status of the Manual Playlist Advance option.
1775 ** Set value = 1 to turn it on and value = 0 to turn it off.
1776 */
1777  
1778  
1779 #define IPC_GET_NEXT_PLITEM 636
1780 /* (requires Winamp 5.04+)
1781 ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_EOF_GET_NEXT_PLITEM);
1782 **
1783 ** Sent to Winamp's main window when an item has just finished playback or the next
1784 ** button has been pressed and requesting the new playlist item number to go to.
1785 **
1786 ** Subclass this message in your application to return the new item number.
1787 ** Return -1 for normal Winamp operation (default) or the new item number in
1788 ** the playlist to be played instead of the originally selected next track.
1789 **
1790 ** This is primarily provided for the JTFE plugin (gen_jumpex.dll).
1791 */
1792  
1793  
1794 #define IPC_GET_PREVIOUS_PLITEM 637
1795 /* (requires Winamp 5.04+)
1796 ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_EOF_GET_PREVIOUS_PLITEM);
1797 **
1798 ** Sent to Winamp's main window when the previous button has been pressed and Winamp is
1799 ** requesting the new playlist item number to go to.
1800 **
1801 ** Return -1 for normal Winamp operation (default) or the new item number in
1802 ** the playlist to be played instead of the originally selected previous track.
1803 **
1804 ** This is primarily provided for the JTFE plugin (gen_jumpex.dll).
1805 */
1806  
1807  
1808 #define IPC_IS_WNDSHADE 638
1809 /* (requires Winamp 5.04+)
1810 ** int is_shaded=SendMessage(hwnd_winamp,WM_WA_IPC,wnd,IPC_IS_WNDSHADE);
1811 ** Pass 'wnd' as an id as defined for IPC_GETWND or pass -1 to query the status of the
1812 ** main window. This returns 1 if the window is in winshade mode and 0 if it is not.
1813 ** Make sure you only test for this on a 5.04+ install otherwise you get a false result.
1814 ** (See the notes about unhandled WM_WA_IPC messages).
1815 */
1816  
1817  
1818 #define IPC_SETRATING 639
1819 /* (requires Winamp 5.04+ with ML)
1820 ** int rating=SendMessage(hwnd_winamp,WM_WA_IPC,rating,IPC_SETRATING);
1821 ** This will allow you to set the 'rating' on the current playlist entry where 'rating'
1822 ** is an integer value from 0 (no rating) to 5 (5 stars).
1823 **
1824 ** The following example should correctly allow you to set the rating for any specified
1825 ** playlist entry assuming of course that you're trying to get a valid playlist entry.
1826 **
1827 ** void SetPlaylistItemRating(int item_to_set, int rating_to_set){
1828 ** int cur_pos=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS);
1829 **   SendMessage(hwnd_winamp,WM_WA_IPC,item_to_set,IPC_SETPLAYLISTPOS);
1830 **   SendMessage(hwnd_winamp,WM_WA_IPC,rating_to_set,IPC_SETRATING);
1831 **   SendMessage(hwnd_winamp,WM_WA_IPC,cur_pos,IPC_SETPLAYLISTPOS);
1832 ** }
1833 */
1834  
1835  
1836 #define IPC_GETRATING 640
1837 /* (requires Winamp 5.04+ with ML)
1838 ** int rating=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETRATING);
1839 ** This returns the current playlist entry's rating between 0 (no rating) to 5 (5 stars).
1840 **
1841 ** The following example should correctly allow you to get the rating for any specified
1842 ** playlist entry assuming of course that you're trying to get a valid playlist entry.
1843 **
1844 ** int GetPlaylistItemRating(int item_to_get, int rating_to_set){
1845 ** int cur_pos=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS), rating = 0;
1846 **   SendMessage(hwnd_winamp,WM_WA_IPC,item_to_get,IPC_SETPLAYLISTPOS);
1847 **   rating = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETRATING);
1848 **   SendMessage(hwnd_winamp,WM_WA_IPC,cur_pos,IPC_SETPLAYLISTPOS);
1849 **   return rating;
1850 ** }
1851 */
1852  
1853  
1854 #define IPC_GETNUMAUDIOTRACKS 641
1855 /* (requires Winamp 5.04+)
1856 ** int n = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETNUMAUDIOTRACKS);
1857 ** This will return the number of audio tracks available from the currently playing item.
1858 */
1859  
1860  
1861 #define IPC_GETNUMVIDEOTRACKS 642
1862 /* (requires Winamp 5.04+)
1863 ** int n = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETNUMVIDEOTRACKS);
1864 ** This will return the number of video tracks available from the currently playing item.
1865 */
1866  
1867  
1868 #define IPC_GETAUDIOTRACK 643
1869 /* (requires Winamp 5.04+)
1870 ** int cur = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETAUDIOTRACK);
1871 ** This will return the id of the current audio track for the currently playing item.
1872 */
1873  
1874  
1875 #define IPC_GETVIDEOTRACK 644
1876 /* (requires Winamp 5.04+)
1877 ** int cur = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVIDEOTRACK);
1878 ** This will return the id of the current video track for the currently playing item.
1879 */
1880  
1881  
1882 #define IPC_SETAUDIOTRACK 645
1883 /* (requires Winamp 5.04+)
1884 ** SendMessage(hwnd_winamp,WM_WA_IPC,track,IPC_SETAUDIOTRACK);
1885 ** This allows you to switch to a new audio track (if supported) in the current playing file.
1886 */
1887  
1888  
1889 #define IPC_SETVIDEOTRACK 646
1890 /* (requires Winamp 5.04+)
1891 ** SendMessage(hwnd_winamp,WM_WA_IPC,track,IPC_SETVIDEOTRACK);
1892 ** This allows you to switch to a new video track (if supported) in the current playing file.
1893 */
1894  
1895  
1896 #define IPC_PUSH_DISABLE_EXIT 647
1897 /* (requires Winamp 5.04+)
1898 ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_PUSH_DISABLE_EXIT);
1899 ** This will let you disable or re-enable the UI exit functions (close button, context
1900 ** menu, alt-f4). Remember to call IPC_POP_DISABLE_EXIT when you are done doing whatever
1901 ** was required that needed to prevent exit otherwise you have to kill the Winamp process.
1902 */
1903  
1904  
1905 #define IPC_POP_DISABLE_EXIT  648
1906 /* (requires Winamp 5.04+)
1907 ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_POP_DISABLE_EXIT);
1908 ** See IPC_PUSH_DISABLE_EXIT
1909 */
1910  
1911  
1912 #define IPC_IS_EXIT_ENABLED 649
1913 /* (requires Winamp 5.04+)
1914 ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_IS_EXIT_ENABLED);
1915 ** This will return 0 if the 'exit' option of Winamp's menu is disabled and 1 otherwise.
1916 */
1917  
1918  
1919 #define IPC_IS_AOT 650
1920 /* (requires Winamp 5.04+)
1921 ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_IS_AOT);
1922 ** This will return the status of the always on top flag.
1923 ** Note: This may not match the actual TOPMOST window flag while another fullscreen
1924 ** application is focused if the user has the 'Disable always on top while fullscreen
1925 ** applications are focused' option under the  General Preferences page is checked.
1926 */
1927  
1928  
1929 #define IPC_USES_RECYCLEBIN 651
1930 /* (requires Winamp 5.09+)
1931 ** int use_bin=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_USES_RECYCLEBIN);
1932 ** This will return 1 if the deleted file should be sent to the recycle bin or
1933 ** 0 if deleted files should be deleted permanently (default action for < 5.09).
1934 **
1935 ** Note: if you use this on pre 5.09 installs of Winamp then it will return 1 which is
1936 ** not correct but is due to the way that SendMessage(..) handles un-processed messages.
1937 ** Below is a quick case for checking if the returned value is correct.
1938 **
1939 ** if(SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_USES_RECYCLEBIN) &&
1940 **    SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION)>=0x5009)
1941 ** {
1942 **   // can safely follow the option to recycle the file
1943 ** }
1944 ** else
1945 *  {
1946 **   // need to do a permanent delete of the file
1947 ** }
1948 */
1949  
1950  
1951 #define IPC_FLUSHAUDITS 652
1952 /*
1953 ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_FLUSHAUDITS);
1954 **
1955 ** Will flush any pending audits in the global audits queue
1956 **
1957 */
1958  
1959 #define IPC_GETPLAYITEM_START 653
1960 #define IPC_GETPLAYITEM_END   654
1961  
1962  
1963 #define IPC_GETVIDEORESIZE 655
1964 #define IPC_SETVIDEORESIZE 656
1965  
1966  
1967 #define IPC_INITIAL_SHOW_STATE 657
1968 /* (requires Winamp 5.36+)
1969 ** int show_state = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_INITIAL_SHOW_STATE);
1970 ** returns the processed value of nCmdShow when Winamp was started
1971 ** (see MSDN documentation the values passed to WinMain(..) for what this should be)
1972 **
1973 ** e.g.
1974 ** if(SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_INITIAL_SHOW_STATE) == SW_SHOWMINIMIZED){
1975 **   // we are starting minimised so process as needed (keep our window hidden)
1976 ** }
1977 **
1978 ** Useful for seeing if winamp was run minimised on startup so you can act accordingly.
1979 ** On pre-5.36 versions this will effectively return SW_NORMAL/SW_SHOWNORMAL due to the
1980 ** handling of unknown apis returning 1 from Winamp.
1981 */
1982  
1983 // >>>>>>>>>>> Next is 658
1984  
181 roytam 1985 #define IPC_PLCMD  1000
1986  
1987 #define PLCMD_ADD  0
1988 #define PLCMD_REM  1
1989 #define PLCMD_SEL  2
1990 #define PLCMD_MISC 3
1991 #define PLCMD_LIST 4
1992  
182 roytam 1993 //#define IPC_MBCMD  1001
181 roytam 1994  
1995 #define MBCMD_BACK    0
1996 #define MBCMD_FORWARD 1
1997 #define MBCMD_STOP    2
1998 #define MBCMD_RELOAD  3
1999 #define MBCMD_MISC  4
2000  
2001 #define IPC_VIDCMD 1002
2002  
2003 #define VIDCMD_FULLSCREEN 0
2004 #define VIDCMD_1X         1
2005 #define VIDCMD_2X         2
2006 #define VIDCMD_LIB        3
2007 #define VIDPOPUP_MISC     4
2008  
182 roytam 2009 //#define IPC_MBURL       1003 //sets the URL
2010 //#define IPC_MBGETCURURL 1004 //copies the current URL into wParam (have a 4096 buffer ready)
2011 //#define IPC_MBGETDESC   1005 //copies the current URL description into wParam (have a 4096 buffer ready)
2012 //#define IPC_MBCHECKLOCFILE 1006 //checks that the link file is up to date (otherwise updates it). wParam=parent HWND
2013 //#define IPC_MBREFRESH   1007 //refreshes the "now playing" view in the library
2014 //#define IPC_MBGETDEFURL 1008 //copies the default URL into wParam (have a 4096 buffer ready)
181 roytam 2015  
2016 #define IPC_STATS_LIBRARY_ITEMCNT 1300 // updates library count status
2017  
182 roytam 2018 /*
2019 ** IPC's in the message range 2000 - 3000 are reserved internally for freeform messages.
2020 ** These messages are taken from ff_ipc.h which is part of the Modern skin integration.
2021 */
2022  
181 roytam 2023 #define IPC_FF_FIRST 2000
182 roytam 2024  
2025 #define IPC_FF_COLOURTHEME_CHANGE IPC_FF_ONCOLORTHEMECHANGED
2026 #define IPC_FF_ONCOLORTHEMECHANGED IPC_FF_FIRST + 3
2027 /*
2028 ** This is a notification message sent when the user changes the colour theme in a Modern
2029 ** skin and can also be detected when the Modern skin is first loaded as the gen_ff plugin
2030 ** applies relevant settings and styles (like the colour theme).
2031 **
2032 ** The value of wParam is the name of the new color theme being switched to.
2033 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(const char*)colour_theme_name,IPC_FF_ONCOLORTHEMECHANGED);
2034 **
2035 ** (IPC_FF_COLOURTHEME_CHANGE is the name i (DrO) was using before getting a copy of
2036 ** ff_ipc.h with the proper name in it).
2037 */
2038  
2039  
2040 #define IPC_FF_ISMAINWND IPC_FF_FIRST + 4
2041 /*
2042 ** int ismainwnd = (HWND)SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)test_wnd,IPC_FF_ISMAINWND);
2043 **
2044 ** This allows you to determine if the window handle passed to it is a modern skin main
2045 ** window or not. If it is a main window or any of its windowshade variants then it will
2046 ** return 1.
2047 **
2048 ** Because of the way modern skins are implemented, it is possible for this message to
2049 ** return a positive test result for a number of window handles within the current Winamp
2050 ** process. This appears to be because you can have a visible main window, a compact main
2051 ** window and also a winshaded version.
2052 **
2053 ** The following code example below is one way of seeing how this api works since it will
2054 ** enumerate all windows related to Winamp at the time and allows you to process as
2055 ** required when a detection happens.
2056 **
2057 **
2058 ** EnumThreadWindows(GetCurrentThreadId(),enumWndProc,0);
2059 **
2060 ** BOOL CALLBACK enumWndProc(HWND hwnd, LPARAM lParam){
2061 **
2062 **   if(SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)hwnd,IPC_FF_ISMAINWND)){
2063 **     // do processing in here
2064 **     // or continue the enum for other main windows (if they exist)
2065 **     // and just comment out the line below
2066 **     return 0;
2067 **   }
2068 **   return 1;
2069 ** }
2070 */
2071  
2072  
2073 #define IPC_FF_GETCONTENTWND IPC_FF_FIRST + 5
2074 /*
2075 ** HWND wa2embed = (HWND)SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)test_wnd,IPC_FF_GETCONTENTWND);
2076 **
2077 ** This will return the Winamp 2 window that is embedded in the window's container
2078 ** i.e. if hwnd is the playlist editor windowshade hwnd then it will return the Winamp 2
2079 **      playlist editor hwnd.
2080 **
2081 ** If no content is found such as the window has nothing embedded then this will return
2082 ** the hwnd passed to it.
2083 */
2084  
2085  
2086 #define IPC_FF_NOTIFYHOTKEY IPC_FF_FIRST + 6
2087 /*
2088 ** This is a notification message sent when the user uses a global hotkey combination
2089 ** which had been registered with the gen_hotkeys plugin.
2090 **
2091 ** The value of wParam is the description of the hotkey as passed to gen_hotkeys.
2092 ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(const char*)hotkey_desc,IPC_FF_NOTIFYHOTKEY);
2093 */
2094  
181 roytam 2095 #define IPC_FF_LAST  3000
2096  
182 roytam 2097  
2098 /*
2099 ** General IPC messages in Winamp
2100 **
2101 ** All notification messages appear in the lParam of the main window message proceedure.
2102 */
2103  
2104  
181 roytam 2105 #define IPC_GETDROPTARGET 3001
182 roytam 2106 /* (requires Winamp 5.0+)
2107 ** IDropTarget* IDrop = (IDropTarget*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETDROPTARGET);
2108 **
2109 ** You call this to retrieve a copy of the IDropTarget interface which Winamp created for
2110 ** handling external drag and drop operations on to it's Windows. This is only really
2111 ** useful if you're providing an alternate interface and want your Windows to provide the
2112 ** same drag and drop support as Winamp normally provides the user. Check out MSDN or
2113 ** your prefered search facility for more information about the IDropTarget interface and
2114 ** what's needed to handle it in your own instance.
2115 */
181 roytam 2116  
2117  
182 roytam 2118 #define IPC_PLAYLIST_MODIFIED 3002
2119 /* (requires Winamp 5.0+)
2120 ** This is a notification message sent to the main Winamp window whenever the playlist is
2121 ** modified in any way e.g. the addition/removal of a playlist entry.
2122 **
2123 ** It is not a good idea to do large amounts of processing in this notification since it
2124 ** will slow down Winamp as playlist entries are modified (especially when you're adding
2125 ** in a large playlist).
2126 **
2127 ** if(uMsg == WM_WA_IPC && lParam == IPC_PLAYLIST_MODIFIED)
2128 ** {
2129 **   // do what you need to do here
2130 ** }
2131 */
181 roytam 2132  
2133  
182 roytam 2134 #define IPC_PLAYING_FILE 3003
2135 /* (requires Winamp 5.0+)
2136 ** This is a notification message sent to the main Winamp window when playback begins for
2137 ** a file. This passes the full filepath in the wParam of the message received.
2138 **
2139 ** if(uMsg == WM_WA_IPC && lParam == IPC_PLAYING_FILE)
2140 ** {
2141 **   // do what you need to do here, e.g.
2142 **   process_file((char*)wParam);
2143 ** }
2144 */
2145  
2146  
2147 #define IPC_PLAYING_FILEW 13003
2148 /* (requires Winamp 5.0+)
2149 ** This is a notification message sent to the main Winamp window when playback begins for
2150 ** a file. This passes the full filepath in the wParam of the message received.
2151 **
2152 ** if(uMsg == WM_WA_IPC && lParam == IPC_PLAYING_FILEW)
2153 ** {
2154 **   // do what you need to do here, e.g.
2155 **   process_file((wchar_t*)wParam);
2156 ** }
2157 */
2158  
2159  
2160 #define IPC_FILE_TAG_MAY_HAVE_UPDATED 3004
2161 #define IPC_FILE_TAG_MAY_HAVE_UPDATEDW 3005
2162 /* (requires Winamp 5.0+)
2163 ** This is a notification message sent to the main Winamp window when a file's tag
2164 ** (e.g. id3) may have been updated. This appears to be sent when the InfoBox(..) function
2165 ** of the associated input plugin returns a 1 (which is the file information dialog/editor
2166 ** call normally).
2167 **
2168 ** if(uMsg == WM_WA_IPC && lParam == IPC_FILE_TAG_MAY_HAVE_UPDATED)
2169 ** {
2170 **   // do what you need to do here, e.g.
2171 **   update_info_on_file_update((char*)wParam);
2172 ** }
2173 */
2174  
2175  
181 roytam 2176 #define IPC_ALLOW_PLAYTRACKING 3007
182 roytam 2177 /* (requires Winamp 5.0+)
2178 ** SendMessage(hwnd_winamp,WM_WA_IPC,allow,IPC_ALLOW_PLAYTRACKING);
2179 ** Send allow as nonzero to allow play tracking and zero to disable the mode.
2180 */
181 roytam 2181  
2182  
182 roytam 2183 #define IPC_HOOK_OKTOQUIT 3010
2184 /* (requires Winamp 5.0+)
2185 ** This is a notification message sent to the main Winamp window asking if it's okay to
2186 ** close or not. Return zero to prevent Winamp from closing or return anything non-zero
2187 ** to allow Winamp to close.
2188 **
2189 ** The best implementation of this option is to let the message pass through to the
2190 ** original window proceedure since another plugin may want to have a say in the matter
2191 ** with regards to Winamp closing.
2192 **
2193 ** if(uMsg == WM_WA_IPC && lParam == IPC_HOOK_OKTOQUIT)
2194 ** {
2195 **   // do what you need to do here, e.g.
2196 **   if(no_shut_down())
2197 **   {
2198 **     return 1;
2199 **   }
2200 ** }
2201 */
181 roytam 2202  
2203  
182 roytam 2204 #define IPC_WRITECONFIG 3011
2205 /* (requires Winamp 5.0+)
2206 ** SendMessage(hwnd_winamp,WM_WA_IPC,write_type,IPC_WRITECONFIG);
2207 **
2208 ** Send write_type as 2 to write all config settings and the current playlist.
2209 **
2210 ** Send write_type as 1 to write the playlist and common settings.
2211 ** This won't save the following ini settings::
2212 **
2213 **   defext, titlefmt, proxy, visplugin_name, dspplugin_name, check_ft_startup,
2214 **   visplugin_num, pe_fontsize, visplugin_priority, visplugin_autoexec, dspplugin_num,
2215 **   sticon, splash, taskbar, dropaotfs, ascb_new, ttips, riol, minst, whichicon,
2216 **   whichicon2, addtolist, snap, snaplen, parent, hilite, disvis, rofiob, shownumsinpl,
2217 **   keeponscreen, eqdsize, usecursors, fixtitles, priority, shuffle_morph_rate,
2218 **   useexttitles, bifont, inet_mode, ospb, embedwnd_freesize, no_visseh
2219 ** (the above was valid for 5.1)
2220 **
2221 ** Send write_type as 0 to write the common and less common settings and no playlist.
2222 */
181 roytam 2223  
182 roytam 2224  
2225 #define IPC_UPDATE_URL 3012
2226 // pass the URL (char *) in lparam, will be free()'d on done.
2227  
2228  
2229 #define IPC_GET_RANDFUNC 3015 // returns a function to get a random number
2230 /* (requires Winamp 5.1+)
2231 ** int (*randfunc)(void) = (int(*)(void))SendMessage(plugin.hwndParent,WM_WA_IPC,0,IPC_GET_RANDFUNC);
2232 ** if(randfunc && randfunc != 1){
2233 **   randfunc();
2234 ** }
181 roytam 2235 **
182 roytam 2236 ** This will return a positive 32-bit number (essentially 31-bit).
2237 ** The check for a returned value of 1 is because that's the default return value from
2238 ** SendMessage(..) when it is not handled so is good to check for it in this situation.
181 roytam 2239 */
2240  
2241  
182 roytam 2242 #define IPC_METADATA_CHANGED 3017
2243 /* (requires Winamp 5.1+)
2244 ** int changed=SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(char*)field,IPC_METADATA_CHANGED);
2245 ** a plugin can SendMessage this to winamp if internal metadata has changes.
2246 ** wParam should be a char * of what field changed
2247 **
2248 ** Currently used for internal actions (and very few at that) the intent of this api is
2249 ** to allow a plugin to call it when metadata has changed in the current playlist entry
2250 ** e.g.a new id3v2 tag was found in a stream
2251 **
2252 ** The wparam value can either be NULL or a pointer to an ansi string for the metadata
2253 ** which has changed. This can be thought of as an advanced version of IPC_UPDTITLE and
2254 ** could be used to allow for update of the current title when a specific tag changed.
2255 **
2256 ** Not recommended to be used since there is not the complete handling implemented in
2257 ** Winamp for it at the moment.
2258 */
181 roytam 2259  
2260  
182 roytam 2261 #define IPC_SKIN_CHANGED 3018
2262 /* (requires Winamp 5.1+)
2263 ** This is a notification message sent to the main Winamp window by itself whenever
2264 ** the skin in use is changed. There is no information sent by the wParam for this.
2265 **
2266 ** if(message == WM_WA_IPC && lparam == IPC_SKIN_CHANGED)
2267 ** {
2268 **   // do what you need to do to handle skin changes, e.g. call WADlg_init(hwnd_winamp);
2269 ** }
2270 */
181 roytam 2271  
2272  
182 roytam 2273 #define IPC_REGISTER_LOWORD_COMMAND 3019
2274 /* (requires Winamp 5.1+)
2275 ** WORD id = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_REGISTER_LOWORD_COMMAND);
2276 ** This will assign you a unique id for making your own commands such as for extra menu
2277 ** entries. The starting value returned by this message will potentially change as and
2278 ** when the main resource file of Winamp is updated with extra data so assumptions cannot
2279 ** be made on what will be returned and plugin loading order will affect things as well.
181 roytam 2280  
182 roytam 2281 ** 5.33+
2282 ** If you want to reserve more than one id, you can pass the number of ids required in wParam
2283 */
2284  
2285  
2286 #define IPC_GET_DISPATCH_OBJECT 3020  // gets winamp main IDispatch * (for embedded webpages)
2287 #define IPC_GET_UNIQUE_DISPATCH_ID 3021 // gives you a unique dispatch ID that won't conflict with anything in winamp's IDispatch *
2288 #define IPC_ADD_DISPATCH_OBJECT 3022 // add your own dispatch object into winamp's.  This lets embedded webpages access your functions
2289 // pass a pointer to DispatchInfo (see below).  Winamp makes a copy of all this data so you can safely delete it later
2290 typedef struct
2291 {
2292   wchar_t *name; // filled in by plugin, make sure it's a unicode string!! (i.e. L"myObject" instead of "myObject).
2293   struct IDispatch *dispatch; // filled in by plugin
2294   DWORD id; // filled in by winamp on return
2295 } DispatchInfo;
2296  
2297 // see IPC_JSAPI2_GET_DISPATCH_OBJECT for version 2 of the Dispatchable scripting interface
2298  
2299 #define IPC_GET_PROXY_STRING 3023
2300 /* (requires Winamp 5.11+)
2301 ** char* proxy_string=(char*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_PROXY_STRING);
2302 ** This will return the same string as is shown on the General Preferences page.
2303 */
2304  
2305  
2306 #define IPC_USE_REGISTRY 3024
2307 /* (requires Winamp 5.11+)
2308 ** int reg_enabled=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_USE_REGISTRY);
2309 ** This will return 0 if you should leave your grubby hands off the registry (i.e. for
2310 ** lockdown mode). This is useful if Winamp is run from a USB drive and you can't alter
2311 ** system settings, etc.
2312 */
2313  
2314  
2315 #define IPC_GET_API_SERVICE 3025
2316 /* (requires Winamp 5.12+)
2317 ** api_service* api_service = (api_service)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_API_SERVICE);
2318 ** This api will return Winamp's api_service pointer (which is what Winamp3 used, heh).
2319 ** If this api is not supported in the Winamp version that is being used at the time then
2320 ** the returned value from this api will be 1 which is a good version check.
2321 **
2322 ** As of 5.12 there is support for .w5s plugins which reside in %WinampDir%\System and
2323 ** are intended for common code that can be shared amongst other plugins e.g. jnetlib.w5s
2324 ** which contains jnetlib in one instance instead of being duplicated multiple times in
2325 ** all of the plugins which need internet access.
2326 **
2327 ** Details on the .w5s specifications will come at some stage (possibly).
2328 */
2329  
2330  
2331 typedef struct {
2332   const wchar_t *filename;
2333   const wchar_t *metadata;
2334   wchar_t *ret;
2335   size_t retlen;
2336 } extendedFileInfoStructW;
2337  
2338 #define IPC_GET_EXTENDED_FILE_INFOW 3026
2339 /* (requires Winamp 5.13+)
2340 ** Pass a pointer to the above struct in wParam
2341 */
2342  
2343  
2344 #define IPC_GET_EXTENDED_FILE_INFOW_HOOKABLE 3027
2345 #define IPC_SET_EXTENDED_FILE_INFOW 3028
2346 /* (requires Winamp 5.13+)
2347 ** Pass a pointer to the above struct in wParam
2348 */
2349  
2350  
2351 #define IPC_PLAYLIST_GET_NEXT_SELECTED 3029
2352 /* (requires 5.2+)
2353 ** int pl_item = SendMessage(hwnd_winamp,WM_WA_IPC,start,IPC_PLAYLIST_GET_NEXT_SELECTED);
2354 **
2355 ** This works just like the ListView_GetNextItem(..) macro for ListView controls.
2356 ** 'start' is the index of the playlist item that you want to begin the search after or
2357 ** set this as -1 for the search to begin with the first item of the current playlist.
2358 **
2359 ** This will return the index of the selected playlist according to the 'start' value or
2360 ** it returns -1 if there is no selection or no more selected items according to 'start'.
2361 **
2362 ** Quick example:
2363 **
2364 ** int sel = -1;
2365 ** // keep incrementing the start of the search so we get all of the selected entries
2366 ** while((sel = SendMessage(hwnd_winamp,WM_WA_IPC,sel,IPC_PLAYLIST_GET_NEXT_SELECTED))!=-1){
2367 **   // show the playlist file entry of the selected item(s) if there were any
2368 **   MessageBox(hwnd_winamp,(char*)SendMessage(hwnd_winamp,WM_WA_IPC,sel,IPC_GETPLAYLISTFILE),0,0);
2369 ** }
2370 */
2371  
2372  
2373 #define IPC_PLAYLIST_GET_SELECTED_COUNT 3030
2374 /* (requires 5.2+)
2375 ** int selcnt = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_PLAYLIST_GET_SELECTED_COUNT);
2376 ** This will return the number of selected playlist entries.
2377 */
2378  
2379  
2380 #define IPC_GET_PLAYING_FILENAME 3031
2381 // returns wchar_t * of the currently playing filename
2382  
2383 #define IPC_OPEN_URL 3032
2384 // send either ANSI or Unicode string (it'll figure it out, but it MUST start with "h"!, so don't send ftp:// or anything funny)
2385 // you can also send this one from another process via WM_COPYDATA (unicode only)
2386  
2387  
2388 #define IPC_USE_UXTHEME_FUNC 3033
2389 /* (requires Winamp 5.35+)
2390 ** int ret = SendMessage(hwnd_winamp,WM_WA_IPC,param,IPC_USE_UXTHEME_FUNC);
2391 ** param can be IPC_ISWINTHEMEPRESENT or IPC_ISAEROCOMPOSITIONACTIVE or a valid hwnd.
2392 **
2393 ** If you pass a hwnd then it will apply EnableThemeDialogTexture(ETDT_ENABLETAB)
2394 ** so your tabbed dialogs can use the correct theme (on supporting OSes ie XP+).
2395 **
2396 ** Otherwise this will return a value based on the param passed (as defined below).
2397 ** For compatability, the return value will be zero on success (as 1 is returned
2398 ** for unsupported ipc calls on older Winamp versions)
2399 */
2400   #define IPC_ISWINTHEMEPRESENT 0
2401 /* This will return 0 if uxtheme.dll is present
2402 ** int isthemethere = !SendMessage(hwnd_winamp,WM_WA_IPC,IPC_ISWINTHEMEPRESENT,IPC_USE_UXTHEME_FUNC);
2403 */
2404   #define IPC_ISAEROCOMPOSITIONACTIVE 1
2405 /* This will return 0 if aero composition is active
2406 ** int isaero = !SendMessage(hwnd_winamp,WM_WA_IPC,IPC_ISAEROCOMPOSITIONACTIVE,IPC_USE_UXTHEME_FUNC);
2407 */
2408  
2409  
2410 #define IPC_GET_PLAYING_TITLE 3034
2411 // returns wchar_t * of the current title
2412  
2413  
2414 #define IPC_CANPLAY 3035
2415 // pass const wchar_t *, returns an in_mod * or 0
2416  
2417  
2418 typedef struct {
2419   // fill these in...
2420   size_t size; // init to sizeof(artFetchData)
2421   HWND parent; // parent window of the dialogue
2422  
2423   // fill as much of these in as you can, otherwise leave them 0
2424   const wchar_t *artist;
2425   const wchar_t *album;
2426   int year, amgArtistId, amgAlbumId;
2427  
2428   int showCancelAll; // if set to 1, this shows a "Cancel All" button on the dialogue
2429  
2430   // winamp will fill these in if the call returns successfully:
2431   void* imgData; // a buffer filled with compressed image data. free with WASABI_API_MEMMGR->sysFree()
2432   int imgDataLen; // the size of the buffer
2433   wchar_t type[10]; // eg: "jpg"
2434   const wchar_t *gracenoteFileId; // if you know it
2435 } artFetchData;
2436  
2437 #define IPC_FETCH_ALBUMART 3036
2438 /* pass an artFetchData*. This will show a dialog guiding the use through choosing art, and return when it's finished
2439 ** return values:
2440 ** 1: error showing dialog
2441 ** 0: success
2442 ** -1: cancel was pressed
2443 ** -2: cancel all was pressed
2444 */
2445  
2446 #define IPC_JSAPI2_GET_DISPATCH_OBJECT 3037
2447 /* pass your service's unique ID, as a wchar_t * string, in wParam
2448 ** Winamp will copy the string, so don't worry about keeping it around
2449 ** An IDispatch * object will be returned (cast the return value from SendMessage)
2450 ** This IDispatch can be used for scripting/automation/VB interaction
2451 ** Pass to IE via IDocHostUIHandler::GetExternal and it will become window.external in javscript
2452 */
2453  
2454 #define IPC_REGISTER_WINAMP_IPCMESSAGE 65536
2455 /* (requires Winamp 5.0+)
2456 ** DWORD id = SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)name,IPC_REGISTER_WINAMP_IPCMESSAGE);
2457 ** The value 'id' returned is > 65536 and is incremented on subsequent calls for unique
2458 ** 'name' values passed to it. By using the same 'name' in different plugins will allow a
2459 ** common runtime api to be provided for the currently running instance of Winamp
2460 ** e.g.
2461 **   PostMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)my_param,registered_ipc);
2462 ** Have a look at wa_hotkeys.h for an example on how this api is used in practice for a
2463 ** custom WM_WA_IPC message.
2464 **
2465 ** if(uMsg == WM_WA_IPC && lParam == id_from_register_winamp_ipcmessage){
2466 **   // do things
2467 ** }
2468 */
2469  
2470 #endif//_WA_IPC_H_