forked from hugovk/winamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wa_ipc.h
3227 lines (2669 loc) · 116 KB
/
wa_ipc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
** Copyright (C) 1997-2013 Nullsoft, Inc.
**
** This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held
** liable for any damages arising from the use of this software.
**
** Permission is granted to anyone to use this software for any purpose, including commercial applications, and to
** alter it and redistribute it freely, subject to the following restrictions:
**
** 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
** If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
**
** 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
**
** 3. This notice may not be removed or altered from any source distribution.
**
*/
#ifndef _WA_IPC_H_
#define _WA_IPC_H_
#include <windows.h>
#include <stddef.h>
#if (_MSC_VER <= 1200)
typedef int intptr_t;
#endif
/*
** This is the modern replacement for the classic 'frontend.h'. Most of these
** updates are designed for in-process use, i.e. from a plugin.
**
*/
/* Most of the IPC_* messages involve sending the message in the form of:
** result = SendMessage(hwnd_winamp,WM_WA_IPC,(parameter),IPC_*);
** Where different then this is specified (typically with WM_COPYDATA variants)
**
** When you use SendMessage(hwnd_winamp,WM_WA_IPC,(parameter),IPC_*) and specify a IPC_*
** which is not currently implemented/supported by the Winamp version being used then it
** will return 1 for 'result'. This is a good way of helping to check if an api being
** used which returns a function pointer, etc is even going to be valid.
*/
#ifndef FILENAME_SIZE
#define FILENAME_SIZE (MAX_PATH * 4)
#endif
#ifndef FILETITLE_SIZE
#define FILETITLE_SIZE 400
#endif
#define WM_WA_IPC WM_USER
/* but some of them use WM_COPYDATA. be afraid.
*/
/*
** IPC helper methods (start)
*/
#ifdef __cplusplus
#define SENDMSG(__hwnd, __msgId, __wParam, __lParam) ::SendMessageW((__hwnd), (__msgId), (__wParam), (__lParam))
#else
#define SENDMSG(__hwnd, __msgId, __wParam, __lParam) SendMessageW((__hwnd), (__msgId), (__wParam), (__lParam))
#endif // __cplusplus
#ifdef __cplusplus
#define POSTMSG(__hwnd, __msgId, __wParam, __lParam) ::PostMessageW((__hwnd), (__msgId), (__wParam), (__lParam))
#else
#define POSTMSG(__hwnd, __msgId, __wParam, __lParam) PostMessageW((__hwnd), (__msgId), (__wParam), (__lParam))
#endif // __cplusplus
#define SENDWAIPC(__hwndWA, __ipcMsgId, __param) SENDMSG((__hwndWA), WM_WA_IPC, (WPARAM)(__param), (LPARAM)(__ipcMsgId))
#define POSTWAIPC(__hwndWA, __ipcMsgId, __param) POSTMSG((__hwndWA), WM_WA_IPC, (WPARAM)(__param), (LPARAM)(__ipcMsgId))
#define SENDSKINIPC(__hwndWA, __ipcMsgId, __param) SENDMSG((__hwndWA), WM_WA_SKIN_IPC, (WPARAM)(__param), (LPARAM)(__ipcMsgId))
#define POSTSKINIPC(__hwndWA, __ipcMsgId, __param) POSTMSG((__hwndWA), WM_WA_SKIN_IPC, (WPARAM)(__param), (LPARAM)(__ipcMsgId))
/*
** IPC helper methods (end)
*/
#define WINAMP_VERSION_MAJOR(winampVersion) ((winampVersion & 0x0000FF00) >> 12)
#define WINAMP_VERSION_MINOR(winampVersion) (winampVersion & 0x000000FF) // returns, i.e. 0x12 for 5.12 and 0x10 for 5.1...
#define IPC_GETVERSION 0
/* int version = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION);
**
** The version returned will be 0x20yx for Winamp 2.yx.
** Versions previous to Winamp 2.0 typically (but not always) use 0x1zyx for 1.zx.
** Just a bit weird but that's the way it goes.
**
** For Winamp 5.x it uses the format 0x50yx for Winamp 5.yx
** e.g. 5.01 -> 0x5001
** 5.09 -> 0x5009
** 5.1 -> 0x5010
**
** Notes: For 5.02 this api will return the same value as for a 5.01 build.
** For 5.07 this api will return the same value as for a 5.06 build.
*/
#define IPC_GETVERSIONSTRING 1
#define IPC_GETREGISTEREDVERSION 770
/* (requires Winamp 5.0+)
** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETREGISTEREDVERSION);
**
** This will open the Winamp Preferences and show the Winamp Pro page.
*/
#define IPC_IS_SAFEMODE 999
/* (requires Winamp 5.64+)
** int res = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_IS_SAFEMODE);
**
** This will indicate if running in safe mode or not (only applies to native plugins).
** This returns:
** 0 if in safe mode
** 1 if in normal mode
** 2 if in safe mode and media library plug-ins are to be disabled
**
** Safe mode is used to disable 3rd party plugins to determine if they are the cause
** of stability issues and crashes for users experiencing issues without having to
** first remove plug-in dlls which is often found 'too hard' to do properly most times.
*/
typedef struct {
const char *filename;
const char *title;
int length;
} enqueueFileWithMetaStruct; // send this to a IPC_PLAYFILE in a non WM_COPYDATA,
// and you get the nice desired result. if title is NULL, it is treated as a "thing",
// otherwise it's assumed to be a file (for speed)
typedef struct {
const wchar_t *filename;
const wchar_t *title;
int length;
} enqueueFileWithMetaStructW;
#define IPC_PLAYFILE 100 // dont be fooled, this is really the same as enqueufile
#define IPC_ENQUEUEFILE 100
#define IPC_PLAYFILEW 1100
#define IPC_ENQUEUEFILEW 1100
/* This is sent as a WM_COPYDATA with IPC_PLAYFILE as the dwData member and the string
** of the file / playlist to be enqueued into the playlist editor as the lpData member.
** This will just enqueue the file or files since you can use this to enqueue a playlist.
** It will not clear the current playlist or change the playback state.
**
** COPYDATASTRUCT cds = {0};
** cds.dwData = IPC_ENQUEUEFILE;
** cds.lpData = (void*)"c:\\test\\folder\\test.mp3";
** cds.cbData = lstrlen((char*)cds.lpData)+1; // include space for null char
** SendMessage(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
**
**
** With 2.9+ and all of the 5.x versions you can send this as a normal WM_WA_IPC
** (non WM_COPYDATA) with an enqueueFileWithMetaStruct as the param.
** If the title member is null then it is treated as a "thing" otherwise it will be
** assumed to be a file (for speed).
**
** enqueueFileWithMetaStruct eFWMS = {0};
** eFWMS.filename = "c:\\test\\folder\\test.mp3";
** eFWMS.title = "Whipping Good";
** eFWMS.length = 300; // this is the number of seconds for the track
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&eFWMS,IPC_ENQUEUEFILE);
*/
#define IPC_DELETE 101
#define IPC_DELETE_INT 1101
/* SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_DELETE);
** Use this api to clear Winamp's internal playlist.
** You should not need to use IPC_DELETE_INT since it is used internally by Winamp when
** it is dealing with some lame Windows Explorer issues (hard to believe that!).
*/
#define IPC_STARTPLAY 102
#define IPC_STARTPLAY_INT 1102
/* SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_STARTPLAY);
** Sending this will start playback and is almost the same as hitting the play button.
** The IPC_STARTPLAY_INT version is used internally and you should not need to use it
** since it won't be any fun.
*/
#define IPC_CHDIR 103
/* This is sent as a WM_COPYDATA type message with IPC_CHDIR as the dwData value and the
** directory you want to change to as the lpData member.
**
** COPYDATASTRUCT cds = {0};
** cds.dwData = IPC_CHDIR;
** cds.lpData = (void*)"c:\\download";
** cds.cbData = lstrlen((char*)cds.lpData)+1; // include space for null char
** SendMessage(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
**
** The above example will make Winamp change to the directory 'C:\download'.
*/
#define IPC_ISPLAYING 104
/* int res = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISPLAYING);
** This is sent to retrieve the current playback state of Winamp.
** If it returns 1, Winamp is playing.
** If it returns 3, Winamp is paused.
** If it returns 0, Winamp is not playing.
*/
#define IPC_GETOUTPUTTIME 105
/* int res = SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETOUTPUTTIME);
** This api can return two different sets of information about current playback status.
**
** If mode = 0 then it will return the position (in ms) of the currently playing track.
** Will return -1 if Winamp is not playing.
**
** If mode = 1 then it will return the current track length (in seconds).
** Will return -1 if there are no tracks (or possibly if Winamp cannot get the length).
**
** If mode = 2 then it will return the current track length (in milliseconds).
** Will return -1 if there are no tracks (or possibly if Winamp cannot get the length).
*/
#define IPC_JUMPTOTIME 106
/* (requires Winamp 1.60+)
** SendMessage(hwnd_winamp,WM_WA_IPC,ms,IPC_JUMPTOTIME);
** This api sets the current position (in milliseconds) for the currently playing song.
** The resulting playback position may only be an approximate time since some playback
** formats do not provide exact seeking e.g. mp3
** This returns -1 if Winamp is not playing, 1 on end of file, or 0 if it was successful.
*/
#define IPC_GETMODULENAME 109
#define IPC_EX_ISRIGHTEXE 666
/* usually shouldnt bother using these, but here goes:
** send a WM_COPYDATA with IPC_GETMODULENAME, and an internal
** flag gets set, which if you send a normal WM_WA_IPC message with
** IPC_EX_ISRIGHTEXE, it returns whether or not that filename
** matches. lame, I know.
*/
#define IPC_WRITEPLAYLIST 120
/* (requires Winamp 1.666+)
** int cur = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_WRITEPLAYLIST);
**
** IPC_WRITEPLAYLIST will write the current playlist to winamp.m3u and on unicode clients
** it will also write the current playlist to winamp.m3u8. This will also return the
** current playlist position (see IPC_GETLISTPOS).
**
** Where the playlist(s) are saved to depends on the Winamp client version used though it
** is simple to find the path using the correct location (when working in-process):
**
** Pre 2.90 -> '<winampdir>\\Winamp.m3u'
** From 2.90 to 5.1 -> Use IPC_GETINIDIRECTORY
** From 5.11 -> Use IPC_GETM3UDIRECTORY
**
** If working from an external program then it is possible to work out the location of the
** playlist by reading relevant values out of paths.ini (if found) otherwise the pre 2.90
** behaviour is what will be attempted to be used (as Winamp does if there is any failure).
**
** This is kinda obsoleted by some of the newer 2.x api items but it still is good for
** use with a front-end program (instead of a plug-in) and you want to see what is in the
** current playlist.
**
** This api will only save out extended file information in the #EXTINF entry if Winamp
** has already read the data such as if the file was played of scrolled into view. If
** Winamp has not read the data then you will only find the file with its filepath entry
** (as is the base requirements for a m3u playlist).
*/
#define IPC_SETPLAYLISTPOS 121
/* (requires Winamp 2.0+)
** SendMessage(hwnd_winamp,WM_WA_IPC,position,IPC_SETPLAYLISTPOS)
** IPC_SETPLAYLISTPOS sets the playlist position to the specified 'position'.
** It will not change playback status or anything else. It will just set the current
** position in the playlist and will update the playlist view if necessary.
**
** If you use SendMessage(hwnd_winamp,WM_COMMAND,MAKEWPARAM(WINAMP_BUTTON2,0),0);
** after using IPC_SETPLAYLISTPOS then Winamp will start playing the file at 'position'.
*/
#define IPC_SETVOLUME 122
/* (requires Winamp 2.0+)
** SendMessage(hwnd_winamp,WM_WA_IPC,volume,IPC_SETVOLUME);
** IPC_SETVOLUME sets the volume of Winamp (between the range of 0 to 255).
**
** If you pass 'volume' as -666 then the message will return the current volume.
** int curvol = SendMessage(hwnd_winamp,WM_WA_IPC,-666,IPC_SETVOLUME);
*/
#define IPC_GETVOLUME(hwnd_winamp) SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)-666,IPC_SETVOLUME)
/* (requires Winamp 2.0+)
** int curvol = IPC_GETVOLUME(hwnd_winamp);
** This will return the current volume of Winamp (between the range of 0 to 255).
*/
#define IPC_SETPANNING 123
#define IPC_SETBALANCE 123
/* (requires Winamp 2.0+)
** SendMessage(hwnd_winamp,WM_WA_IPC,panning,IPC_SETPANNING);
** IPC_SETPANNING sets the panning of Winamp from 0 (left) to 255 (right).
**
** At least in 5.x+ this works from -127 (left) to 127 (right).
**
** If you pass 'panning' as -666 to this api then it will return the current panning.
** int curpan = SendMessage(hwnd_winamp,WM_WA_IPC,-666,IPC_SETPANNING);
*/
#define IPC_GETPANNING(hwnd_winamp) SendMessage(hwnd_winamp,WM_WA_IPC,-666,IPC_SETPANNING)
#define IPC_GETBALANCE(hwnd_winamp) SendMessage(hwnd_winamp,WM_WA_IPC,-666,IPC_SETBALANCE)
/* (requires Winamp 2.0+)
** int curpan = IPC_GETPANNING(hwnd_winamp);
** This will return the current panning level of Winamp (5.x) from -127 (left) to 127 (right)
** or from 0 (left) to 255 (right) on older client versions.
*/
#define IPC_GETLISTLENGTH 124
/* (requires Winamp 2.0+)
** int length = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTLENGTH);
** IPC_GETLISTLENGTH returns the length of the current playlist as the number of tracks.
*/
#define IPC_GETLISTPOS 125
/* (requires Winamp 2.05+)
** int pos=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS);
** IPC_GETLISTPOS returns the current playlist position (which is shown in the playlist
** editor as a differently coloured text entry e.g is yellow for the classic skin).
**
** This api is a lot like IPC_WRITEPLAYLIST but a lot faster since it does not have to
** write out the whole of the current playlist first.
*/
#define IPC_GETNEXTLISTPOS 136
/* (requires Winamp 5.61+)
** int pos=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETNEXTLISTPOS);
** IPC_GETNEXTLISTPOS returns the next playlist position expected to be played from the
** current playlist and allows for determining the next playlist item to be played even
** if shuffle mode (see IPC_GET_SHUFFLE) is enabled at the time of using this api.
**
** If there is no known next playlist item then this will return -1 i.e. if there's only
** one playlist item or at the end of the current playlist and repeat is disabled.
**
** Notes: If a plug-in (like the JTFE plug-in) uses IPC_GET_NEXT_PLITEM to override the
** playlist order then you will need to query the plug-in directly (via api_queue
** for the JTFE plug-in) to get the correct next playlist item to be played.
**
** If a change is made to the internal shuffle table, the value returned by prior
** use of this api is likely to be different and so will need to be re-queried.
**
** The returned playlist item position is zero-based.
*/
#define IPC_GETINFO 126
/* (requires Winamp 2.05+)
** int inf=SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETINFO);
** IPC_GETINFO returns info about the current playing song. The value
** it returns depends on the value of 'mode'.
** Mode Meaning
** ------------------
** 0 Samplerate, in kilohertz (i.e. 44)
** 1 Bitrate (i.e. 128)
** 2 Channels (i.e. 2)
** 3 (5+) Video LOWORD=w HIWORD=h
** 4 (5+) > 65536, string (video description)
** 5 (5.25+) Samplerate, in hertz (i.e. 44100)
*/
#define IPC_GETEQDATA 127
/* (requires Winamp 2.05+)
** int data=SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA);
** IPC_GETEQDATA queries the status of the EQ.
** The value returned depends on what 'pos' is set to:
** Value Meaning
** ------------------
** 0-9 The 10 bands of EQ data. 0-63 (+20db - -20db)
** 10 The preamp value. 0-63 (+20db - -20db)
** 11 Enabled. zero if disabled, nonzero if enabled.
** 12 Autoload. zero if disabled, nonzero if enabled.
*/
#define IPC_SETEQDATA 128
/* (requires Winamp 2.05+)
** SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA);
** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SETEQDATA);
** IPC_SETEQDATA sets the value of the last position retrieved
** by IPC_GETEQDATA. This is pretty lame, and we should provide
** an extended version that lets you do a MAKELPARAM(pos,value).
** someday...
new (2.92+):
if the high byte is set to 0xDB, then the third byte specifies
which band, and the bottom word specifies the value.
*/
#define IPC_ADDBOOKMARK 129
#define IPC_ADDBOOKMARKW 131
/* (requires Winamp 2.4+)
** This is sent as a WM_COPYDATA using IPC_ADDBOOKMARK as the dwData value and the
** directory you want to change to as the lpData member. This will add the specified
** file / url to the Winamp bookmark list.
**
** COPYDATASTRUCT cds = {0};
** cds.dwData = IPC_ADDBOOKMARK;
** cds.lpData = (void*)"http://www.blah.com/listen.pls";
** cds.cbData = lstrlen((char*)cds.lpData)+1; // include space for null char
** SendMessage(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
**
**
** In Winamp 5.0+ we use this as a normal WM_WA_IPC and the string is null separated as
** the filename and then the title of the entry.
**
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(char*)"filename\0title\0",IPC_ADDBOOKMARK);
**
** This will notify the library / bookmark editor that a bookmark was added.
** Note that using this message in this context does not actually add the bookmark.
** Do not use, it is essentially just a notification type message :)
**
** Additional Notes:
**
** If IPC_ADDBOOKMARK is called with wParam as zero then it returns the bookmark filepath
** as an ansi string.
**
** As of 5.58+, calling IPC_ADDBOOKMARKW with wParam as zero will return the bookmark
** filepath as a unicode string and IPC_ADDBOOKMARK will behave as prior to 5.58.
** Passing wParam as 666 will return the winamp.bm8 filepath and is valid for both apis.
*/
#define IPC_INSTALLPLUGIN 130
/* This is not implemented (and is very unlikely to be done due to safety concerns).
** If it was then you could do a WM_COPYDATA with a path to a .wpz and it would then
** install the plugin for you.
**
** COPYDATASTRUCT cds = {0};
** cds.dwData = IPC_INSTALLPLUGIN;
** cds.lpData = (void*)"c:\\path\\to\\file.wpz";
** cds.cbData = lstrlen((char*)cds.lpData)+1; // include space for null char
** SendMessage(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
*/
#define IPC_RESTARTWINAMP 135
/* (requires Winamp 2.2+)
** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_RESTARTWINAMP);
** IPC_RESTARTWINAMP will restart Winamp (isn't that obvious ? :) )
** If this fails to make Winamp start after closing then there is a good chance one (or
** more) of the currently installed plugins caused Winamp to crash on exit (either as a
** silent crash or a full crash log report before it could call itself start again.
*/
#define IPC_RESTARTSAFEWINAMP 1135
/* (requires Winamp 5.64+)
** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_RESTARTSAFEWINAMP);
** IPC_RESTARTSAFEWINAMP will restart Winamp (isn't that obvious ? :) ) in safe mode.
** If this fails to make Winamp start after closing then there is a good chance one (or
** more) of the currently installed plugins caused Winamp to crash on exit (either as a
** silent crash or a full crash log report before it could call itself start again.
*/
#define IPC_ISFULLSTOP 400
/* (requires winamp 2.7+ I think)
** int ret=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISFULLSTOP);
** This is useful for when you're an output plugin and you want to see if the stop/close
** happening is a full stop or if you are just between tracks. This returns zero if it is
** a full stop (such as the user pressing stop) or non-zero if it is just the end of a
** file or other internal events.
*/
#define IPC_INETAVAILABLE 242
/* (requires Winamp 2.05+)
** int val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_INETAVAILABLE);
** IPC_INETAVAILABLE will return 1 if an Internet connection is available for Winamp and
** relates to the internet connection type setting on the main general preferences page
** in the Winamp preferences.
*/
#define IPC_UPDTITLE 243
/* (requires Winamp 2.2+)
** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_UPDTITLE);
** IPC_UPDTITLE will ask Winamp to update the information about the current title and
** causes GetFileInfo(..) in the input plugin associated with the current playlist entry
** to be called. This can be called such as when an input plugin is buffering a file so
** that it can cause the buffer percentage to appear in the playlist.
*/
#define IPC_REFRESHPLCACHE 247
/* (requires Winamp 2.2+)
** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_REFRESHPLCACHE);
** IPC_REFRESHPLCACHE will flush the playlist cache buffer and you send this if you want
** Winamp to go refetch the titles for all of the entries in the current playlist.
**
** 5.3+:
** If you pass a wchar_t * string in wParam then it will be be found using strnicmp() and
** the cache for that entry only will be cleared unlike passing nothing which clears all.
*/
#define IPC_GET_SHUFFLE 250
/* (requires Winamp 2.4+)
** int val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_SHUFFLE);
** IPC_GET_SHUFFLE returns the status of the shuffle option.
** If set then it will return 1 and if not set then it will return 0.
*/
#define IPC_GET_REPEAT 251
/* (requires Winamp 2.4+)
** int val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_REPEAT);
** IPC_GET_REPEAT returns the status of the repeat option.
** If set then it will return 1 and if not set then it will return 0.
*/
#define IPC_SET_SHUFFLE 252
/* (requires Winamp 2.4+)
** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_SHUFFLE);
** IPC_SET_SHUFFLE sets the status of the shuffle option.
** If 'value' is 1 then shuffle is turned on.
** If 'value' is 0 then shuffle is turned off.
*/
#define IPC_SET_REPEAT 253
/* (requires Winamp 2.4+)
** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_REPEAT);
** IPC_SET_REPEAT sets the status of the repeat option.
** If 'value' is 1 then shuffle is turned on.
** If 'value' is 0 then shuffle is turned off.
*/
#define IPC_ENABLEDISABLE_ALL_WINDOWS 259 // 0xdeadbeef to disable
/* (requires Winamp 2.9+)
** SendMessage(hwnd_winamp,WM_WA_IPC,(enable?0:0xdeadbeef),IPC_ENABLEDISABLE_ALL_WINDOWS);
** Sending this message with 0xdeadbeef as the param will disable all winamp windows and
** any other values will enable all of the Winamp windows again. When disabled you won't
** get any response on clicking or trying to do anything to the Winamp windows. If the
** taskbar icon is shown then you may still have control ;)
*/
#define IPC_GETWND 260
/* (requires Winamp 2.9+)
** HWND h=SendMessage(hwnd_winamp,WM_WA_IPC,IPC_GETWND_xxx,IPC_GETWND);
** returns the HWND of the window specified.
*/
#define IPC_GETWND_EQ 0 // use one of these for the param
#define IPC_GETWND_PE 1
#define IPC_GETWND_MB 2
#define IPC_GETWND_VIDEO 3
#define IPC_ISWNDVISIBLE 261 // same param as IPC_GETWND
/************************************************************************
***************** in-process only (WE LOVE PLUGINS)
************************************************************************/
#define IPC_SETSKINW 199
#define IPC_SETSKIN 200
/* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)"skinname",IPC_SETSKIN);
** IPC_SETSKIN sets the current skin to "skinname". Note that skinname
** can be the name of a skin, a skin .zip file, with or without path.
** If path isn't specified, the default search path is the winamp skins
** directory.
*/
#define IPC_GETSKIN 201
#define IPC_GETSKINW 1201
/* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)skinname_buffer,IPC_GETSKIN);
** IPC_GETSKIN puts the directory where skin bitmaps can be found
** into skinname_buffer.
** skinname_buffer must be MAX_PATH characters in length.
** When using a .zip'd skin file, it'll return a temporary directory
** where the ZIP was decompressed.
*/
#define IPC_EXECPLUG 202
/* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)"vis_file.dll",IPC_EXECPLUG);
** IPC_EXECPLUG executes a visualization plug-in pointed to by WPARAM.
** the format of this string can be:
** "vis_whatever.dll"
** "vis_whatever.dll,0" // (first mod, file in winamp plug-in dir)
** "C:\\dir\\vis_whatever.dll,1"
*/
#define IPC_GETPLAYLISTFILE 211
#define IPC_GETPLAYLISTFILEW 214
/* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTFILE);
** IPC_GETPLAYLISTFILE gets the filename of the playlist entry [index].
** returns a pointer to it. returns NULL on error.
*/
#define IPC_GETPLAYLISTTITLE 212
#define IPC_GETPLAYLISTTITLEW 213
/* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTTITLE);
**
** IPC_GETPLAYLISTTITLE gets the title of the playlist entry [index].
** returns a pointer to it. returns NULL on error.
*/
#define IPC_GETHTTPGETTER 240
/* retrieves a function pointer to a HTTP retrieval function.
** if this is unsupported, returns 1 or 0.
** the function should be:
** int (*httpRetrieveFile)(HWND hwnd, char *url, char *file, char *dlgtitle);
** if you call this function, with a parent window, a URL, an output file, and a dialog title,
** it will return 0 on successful download, 1 on error.
*/
#define IPC_GETHTTPGETTERW 1240
/* int (*httpRetrieveFileW)(HWND hwnd, char *url, wchar_t *file, wchar_t *dlgtitle); */
#define IPC_MBOPEN 241
/* (requires Winamp 2.05+)
** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_MBOPEN);
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPEN);
** IPC_MBOPEN will open a new URL in the minibrowser. if url is NULL, it will open the Minibrowser window.
*/
#define IPC_CHANGECURRENTFILE 245
/* (requires Winamp 2.05+)
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_CHANGECURRENTFILE);
** IPC_CHANGECURRENTFILE will set the current playlist item.
*/
#define IPC_CHANGECURRENTFILEW 1245
/* (requires Winamp 5.3+)
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_CHANGECURRENTFILEW);
** IPC_CHANGECURRENTFILEW will set the current playlist item.
*/
#define IPC_GETMBURL 246
/* (requires Winamp 2.2+)
** char buffer[4096]; // Urls can be VERY long
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)buffer,IPC_GETMBURL);
** IPC_GETMBURL will retrieve the current Minibrowser URL into buffer.
** buffer must be at least 4096 bytes long.
*/
#define IPC_MBBLOCK 248
/* (requires Winamp 2.4+)
** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_MBBLOCK);
**
** IPC_MBBLOCK will block the Minibrowser from updates if value is set to 1
*/
#define IPC_MBOPENREAL 249
/* (requires Winamp 2.4+)
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPENREAL);
**
** IPC_MBOPENREAL works the same as IPC_MBOPEN except that it will works even if
** IPC_MBBLOCK has been set to 1
*/
#define IPC_ADJUST_OPTIONSMENUPOS 280
/* (requires Winamp 2.9+)
** int newpos=SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)adjust_offset,IPC_ADJUST_OPTIONSMENUPOS);
** This moves where Winamp expects the Options menu to be in the main menu.
** This is useful if you wish to insert a menu item above the options/skins/vis menus for a window.
** If you pass adjust_offset as zero then it will return the current offset without adjusting it.
*/
#define IPC_GET_HMENU 281
/* (requires Winamp 2.9+)
** HMENU hMenu=SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)0,IPC_GET_HMENU);
**
** For 2.9x installs the following values are valid:
** 0 : main popup menu (mapped to -1 in 5.x installs)
** 1 : main menubar file menu
** 2 : main menubar options menu
** 3 : main menubar windows menu
** 4 : main menubar help menu
**
** For 5.x client versions the following values are valid (changed due to Modern skin support):
** -1 : the main winamp menu resource (same as doing LoadMenu(winamp_module_or_lng_file,101)
** 0 : main popup menu
** 1 : main menubar file menu
** 2 : main menubar play menu
** 3 : main menubar options menu
** 4 : main menubar windows menu
** 5 : main menubar windows help
** 6 : playlist editor menubar file menu
** 7 : playlist editor menubar playlist menu
** 8 : playlist editor menubar sort menu
** 9 : media library menubar file menu
** 10 : media library menubar view menu
**
** In all client versions, unsupported values will return NULL.
**
** e.g. (psuedo code to add an item to the end of the main window 'view' menu)
** HMENU windows_menu = (HMENU)SendMessage(hwnd_winamp,WM_WA_IPC,4,IPC_GET_HMENU);
** if(windows_menu)
** {
** // WA_MENUITEM_ID is obtained from IPC_REGISTER_WINAMP_IPCMESSAGE or a predefined
** // value if that api is not supported on the client version you are working with.
**
** int window_visible = 1; // this would be updated as needed for the window view state
** MENUITEMINFO i = {sizeof(i), MIIM_ID | MIIM_STATE | MIIM_TYPE, MFT_STRING,
** window_visible ? MFS_CHECKED : 0, WA_MENUITEM_ID};
** i.dwTypeData = "My Menu Item";
** InsertMenuItem(windows_menu, GetMenuItemCount(windows_menu), TRUE, &i);
** }
*/
#define IPC_GET_EXTENDED_FILE_INFO 290 //pass a pointer to the following struct in wParam
#define IPC_GET_EXTENDED_FILE_INFO_HOOKABLE 296
/* (requires Winamp 2.9+)
** to use, create an extendedFileInfoStruct, point the values filename and metadata to the
** filename and metadata field you wish to query, and ret to a buffer, with retlen to the
** length of that buffer, and then SendMessage(hwnd_winamp,WM_WA_IPC,&struct,IPC_GET_EXTENDED_FILE_INFO);
** the results should be in the buffer pointed to by ret.
** returns 1 if the decoder supports a getExtendedFileInfo method
*/
typedef struct {
const char *filename;
const char *metadata;
char *ret;
size_t retlen;
} extendedFileInfoStruct;
#define IPC_GET_BASIC_FILE_INFO 291 //pass a pointer to the following struct in wParam
typedef struct {
const char *filename;
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)
// filled in by winamp
int length;
char *title;
int titlelen;
} basicFileInfoStruct;
#define IPC_GET_BASIC_FILE_INFOW 1291 //pass a pointer to the following struct in wParam
typedef struct {
const wchar_t *filename;
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)
// filled in by winamp
int length;
wchar_t *title;
int titlelen;
} basicFileInfoStructW;
#define IPC_GET_EXTLIST 292
#define IPC_GET_EXTLISTW 1292
/* (requires Winamp 5.0+)
** char* ext_list = (char*)SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)mode,IPC_GET_EXTLIST);
** wchar_t* ext_list = (wchar_t*)SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)mode,IPC_GET_EXTLISTW);
** These return a double null delimited string based on the mode passed.
** Ensure you GlobalFree() the result when done.
**
** mode = 0 - returns raw extlist of all loadable formats
** mode = 1 - returns something suitable for getopenfilename of all loadable formats
**
** update 5.66+
** these now de-duplicate file extensions reported by the input plug-ins as well as capitalising.
*/
#define IPC_GET_PLAYLIST_EXTLISTW 282
/* (requires Winamp 5.66+)
** wchar_t* pl_ext_list = (wchar_t*)SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)mode,IPC_GET_PLAYLIST_EXTLISTW);
** These just return playlist extensions / file types instead of all
** extensions / file types like the prior IPC_GET_EXTLIST(W) methods.
** There is no need to GlobalFree() the result unlike the IPC_GET_EXTLIST(W) behaviour.
**
** mode = 0 - returns raw extlist of loadable playlist formats
** mode = 1 - returns something suitable for getopenfilename of loadable playlist formats
** mode = 2 - returns raw extlist of writeable playlist formats
** mode = 3 - returns something suitable for getopenfilename of writeable playlist formats
*/
typedef struct {
HWND parent;
const char *filename;
} infoBoxParam;
#define IPC_INFOBOX 293
/* (requires Winamp 5.0+)
** infoBoxParam infoBox = {parent_hwnd,"c:\\test\\folder\\test.mp3"};
** int ret_val = SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&infoBox,IPC_INFOBOX);
**
** ret_val is 0 if OK was pressed and is 1 if CANCEL was pressed
** The standard behaviour is to abort any loops used with this api if a cancel occurs.
*/
typedef struct {
HWND parent;
const wchar_t *filename;
} infoBoxParamW;
#define IPC_INFOBOXW 1293
/* (requires Winamp 5.3+)
** infoBoxParamW infoBoxW = {parent_hwnd,L"c:\\test\\folder\\test.mp3"};
** int ret_val = SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&infoBoxW,IPC_INFOBOXW);
**
** ret_val is 0 if OK was pressed and is 1 if CANCEL was pressed
** The standard behaviour is to abort any loops used with this api if a cancel occurs.
*/
#define IPC_SET_EXTENDED_FILE_INFO 294 //pass a pointer to the a extendedFileInfoStruct in wParam
/* (requires Winamp 2.9+)
** to use, create an extendedFileInfoStruct, point the values filename and metadata to the
** filename and metadata field you wish to write in ret. (retlen is not used). and then
** SendMessage(hwnd_winamp,WM_WA_IPC,&struct,IPC_SET_EXTENDED_FILE_INFO);
** returns 1 if the metadata is supported
** Call IPC_WRITE_EXTENDED_FILE_INFO once you're done setting all the metadata you want to update
*/
#define IPC_WRITE_EXTENDED_FILE_INFO 295
/* (requires Winamp 2.9+)
** writes all the metadata set thru IPC_SET_EXTENDED_FILE_INFO to the file
** returns 1 if the file has been successfully updated, 0 if error
*/
#define IPC_FORMAT_TITLE 297
typedef struct
{
char *spec; // NULL=default winamp spec
void *p;
char *out;
int out_len;
char * (*TAGFUNC)(const char * tag, void * p); //return 0 if not found
void (*TAGFREEFUNC)(char * tag,void * p);
} waFormatTitle;
#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
typedef struct
{
const wchar_t *filename;
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
const wchar_t *spec; // NULL=default winamp spec
void *p;
wchar_t *out;
int out_len;
wchar_t * (*TAGFUNC)(const wchar_t * tag, void * p); //return 0 if not found, -1 for empty tag
void (*TAGFREEFUNC)(wchar_t *tag, void *p);
} waFormatTitleExtended;
#define IPC_COPY_EXTENDED_FILE_INFO 299
typedef struct
{
const char *source;
const char *dest;
} copyFileInfoStruct;
#define IPC_COPY_EXTENDED_FILE_INFOW 1299
typedef struct
{
const wchar_t *source;
const wchar_t *dest;
} copyFileInfoStructW;
typedef struct {
int (*inflateReset)(void *strm);
int (*inflateInit_)(void *strm,const char *version, int stream_size);
int (*inflate)(void *strm, int flush);
int (*inflateEnd)(void *strm);
unsigned long (*crc32)(unsigned long crc, const unsigned char *buf, unsigned int len);
} wa_inflate_struct;
#define IPC_GETUNCOMPRESSINTERFACE 331
/* returns a function pointer to uncompress().
** int (*uncompress)(unsigned char *dest, unsigned long *destLen, const unsigned char *source, unsigned long sourceLen);
** right out of zlib, useful for decompressing zlibbed data.
** if you pass the parm of 0x10100000, it will return a wa_inflate_struct * to an inflate API.
*/
typedef struct _prefsDlgRec {
HINSTANCE hInst; // dll instance containing the dialog resource
int dlgID; // resource identifier of the dialog
void *proc; // window proceedure for handling the dialog defined as
// LRESULT CALLBACK PrefsPage(HWND,UINT,WPARAM,LPARAM)
char *name; // name shown for the prefs page in the treelist
intptr_t where; // section in the treelist the prefs page is to be added to
// 0 for General Preferences
// 1 for Plugins
// 2 for Skins
// 3 for Bookmarks (no longer in the 5.0+ prefs)
// 4 for Prefs (the old 'Setup' section - no longer in 5.0+)
intptr_t _id;
struct _prefsDlgRec *next; // no longer implemented as a linked list, now used by Winamp for other means
} prefsDlgRec;
typedef struct _prefsDlgRecW {
HINSTANCE hInst; // dll instance containing the dialog resource
int dlgID; // resource identifier of the dialog
void *proc; // window proceedure for handling the dialog defined as
// LRESULT CALLBACK PrefsPage(HWND,UINT,WPARAM,LPARAM)
wchar_t *name; // name shown for the prefs page in the treelist
intptr_t where; // section in the treelist the prefs page is to be added to
// 0 for General Preferences
// 1 for Plugins
// 2 for Skins
// 3 for Bookmarks (no longer in the 5.0+ prefs)
// 4 for Prefs (the old 'Setup' section - no longer in 5.0+)
intptr_t _id;
struct _prefsDlgRec *next; // no longer implemented as a linked list, now used by Winamp for other means
} prefsDlgRecW;
#define IPC_ADD_PREFS_DLG 332
#define IPC_ADD_PREFS_DLGW 1332
#define IPC_REMOVE_PREFS_DLG 333
#define IPC_UPDATE_PREFS_DLG 342
#define IPC_UPDATE_PREFS_DLGW 1342
/* (requires Winamp 2.9+)
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_ADD_PREFS_DLG);
** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_REMOVE_PREFS_DLG);
**
** IPC_ADD_PREFS_DLG:
** To use this you need to allocate a prefsDlgRec structure (either on the heap or with
** some global data but NOT on the stack) and then initialise the members of the structure
** (see the definition of the prefsDlgRec structure above).
**
** hInst - dll instance of where the dialog resource is located.
** dlgID - id of the dialog resource.
** proc - dialog window procedure for the prefs dialog.
** name - name of the prefs page as shown in the preferences list.
** where - see above for the valid locations the page can be added.
**
** Then you do PostMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_ADD_PREFS_DLG);
**
** example:
**
** prefsDlgRec* prefsRec = 0;
** prefsRec = GlobalAlloc(GPTR,sizeof(prefsDlgRec));
** prefsRec->hInst = hInst;
** prefsRec->dlgID = IDD_PREFDIALOG;
** prefsRec->name = "Pref Page";
** prefsRec->where = 0;
** prefsRec->proc = PrefsPage;
** PostMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_ADD_PREFS_DLG);
**
**
** IPC_REMOVE_PREFS_DLG:
** To use you pass the address of the same prefsRec you used when adding the prefs page
** though you shouldn't really ever have to do this but it's good to clean up after you