FTEQW
Documentation of the FTE engine source tree.
winamp.h
Go to the documentation of this file.
1/*
2
3** Winamp frontend/plug-in control API documentation v1.1.
4
5** By Justin Frankel. Updates by Christophe Thibault.
6
7** Copyright (C) 1997-2000, Nullsoft Inc.
8
9** Last updated: JUL.12.2000.
10
11**
12
13** Introduction
14
15** -----------------------
16
17** This file describes a means to easily communicate to Winamp
18
19** via the classic Win32 Message API.
20
21**
22
23** These definitions/code assume C/C++. Porting to VB/Delphi shouldn't
24
25** be too hard.
26
27**
28
29** First, you find the HWND of the Winamp main window. From a plug-in
30
31** you can easily extract this from the plug-in structure (hMainWindow,
32
33** hwndParent, whatever). For external apps, use:
34
35**
36
37** HWND hwnd_winamp = FindWindow("Winamp v1.x",NULL);
38
39**
40
41** (note: I know, we're in Winamp 2.x, but it's 1.x for compatibility)
42
43**
44
45** Once you have the hwnd_winamp, it's a good idea to check the version
46
47** number. To do this, you send a WM_WA_IPC message to hwnd_winamp.
48
49** Note that WM_WA_IPC is defined as Win32's WM_USER.
50
51**
52
53** Note that sometimes you might want to use PostMessage instead of
54
55** SendMessage.
56
57*/
58
59
60
61#ifndef _WAFE_H_
62
63#define _WAFE_H_
64
65
66
67#define WM_WA_IPC WM_USER
68
69
70
71/**************************************************************************/
72
73
74
75#define IPC_GETVERSION 0
76
77
78
79/*
80
81** int version = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION);
82
83**
84
85** Version will be 0x20yx for winamp 2.yx. versions previous to Winamp 2.0
86
87** typically (but not always) use 0x1zyx for 1.zx versions. Weird, I know.
88
89**
90
91** The basic format for sending messages to Winamp is:
92
93** int result=SendMessage(hwnd_winamp,WM_WA_IPC,command_data,command);
94
95** (for the version check, command_data is 0).
96
97*/
98
99
100
101
102
103#define IPC_DELETE 101
104
105
106
107/*
108
109** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_DELETE);
110
111**
112
113** You can use IPC_DELETE to clear Winamp's internal playlist.
114
115*/
116
117
118
119
120
121#define IPC_STARTPLAY 102
122
123
124
125/*
126
127** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_STARTPLAY);
128
129**
130
131** Using IPC_STARTPLAY is like hitting 'Play' in Winamp, mostly.
132
133*/
134
135
136
137
138
139#define IPC_ISPLAYING 104
140
141
142
143/*
144
145** int res = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISPLAYING);
146
147**
148
149** IPC_ISPLAYING returns the status of playback.
150
151** If it returns 1, it is playing. if it returns 3, it is paused,
152
153** if it returns 0, it is not playing.
154
155*/
156
157
158
159
160
161#define IPC_GETOUTPUTTIME 105
162
163
164
165/*
166
167** int res = SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETOUTPUTTIME);
168
169**
170
171** IPC_GETOUTPUTTIME returns the position in milliseconds of the
172
173** current song (mode = 0), or the song length, in seconds (mode = 1).
174
175** Returns -1 if not playing or error.
176
177*/
178
179
180
181
182
183#define IPC_JUMPTOTIME 106
184
185
186
187/* (requires Winamp 1.60+)
188
189** SendMessage(hwnd_winamp,WM_WA_IPC,ms,IPC_JUMPTOTIME);
190
191** IPC_JUMPTOTIME sets the position in milliseconds of the
192
193** current song (approximately).
194
195** Returns -1 if not playing, 1 on eof, or 0 if successful
196
197*/
198
199
200
201
202
203#define IPC_WRITEPLAYLIST 120
204
205
206
207/* (requires Winamp 1.666+)
208
209** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_WRITEPLAYLIST);
210
211**
212
213** IPC_WRITEPLAYLIST writes the current playlist to <winampdir>\\Winamp.m3u,
214
215** and returns the current playlist position.
216
217** Kinda obsoleted by some of the 2.x new stuff, but still good for when
218
219** using a front-end (instead of a plug-in)
220
221*/
222
223
224
225
226
227#define IPC_SETPLAYLISTPOS 121
228
229
230
231/* (requires Winamp 2.0+)
232
233** SendMessage(hwnd_winamp,WM_WA_IPC,position,IPC_SETPLAYLISTPOS)
234
235**
236
237** IPC_SETPLAYLISTPOS sets the playlsit position to 'position'.
238
239*/
240
241
242
243
244
245#define IPC_SETVOLUME 122
246
247
248
249/* (requires Winamp 2.0+)
250
251** SendMessage(hwnd_winamp,WM_WA_IPC,volume,IPC_SETVOLUME);
252
253**
254
255** IPC_SETVOLUME sets the volume of Winamp (from 0-255).
256
257*/
258
259
260
261
262
263#define IPC_SETPANNING 123
264
265
266
267/* (requires Winamp 2.0+)
268
269** SendMessage(hwnd_winamp,WM_WA_IPC,panning,IPC_SETPANNING);
270
271**
272
273** IPC_SETPANNING sets the panning of Winamp (from 0 (left) to 255 (right)).
274
275*/
276
277
278
279
280
281#define IPC_GETLISTLENGTH 124
282
283
284
285/* (requires Winamp 2.0+)
286
287** int length = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTLENGTH);
288
289**
290
291** IPC_GETLISTLENGTH returns the length of the current playlist, in
292
293** tracks.
294
295*/
296
297
298
299
300
301#define IPC_SETSKIN 200
302
303
304
305/* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
306
307** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)"skinname",IPC_SETSKIN);
308
309**
310
311** IPC_SETSKIN sets the current skin to "skinname". Note that skinname
312
313** can be the name of a skin, a skin .zip file, with or without path.
314
315** If path isn't specified, the default search path is the winamp skins
316
317** directory.
318
319*/
320
321
322
323
324
325#define IPC_GETSKIN 201
326
327
328
329/* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
330
331** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)skinname_buffer,IPC_GETSKIN);
332
333**
334
335** IPC_GETSKIN puts the directory where skin bitmaps can be found
336
337** into skinname_buffer.
338
339** skinname_buffer must be MAX_PATH characters in length.
340
341** When using a .zip'd skin file, it'll return a temporary directory
342
343** where the ZIP was decompressed.
344
345*/
346
347
348
349
350
351#define IPC_EXECPLUG 202
352
353
354
355/* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
356
357** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)"vis_file.dll",IPC_EXECPLUG);
358
359**
360
361** IPC_EXECPLUG executes a visualization plug-in pointed to by WPARAM.
362
363** the format of this string can be:
364
365** "vis_whatever.dll"
366
367** "vis_whatever.dll,0" // (first mod, file in winamp plug-in dir)
368
369** "C:\\dir\\vis_whatever.dll,1"
370
371*/
372
373
374
375
376
377#define IPC_GETPLAYLISTFILE 211
378
379
380
381/* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
382
383** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTFILE);
384
385**
386
387** IPC_GETPLAYLISTFILE gets the filename of the playlist entry [index].
388
389** returns a pointer to it. returns NULL on error.
390
391*/
392
393
394
395
396
397#define IPC_GETPLAYLISTTITLE 212
398
399
400
401/* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
402
403** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTTITLE);
404
405**
406
407** IPC_GETPLAYLISTTITLE gets the title of the playlist entry [index].
408
409** returns a pointer to it. returns NULL on error.
410
411*/
412
413
414
415
416
417#define IPC_GETLISTPOS 125
418
419
420
421/* (requires Winamp 2.05+)
422
423** int pos=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS);
424
425**
426
427** IPC_GETLISTPOS returns the playlist position. A lot like IPC_WRITEPLAYLIST
428
429** only faster since it doesn't have to write out the list. Heh, silly me.
430
431*/
432
433
434
435
436
437#define IPC_GETINFO 126
438
439
440
441/* (requires Winamp 2.05+)
442
443** int inf=SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETINFO);
444
445**
446
447** IPC_GETINFO returns info about the current playing song. The value
448
449** it returns depends on the value of 'mode'.
450
451** Mode Meaning
452
453** ------------------
454
455** 0 Samplerate (i.e. 44100)
456
457** 1 Bitrate (i.e. 128)
458
459** 2 Channels (i.e. 2)
460
461*/
462
463
464
465
466
467#define IPC_GETEQDATA 127
468
469
470
471/* (requires Winamp 2.05+)
472
473** int data=SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA);
474
475**
476
477** IPC_GETEQDATA queries the status of the EQ.
478
479** The value returned depends on what 'pos' is set to:
480
481** Value Meaning
482
483** ------------------
484
485** 0-9 The 10 bands of EQ data. 0-63 (+20db - -20db)
486
487** 10 The preamp value. 0-63 (+20db - -20db)
488
489** 11 Enabled. zero if disabled, nonzero if enabled.
490
491** 12 Autoload. zero if disabled, nonzero if enabled.
492
493*/
494
495
496
497
498
499#define IPC_SETEQDATA 128
500
501/* (requires Winamp 2.05+)
502
503** SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA);
504
505** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SETEQDATA);
506
507**
508
509** IPC_SETEQDATA sets the value of the last position retrieved
510
511** by IPC_GETEQDATA.
512
513*/
514
515
516
517#define IPC_ADDBOOKMARK 129
518
519/* (requires Winamp 2.4+)
520
521** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_ADDBOOKMARK);
522
523**
524
525** IPC_ADDBOOKMARK will add the specified file to the Winamp bookmark list.
526
527*/
528
529
530
531#define IPC_RESTARTWINAMP 135
532
533/* (requires Winamp 2.2+)
534
535** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_RESTARTWINAMP);
536
537**
538
539** IPC_RESTARTWINAMP will restart Winamp (isn't that obvious ? :)
540
541*/
542
543
544
545#define IPC_MBOPEN 241
546
547/* (requires Winamp 2.05+)
548
549** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_MBOPEN);
550
551** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPEN);
552
553**
554
555** IPC_MBOPEN will open a new URL in the minibrowser. if url is NULL, it will open the Minibrowser window.
556
557*/
558
559
560
561#define IPC_INETAVAILABLE 242
562
563/* (requires Winamp 2.05+)
564
565** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_INETAVAILABLE);
566
567**
568
569** IPC_INETAVAILABLE will return 1 if the Internet connection is available for Winamp.
570
571*/
572
573
574
575#define IPC_UPDTITLE 243
576
577/* (requires Winamp 2.2+)
578
579** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_UPDTITLE);
580
581**
582
583** IPC_UPDTITLE will ask Winamp to update the informations about the current title.
584
585*/
586
587
588
589#define IPC_CHANGECURRENTFILE 245
590
591/* (requires Winamp 2.05+)
592
593** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_CHANGECURRENTFILE);
594
595**
596
597** IPC_CHANGECURRENTFILE will set the current playlist item.
598
599*/
600
601
602
603#define IPC_GETMBURL 246
604
605/* (requires Winamp 2.2+)
606
607** char buffer[4096]; // Urls can be VERY long
608
609** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)buffer,IPC_GETMBURL);
610
611**
612
613** IPC_GETMBURL will retrieve the current Minibrowser URL into buffer.
614
615*/
616
617
618
619#define IPC_REFRESHPLCACHE 247
620
621/* (requires Winamp 2.2+)
622
623** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_REFRESHPLCACHE);
624
625**
626
627** IPC_REFRESHPLCACHE will flush the playlist cache buffer.
628
629*/
630
631
632
633#define IPC_MBBLOCK 248
634
635/* (requires Winamp 2.4+)
636
637** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_MBBLOCK);
638
639**
640
641** IPC_MBBLOCK will block the Minibrowser from updates if value is set to 1
642
643*/
644
645
646
647#define IPC_MBOPENREAL 249
648
649/* (requires Winamp 2.4+)
650
651** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPENREAL);
652
653**
654
655** IPC_MBOPENREAL works the same as IPC_MBOPEN except that it will works even if
656
657** IPC_MBBLOCK has been set to 1
658
659*/
660
661
662
663#define IPC_GET_SHUFFLE 250
664
665/* (requires Winamp 2.4+)
666
667** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_SHUFFLE);
668
669**
670
671** IPC_GET_SHUFFLE returns the status of the Shuffle option (1 if set)
672
673*/
674
675
676
677#define IPC_GET_REPEAT 251
678
679/* (requires Winamp 2.4+)
680
681** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_REPEAT);
682
683**
684
685** IPC_GET_REPEAT returns the status of the Repeat option (1 if set)
686
687*/
688
689
690
691#define IPC_SET_SHUFFLE 252
692
693/* (requires Winamp 2.4+)
694
695** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_SHUFFLE);
696
697**
698
699** IPC_SET_SHUFFLE sets the status of the Shuffle option (1 to turn it on)
700
701*/
702
703
704
705#define IPC_SET_REPEAT 253
706
707/* (requires Winamp 2.4+)
708
709** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_REPEAT);
710
711**
712
713** IPC_SET_REPEAT sets the status of the Repeat option (1 to turn it on)
714
715*/
716
717
718
719/**************************************************************************/
720
721
722
723/*
724
725** Some API calls tend to require that you send data via WM_COPYDATA
726
727** instead of WM_USER. Such as IPC_PLAYFILE:
728
729*/
730
731
732
733#define IPC_PLAYFILE 100
734
735
736
737/*
738
739** COPYDATASTRUCT cds;
740
741** cds.dwData = IPC_PLAYFILE;
742
743** cds.lpData = (void *) "file.mp3";
744
745** cds.cbData = strlen((char *) cds.lpData)+1; // include space for null char
746
747** SendMessage(hwnd_winamp,WM_COPYDATA,(WPARAM)NULL,(LPARAM)&cds);
748
749**
750
751** This will play the file "file.mp3".
752
753**
754
755*/
756
757
758
759
760
761#define IPC_CHDIR 103
762
763
764
765/*
766
767** COPYDATASTRUCT cds;
768
769** cds.dwData = IPC_CHDIR;
770
771** cds.lpData = (void *) "c:\\download";
772
773** cds.cbData = strlen((char *) cds.lpData)+1; // include space for null char
774
775** SendMessage(hwnd_winamp,WM_COPYDATA,(WPARAM)NULL,(LPARAM)&cds);
776
777**
778
779** This will make Winamp change to the directory C:\\download
780
781**
782
783*/
784
785
786
787
788
789/**************************************************************************/
790
791
792
793/*
794
795** Finally there are some WM_COMMAND messages that you can use to send
796
797** Winamp misc commands.
798
799**
800
801** To send these, use:
802
803**
804
805** SendMessage(hwnd_winamp, WM_COMMAND,command_name,0);
806
807*/
808
809
810
811#define WINAMP_OPTIONS_EQ 40036 // toggles the EQ window
812
813#define WINAMP_OPTIONS_PLEDIT 40040 // toggles the playlist window
814
815#define WINAMP_VOLUMEUP 40058 // turns the volume up a little
816
817#define WINAMP_VOLUMEDOWN 40059 // turns the volume down a little
818
819#define WINAMP_FFWD5S 40060 // fast forwards 5 seconds
820
821#define WINAMP_REW5S 40061 // rewinds 5 seconds
822
823
824
825// the following are the five main control buttons, with optionally shift
826
827// or control pressed
828
829// (for the exact functions of each, just try it out)
830
831#define WINAMP_BUTTON1 40044
832
833#define WINAMP_BUTTON2 40045
834
835#define WINAMP_BUTTON3 40046
836
837#define WINAMP_BUTTON4 40047
838
839#define WINAMP_BUTTON5 40048
840
841#define WINAMP_BUTTON1_SHIFT 40144
842
843#define WINAMP_BUTTON2_SHIFT 40145
844
845#define WINAMP_BUTTON3_SHIFT 40146
846
847#define WINAMP_BUTTON4_SHIFT 40147
848
849#define WINAMP_BUTTON5_SHIFT 40148
850
851#define WINAMP_BUTTON1_CTRL 40154
852
853#define WINAMP_BUTTON2_CTRL 40155
854
855#define WINAMP_BUTTON3_CTRL 40156
856
857#define WINAMP_BUTTON4_CTRL 40157
858
859#define WINAMP_BUTTON5_CTRL 40158
860
861
862
863#define WINAMP_FILE_PLAY 40029 // pops up the load file(s) box
864
865#define WINAMP_OPTIONS_PREFS 40012 // pops up the preferences
866
867#define WINAMP_OPTIONS_AOT 40019 // toggles always on top
868
869#define WINAMP_HELP_ABOUT 40041 // pops up the about box :)
870
871
872
873
874
875/*
876
877** EOF.. Enjoy.
878
879*/
880
881
882
883#endif //_WAFE_H_
884