--- /dev/null
+#ifndef _WAFE_H_\r
+#define _WAFE_H_\r
+/*\r
+** Winamp frontend/plug-in control API documentation v1.1.\r
+** By Justin Frankel. Updates by Christophe Thibault.\r
+** Copyright (C) 1997-2000, Nullsoft Inc.\r
+** Last updated: JUL.12.2000.\r
+** \r
+** Introduction\r
+** -----------------------\r
+** This file describes a means to easily communicate to Winamp\r
+** via the classic Win32 Message API. \r
+**\r
+** These definitions/code assume C/C++. Porting to VB/Delphi shouldn't\r
+** be too hard.\r
+** \r
+** First, you find the HWND of the Winamp main window. From a plug-in\r
+** you can easily extract this from the plug-in structure (hMainWindow,\r
+** hwndParent, whatever). For external apps, use:\r
+**\r
+** HWND hwnd_winamp = FindWindow("Winamp v1.x",NULL);\r
+**\r
+** (note: I know, we're in Winamp 2.x, but it's 1.x for compatibility)\r
+**\r
+** Once you have the hwnd_winamp, it's a good idea to check the version \r
+** number. To do this, you send a WM_WA_IPC message to hwnd_winamp.\r
+** Note that WM_WA_IPC is defined as Win32's WM_USER.\r
+**\r
+** Note that sometimes you might want to use PostMessage instead of\r
+** SendMessage.\r
+*/\r
+\r
+#define WM_WA_IPC WM_USER\r
+\r
+/**************************************************************************/\r
+\r
+#define IPC_GETVERSION 0\r
+\r
+/*\r
+** int version = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION);\r
+**\r
+** Version will be 0x20yx for winamp 2.yx. versions previous to Winamp 2.0\r
+** typically (but not always) use 0x1zyx for 1.zx versions. Weird, I know.\r
+**\r
+** The basic format for sending messages to Winamp is:\r
+** int result=SendMessage(hwnd_winamp,WM_WA_IPC,command_data,command);\r
+** (for the version check, command_data is 0).\r
+*/\r
+\r
+\r
+#define IPC_DELETE 101\r
+\r
+/*\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_DELETE);\r
+**\r
+** You can use IPC_DELETE to clear Winamp's internal playlist.\r
+*/\r
+\r
+\r
+#define IPC_STARTPLAY 102\r
+\r
+/*\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_STARTPLAY);\r
+**\r
+** Using IPC_STARTPLAY is like hitting 'Play' in Winamp, mostly.\r
+*/\r
+\r
+\r
+#define IPC_ISPLAYING 104\r
+\r
+/*\r
+** int res = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISPLAYING);\r
+**\r
+** IPC_ISPLAYING returns the status of playback.\r
+** If it returns 1, it is playing. if it returns 3, it is paused, \r
+** if it returns 0, it is not playing.\r
+*/\r
+\r
+\r
+#define IPC_GETOUTPUTTIME 105\r
+\r
+/*\r
+** int res = SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETOUTPUTTIME);\r
+**\r
+** IPC_GETOUTPUTTIME returns the position in milliseconds of the \r
+** current song (mode = 0), or the song length, in seconds (mode = 1).\r
+** Returns -1 if not playing or error.\r
+*/\r
+\r
+\r
+#define IPC_JUMPTOTIME 106\r
+\r
+/* (requires Winamp 1.60+)\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,ms,IPC_JUMPTOTIME);\r
+** IPC_JUMPTOTIME sets the position in milliseconds of the \r
+** current song (approximately).\r
+** Returns -1 if not playing, 1 on eof, or 0 if successful\r
+*/\r
+\r
+\r
+#define IPC_WRITEPLAYLIST 120\r
+\r
+/* (requires Winamp 1.666+)\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_WRITEPLAYLIST);\r
+**\r
+** IPC_WRITEPLAYLIST writes the current playlist to <winampdir>\\Winamp.m3u,\r
+** and returns the current playlist position.\r
+** Kinda obsoleted by some of the 2.x new stuff, but still good for when\r
+** using a front-end (instead of a plug-in)\r
+*/\r
+\r
+\r
+#define IPC_SETPLAYLISTPOS 121\r
+\r
+/* (requires Winamp 2.0+)\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,position,IPC_SETPLAYLISTPOS)\r
+**\r
+** IPC_SETPLAYLISTPOS sets the playlsit position to 'position'.\r
+*/\r
+\r
+\r
+#define IPC_SETVOLUME 122\r
+\r
+/* (requires Winamp 2.0+)\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,volume,IPC_SETVOLUME);\r
+**\r
+** IPC_SETVOLUME sets the volume of Winamp (from 0-255).\r
+*/\r
+\r
+\r
+#define IPC_SETPANNING 123\r
+\r
+/* (requires Winamp 2.0+)\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,panning,IPC_SETPANNING);\r
+**\r
+** IPC_SETPANNING sets the panning of Winamp (from 0 (left) to 255 (right)).\r
+*/\r
+\r
+\r
+#define IPC_GETLISTLENGTH 124\r
+\r
+/* (requires Winamp 2.0+)\r
+** int length = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTLENGTH);\r
+**\r
+** IPC_GETLISTLENGTH returns the length of the current playlist, in\r
+** tracks.\r
+*/\r
+\r
+\r
+#define IPC_SETSKIN 200\r
+\r
+/* (requires Winamp 2.04+, only usable from plug-ins (not external apps))\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)"skinname",IPC_SETSKIN);\r
+**\r
+** IPC_SETSKIN sets the current skin to "skinname". Note that skinname \r
+** can be the name of a skin, a skin .zip file, with or without path. \r
+** If path isn't specified, the default search path is the winamp skins \r
+** directory.\r
+*/\r
+\r
+\r
+#define IPC_GETSKIN 201\r
+\r
+/* (requires Winamp 2.04+, only usable from plug-ins (not external apps))\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)skinname_buffer,IPC_GETSKIN);\r
+**\r
+** IPC_GETSKIN puts the directory where skin bitmaps can be found \r
+** into skinname_buffer.\r
+** skinname_buffer must be MAX_PATH characters in length.\r
+** When using a .zip'd skin file, it'll return a temporary directory\r
+** where the ZIP was decompressed.\r
+*/\r
+\r
+\r
+#define IPC_EXECPLUG 202\r
+\r
+/* (requires Winamp 2.04+, only usable from plug-ins (not external apps))\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)"vis_file.dll",IPC_EXECPLUG);\r
+**\r
+** IPC_EXECPLUG executes a visualization plug-in pointed to by WPARAM.\r
+** the format of this string can be:\r
+** "vis_whatever.dll"\r
+** "vis_whatever.dll,0" // (first mod, file in winamp plug-in dir)\r
+** "C:\\dir\\vis_whatever.dll,1" \r
+*/\r
+\r
+\r
+#define IPC_GETPLAYLISTFILE 211\r
+\r
+/* (requires Winamp 2.04+, only usable from plug-ins (not external apps))\r
+** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTFILE);\r
+**\r
+** IPC_GETPLAYLISTFILE gets the filename of the playlist entry [index].\r
+** returns a pointer to it. returns NULL on error.\r
+*/\r
+\r
+\r
+#define IPC_GETPLAYLISTTITLE 212\r
+\r
+/* (requires Winamp 2.04+, only usable from plug-ins (not external apps))\r
+** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTTITLE);\r
+**\r
+** IPC_GETPLAYLISTTITLE gets the title of the playlist entry [index].\r
+** returns a pointer to it. returns NULL on error.\r
+*/\r
+\r
+\r
+#define IPC_GETLISTPOS 125\r
+\r
+/* (requires Winamp 2.05+)\r
+** int pos=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS);\r
+**\r
+** IPC_GETLISTPOS returns the playlist position. A lot like IPC_WRITEPLAYLIST\r
+** only faster since it doesn't have to write out the list. Heh, silly me.\r
+*/\r
+\r
+\r
+#define IPC_GETINFO 126 \r
+\r
+/* (requires Winamp 2.05+)\r
+** int inf=SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETINFO);\r
+**\r
+** IPC_GETINFO returns info about the current playing song. The value\r
+** it returns depends on the value of 'mode'.\r
+** Mode Meaning\r
+** ------------------\r
+** 0 Samplerate (i.e. 44100)\r
+** 1 Bitrate (i.e. 128)\r
+** 2 Channels (i.e. 2)\r
+*/\r
+\r
+\r
+#define IPC_GETEQDATA 127 \r
+\r
+/* (requires Winamp 2.05+)\r
+** int data=SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA);\r
+**\r
+** IPC_GETEQDATA queries the status of the EQ. \r
+** The value returned depends on what 'pos' is set to:\r
+** Value Meaning\r
+** ------------------\r
+** 0-9 The 10 bands of EQ data. 0-63 (+20db - -20db)\r
+** 10 The preamp value. 0-63 (+20db - -20db)\r
+** 11 Enabled. zero if disabled, nonzero if enabled.\r
+** 12 Autoload. zero if disabled, nonzero if enabled.\r
+*/\r
+\r
+\r
+#define IPC_SETEQDATA 128\r
+/* (requires Winamp 2.05+)\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA);\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SETEQDATA);\r
+**\r
+** IPC_SETEQDATA sets the value of the last position retrieved\r
+** by IPC_GETEQDATA.\r
+*/\r
+\r
+#define IPC_ADDBOOKMARK 129\r
+/* (requires Winamp 2.4+)\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_ADDBOOKMARK);\r
+**\r
+** IPC_ADDBOOKMARK will add the specified file to the Winamp bookmark list.\r
+*/\r
+\r
+#define IPC_RESTARTWINAMP 135\r
+/* (requires Winamp 2.2+)\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_RESTARTWINAMP);\r
+**\r
+** IPC_RESTARTWINAMP will restart Winamp (isn't that obvious ? :)\r
+*/\r
+\r
+#define IPC_MBOPEN 241\r
+/* (requires Winamp 2.05+)\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_MBOPEN);\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPEN);\r
+**\r
+** IPC_MBOPEN will open a new URL in the minibrowser. if url is NULL, it will open the Minibrowser window.\r
+*/\r
+\r
+#define IPC_INETAVAILABLE 242\r
+/* (requires Winamp 2.05+)\r
+** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_INETAVAILABLE);\r
+**\r
+** IPC_INETAVAILABLE will return 1 if the Internet connection is available for Winamp.\r
+*/\r
+\r
+#define IPC_UPDTITLE 243\r
+/* (requires Winamp 2.2+)\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_UPDTITLE);\r
+**\r
+** IPC_UPDTITLE will ask Winamp to update the informations about the current title.\r
+*/\r
+\r
+#define IPC_CHANGECURRENTFILE 245\r
+/* (requires Winamp 2.05+)\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_CHANGECURRENTFILE);\r
+**\r
+** IPC_CHANGECURRENTFILE will set the current playlist item.\r
+*/\r
+\r
+#define IPC_GETMBURL 246\r
+/* (requires Winamp 2.2+)\r
+** char buffer[4096]; // Urls can be VERY long\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)buffer,IPC_GETMBURL);\r
+**\r
+** IPC_GETMBURL will retrieve the current Minibrowser URL into buffer.\r
+*/\r
+\r
+#define IPC_REFRESHPLCACHE 247\r
+/* (requires Winamp 2.2+)\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_REFRESHPLCACHE);\r
+**\r
+** IPC_REFRESHPLCACHE will flush the playlist cache buffer.\r
+*/\r
+\r
+#define IPC_MBBLOCK 248\r
+/* (requires Winamp 2.4+)\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_MBBLOCK);\r
+**\r
+** IPC_MBBLOCK will block the Minibrowser from updates if value is set to 1\r
+*/\r
+\r
+#define IPC_MBOPENREAL 249\r
+/* (requires Winamp 2.4+)\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPENREAL);\r
+**\r
+** IPC_MBOPENREAL works the same as IPC_MBOPEN except that it will works even if \r
+** IPC_MBBLOCK has been set to 1\r
+*/\r
+\r
+#define IPC_GET_SHUFFLE 250\r
+/* (requires Winamp 2.4+)\r
+** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_SHUFFLE);\r
+**\r
+** IPC_GET_SHUFFLE returns the status of the Shuffle option (1 if set)\r
+*/\r
+\r
+#define IPC_GET_REPEAT 251\r
+/* (requires Winamp 2.4+)\r
+** val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_REPEAT);\r
+**\r
+** IPC_GET_REPEAT returns the status of the Repeat option (1 if set)\r
+*/\r
+\r
+#define IPC_SET_SHUFFLE 252\r
+/* (requires Winamp 2.4+)\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_SHUFFLE);\r
+**\r
+** IPC_SET_SHUFFLE sets the status of the Shuffle option (1 to turn it on)\r
+*/\r
+\r
+#define IPC_SET_REPEAT 253\r
+/* (requires Winamp 2.4+)\r
+** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_REPEAT);\r
+**\r
+** IPC_SET_REPEAT sets the status of the Repeat option (1 to turn it on)\r
+*/\r
+\r
+/**************************************************************************/\r
+\r
+/*\r
+** Some API calls tend to require that you send data via WM_COPYDATA\r
+** instead of WM_USER. Such as IPC_PLAYFILE:\r
+*/\r
+\r
+#define IPC_PLAYFILE 100\r
+\r
+/*\r
+** COPYDATASTRUCT cds;\r
+** cds.dwData = IPC_PLAYFILE;\r
+** cds.lpData = (void *) "file.mp3";\r
+** cds.cbData = strlen((char *) cds.lpData)+1; // include space for null char\r
+** SendMessage(hwnd_winamp,WM_COPYDATA,(WPARAM)NULL,(LPARAM)&cds);\r
+**\r
+** This will play the file "file.mp3".\r
+**\r
+*/\r
+\r
+\r
+#define IPC_CHDIR 103\r
+\r
+/*\r
+** COPYDATASTRUCT cds;\r
+** cds.dwData = IPC_CHDIR;\r
+** cds.lpData = (void *) "c:\\download";\r
+** cds.cbData = strlen((char *) cds.lpData)+1; // include space for null char\r
+** SendMessage(hwnd_winamp,WM_COPYDATA,(WPARAM)NULL,(LPARAM)&cds);\r
+**\r
+** This will make Winamp change to the directory C:\\download\r
+**\r
+*/\r
+\r
+\r
+/**************************************************************************/\r
+\r
+/*\r
+** Finally there are some WM_COMMAND messages that you can use to send \r
+** Winamp misc commands.\r
+** \r
+** To send these, use:\r
+**\r
+** SendMessage(hwnd_winamp, WM_COMMAND,command_name,0);\r
+*/\r
+\r
+#define WINAMP_OPTIONS_EQ 40036 // toggles the EQ window\r
+#define WINAMP_OPTIONS_PLEDIT 40040 // toggles the playlist window\r
+#define WINAMP_VOLUMEUP 40058 // turns the volume up a little\r
+#define WINAMP_VOLUMEDOWN 40059 // turns the volume down a little\r
+#define WINAMP_FFWD5S 40060 // fast forwards 5 seconds\r
+#define WINAMP_REW5S 40061 // rewinds 5 seconds\r
+\r
+// the following are the five main control buttons, with optionally shift \r
+// or control pressed\r
+// (for the exact functions of each, just try it out)\r
+#define WINAMP_BUTTON1 40044\r
+#define WINAMP_BUTTON2 40045\r
+#define WINAMP_BUTTON3 40046\r
+#define WINAMP_BUTTON4 40047\r
+#define WINAMP_BUTTON5 40048\r
+#define WINAMP_BUTTON1_SHIFT 40144\r
+#define WINAMP_BUTTON2_SHIFT 40145\r
+#define WINAMP_BUTTON3_SHIFT 40146\r
+#define WINAMP_BUTTON4_SHIFT 40147\r
+#define WINAMP_BUTTON5_SHIFT 40148\r
+#define WINAMP_BUTTON1_CTRL 40154\r
+#define WINAMP_BUTTON2_CTRL 40155\r
+#define WINAMP_BUTTON3_CTRL 40156\r
+#define WINAMP_BUTTON4_CTRL 40157\r
+#define WINAMP_BUTTON5_CTRL 40158\r
+\r
+#define WINAMP_FILE_PLAY 40029 // pops up the load file(s) box\r
+#define WINAMP_OPTIONS_PREFS 40012 // pops up the preferences\r
+#define WINAMP_OPTIONS_AOT 40019 // toggles always on top\r
+#define WINAMP_HELP_ABOUT 40041 // pops up the about box :)\r
+\r
+\r
+/*\r
+** EOF.. Enjoy.\r
+*/\r
+\r
+#endif\r
--- /dev/null
+/* Standard Winamp input-plugin header
+ */
+
+#include "out.h"
+
+// note: exported symbol is now winampGetInModule2.
+
+#define IN_VER 0x100
+
+typedef struct
+{
+ int version; // module type (IN_VER)
+ char *description; // description of module, with version string
+
+ HWND hMainWindow; // winamp's main window (filled in by winamp)
+ HINSTANCE hDllInstance; // DLL instance handle (Also filled in by winamp)
+
+ char *FileExtensions; // "mp3\0Layer 3 MPEG\0mp2\0Layer 2 MPEG\0mpg\0Layer 1 MPEG\0"
+ // May be altered from Config, so the user can select what they want
+
+ int is_seekable; // is this stream seekable?
+ int UsesOutputPlug; // does this plug-in use the output plug-ins? (musn't ever change, ever :)
+
+ void (*Config)(HWND hwndParent); // configuration dialog
+ void (*About)(HWND hwndParent); // about dialog
+
+ void (*Init)(); // called at program init
+ void (*Quit)(); // called at program quit
+
+ void (*GetFileInfo)(char *file, char *title, int *length_in_ms); // if file == NULL, current playing is used
+ int (*InfoBox)(char *file, HWND hwndParent);
+
+ int (*IsOurFile)(char *fn); // called before extension checks, to allow detection of mms://, etc
+ // playback stuff
+ int (*Play)(char *fn); // return zero on success, -1 on file-not-found, some other value on other (stopping winamp) error
+ void (*Pause)(); // pause stream
+ void (*UnPause)(); // unpause stream
+ int (*IsPaused)(); // ispaused? return 1 if paused, 0 if not
+ void (*Stop)(); // stop (unload) stream
+
+ // time stuff
+ int (*GetLength)(); // get length in ms
+ int (*GetOutputTime)(); // returns current output time in ms. (usually returns outMod->GetOutputTime()
+ void (*SetOutputTime)(int time_in_ms); // seeks to point in stream (in ms). Usually you signal yoru thread to seek, which seeks and calls outMod->Flush()..
+
+ // volume stuff
+ void (*SetVolume)(int volume); // from 0 to 255.. usually just call outMod->SetVolume
+ void (*SetPan)(int pan); // from -127 to 127.. usually just call outMod->SetPan
+
+ // in-window builtin vis stuff
+
+ void (*SAVSAInit)(int maxlatency_in_ms, int srate); // call once in Play(). maxlatency_in_ms should be the value returned from outMod->Open()
+ // call after opening audio device with max latency in ms and samplerate
+ void (*SAVSADeInit)(); // call in Stop()
+
+
+ // simple vis supplying mode
+ void (*SAAddPCMData)(void *PCMData, int nch, int bps, int timestamp);
+ // sets the spec data directly from PCM data
+ // quick and easy way to get vis working :)
+ // needs at least 576 samples :)
+
+ // advanced vis supplying mode, only use if you're cool. Use SAAddPCMData for most stuff.
+ int (*SAGetMode)(); // gets csa (the current type (4=ws,2=osc,1=spec))
+ // use when calling SAAdd()
+ void (*SAAdd)(void *data, int timestamp, int csa); // sets the spec data, filled in by winamp
+
+
+ // vis stuff (plug-in)
+ // simple vis supplying mode
+ void (*VSAAddPCMData)(void *PCMData, int nch, int bps, int timestamp); // sets the vis data directly from PCM data
+ // quick and easy way to get vis working :)
+ // needs at least 576 samples :)
+
+ // advanced vis supplying mode, only use if you're cool. Use VSAAddPCMData for most stuff.
+ int (*VSAGetMode)(int *specNch, int *waveNch); // use to figure out what to give to VSAAdd
+ void (*VSAAdd)(void *data, int timestamp); // filled in by winamp, called by plug-in
+
+
+ // call this in Play() to tell the vis plug-ins the current output params.
+ void (*VSASetInfo)(int nch, int srate);
+
+
+ // dsp plug-in processing:
+ // (filled in by winamp, called by input plug)
+
+ // returns 1 if active (which means that the number of samples returned by dsp_dosamples
+ // could be greater than went in.. Use it to estimate if you'll have enough room in the
+ // output buffer
+ int (*dsp_isactive)();
+
+ // returns number of samples to output. This can be as much as twice numsamples.
+ // be sure to allocate enough buffer for samples, then.
+ int (*dsp_dosamples)(short int *samples, int numsamples, int bps, int nch, int srate);
+
+
+ // eq stuff
+ void (*EQSet)(int on, char data[10], int preamp); // 0-64 each, 31 is +0, 0 is +12, 63 is -12. Do nothing to ignore.
+
+ // info setting (filled in by winamp)
+ void (*SetInfo)(int bitrate, int srate, int stereo, int synched); // if -1, changes ignored? :)
+
+ Out_Module *outMod; // filled in by winamp, optionally used :)
+} In_Module;