1 #define OUT_VER 0x10 2 3 typedef struct 4 { 5 int version; // module version (OUT_VER) 6 char *description; // description of module, with version string 7 int id; // module id. each input module gets its own. non-nullsoft modules should 8 // be >= 65536. 9 10 HWND hMainWindow; // winamp's main window (filled in by winamp) 11 HINSTANCE hDllInstance; // DLL instance handle (filled in by winamp) 12 13 void (*Config)(HWND hwndParent); // configuration dialog 14 void (*About)(HWND hwndParent); // about dialog 15 16 void (*Init)(); // called when loaded 17 void (*Quit)(); // called when unloaded 18 19 int (*Open)(int samplerate, int numchannels, int bitspersamp, int bufferlenms, int prebufferms); 20 // returns >=0 on success, <0 on failure 21 // NOTENOTENOTE: bufferlenms and prebufferms are ignored in most if not all output plug-ins. 22 // ... so don't expect the max latency returned to be what you asked for. 23 // returns max latency in ms (0 for diskwriters, etc) 24 // bufferlenms and prebufferms must be in ms. 0 to use defaults. 25 // prebufferms must be <= bufferlenms 26 27 void (*Close)(); // close the ol' output device. 28 29 int (*Write)(char *buf, int len); 30 // 0 on success. Len == bytes to write (<= 8192 always). buf is straight audio data. 31 // 1 returns not able to write (yet). Non-blocking, always. 32 33 int (*CanWrite)(); // returns number of bytes possible to write at a given time. 34 // Never will decrease unless you call Write (or Close, heh) 35 36 int (*IsPlaying)(); // non0 if output is still going or if data in buffers waiting to be 37 // written (i.e. closing while IsPlaying() returns 1 would truncate the song 38 39 int (*Pause)(int pause); // returns previous pause state 40 41 void (*SetVolume)(int volume); // volume is 0-255 42 void (*SetPan)(int pan); // pan is -128 to 128 43 44 void (*Flush)(int t); // flushes buffers and restarts output at time t (in ms) 45 // (used for seeking) 46 47 int (*GetOutputTime)(); // returns played time in MS 48 int (*GetWrittenTime)(); // returns time written in MS (used for synching up vis stuff) 49 50 } Out_Module; 51 52 53 54 // note: exported symbol is now winampGetInModule2. 55 56 #define IN_VER 0x100 57 58 typedef struct 59 { 60 int version; // module type (IN_VER) 61 char *description; // description of module, with version string 62 63 HWND hMainWindow; // winamp's main window (filled in by winamp) 64 HINSTANCE hDllInstance; // DLL instance handle (Also filled in by winamp) 65 66 char *FileExtensions; // "mp3\0Layer 3 MPEG\0mp2\0Layer 2 MPEG\0mpg\0Layer 1 MPEG\0" 67 // May be altered from Config, so the user can select what they want 68 69 int is_seekable; // is this stream seekable? 70 int UsesOutputPlug; // does this plug-in use the output plug-ins? (musn't ever change, ever :) 71 72 void (*Config)(HWND hwndParent); // configuration dialog 73 void (*About)(HWND hwndParent); // about dialog 74 75 void (*Init)(); // called at program init 76 void (*Quit)(); // called at program quit 77 78 void (*GetFileInfo)(char *file, char *title, int *length_in_ms); // if file == NULL, current playing is used 79 int (*InfoBox)(char *file, HWND hwndParent); 80 81 int (*IsOurFile)(char *fn); // called before extension checks, to allow detection of mms://, etc 82 // playback stuff 83 int (*Play)(char *fn); // return zero on success, -1 on file-not-found, some other value on other (stopping winamp) error 84 void (*Pause)(); // pause stream 85 void (*UnPause)(); // unpause stream 86 int (*IsPaused)(); // ispaused? return 1 if paused, 0 if not 87 void (*Stop)(); // stop (unload) stream 88 89 // time stuff 90 int (*GetLength)(); // get length in ms 91 int (*GetOutputTime)(); // returns current output time in ms. (usually returns outMod->GetOutputTime() 92 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().. 93 94 // volume stuff 95 void (*SetVolume)(int volume); // from 0 to 255.. usually just call outMod->SetVolume 96 void (*SetPan)(int pan); // from -127 to 127.. usually just call outMod->SetPan 97 98 // in-window builtin vis stuff 99 100 void (*SAVSAInit)(int maxlatency_in_ms, int srate); // call once in Play(). maxlatency_in_ms should be the value returned from outMod->Open() 101 // call after opening audio device with max latency in ms and samplerate 102 void (*SAVSADeInit)(); // call in Stop() 103 104 105 // simple vis supplying mode 106 void (*SAAddPCMData)(void *PCMData, int nch, int bps, int timestamp); 107 // sets the spec data directly from PCM data 108 // quick and easy way to get vis working :) 109 // needs at least 576 samples :) 110 111 // advanced vis supplying mode, only use if you're cool. Use SAAddPCMData for most stuff. 112 int (*SAGetMode)(); // gets csa (the current type (4=ws,2=osc,1=spec)) 113 // use when calling SAAdd() 114 void (*SAAdd)(void *data, int timestamp, int csa); // sets the spec data, filled in by winamp 115 116 117 // vis stuff (plug-in) 118 // simple vis supplying mode 119 void (*VSAAddPCMData)(void *PCMData, int nch, int bps, int timestamp); // sets the vis data directly from PCM data 120 // quick and easy way to get vis working :) 121 // needs at least 576 samples :) 122 123 // advanced vis supplying mode, only use if you're cool. Use VSAAddPCMData for most stuff. 124 int (*VSAGetMode)(int *specNch, int *waveNch); // use to figure out what to give to VSAAdd 125 void (*VSAAdd)(void *data, int timestamp); // filled in by winamp, called by plug-in 126 127 128 // call this in Play() to tell the vis plug-ins the current output params. 129 void (*VSASetInfo)(int nch, int srate); 130 131 132 // dsp plug-in processing: 133 // (filled in by winamp, called by input plug) 134 135 // returns 1 if active (which means that the number of samples returned by dsp_dosamples 136 // could be greater than went in.. Use it to estimate if you'll have enough room in the 137 // output buffer 138 int (*dsp_isactive)(); 139 140 // returns number of samples to output. This can be as much as twice numsamples. 141 // be sure to allocate enough buffer for samples, then. 142 int (*dsp_dosamples)(short int *samples, int numsamples, int bps, int nch, int srate); 143 144 145 // eq stuff 146 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. 147 148 // info setting (filled in by winamp) 149 void (*SetInfo)(int bitrate, int srate, int stereo, int synched); // if -1, changes ignored? :) 150 151 Out_Module *outMod; // filled in by winamp, optionally used :) 152 } In_Module; 153 154 155 #define WINAMP_FILE_QUIT 40001 156 #define WINAMP_OPTIONS_PREFS 40012 157 #define WINAMP_OPTIONS_AOT 40019 158 #define WINAMP_FILE_REPEAT 40022 159 #define WINAMP_FILE_SHUFFLE 40023 160 #define WINAMP_HIGH_PRIORITY 40025 161 #define WINAMP_FILE_PLAY 40029 162 #define WINAMP_OPTIONS_EQ 40036 163 #define WINAMP_OPTIONS_ELAPSED 40037 164 #define WINAMP_OPTIONS_REMAINING 40038 165 #define WINAMP_OPTIONS_PLEDIT 40040 166 #define WINAMP_HELP_ABOUT 40041 167 #define WINAMP_MAINMENU 40043 168 #define WINAMP_BUTTON1 40044 169 #define WINAMP_BUTTON2 40045 170 #define WINAMP_BUTTON3 40046 171 #define WINAMP_BUTTON4 40047 172 #define WINAMP_BUTTON5 40048 173 #define WINAMP_VOLUMEUP 40058 174 #define WINAMP_VOLUMEDOWN 40059 175 #define WINAMP_FFWD5S 40060 176 #define WINAMP_REW5S 40061 177 #define WINAMP_NEXT_WINDOW 40063 178 #define WINAMP_OPTIONS_WINDOWSHADE 40064 179 #define WINAMP_BUTTON1_SHIFT 40144 180 #define WINAMP_BUTTON2_SHIFT 40145 181 #define WINAMP_BUTTON3_SHIFT 40146 182 #define WINAMP_BUTTON4_SHIFT 40147 183 #define WINAMP_BUTTON5_SHIFT 40148 184 #define WINAMP_BUTTON1_CTRL 40154 185 #define WINAMP_BUTTON2_CTRL 40155 186 #define WINAMP_BUTTON3_CTRL 40156 187 #define WINAMP_BUTTON4_CTRL 40157 188 #define WINAMP_BUTTON5_CTRL 40158 189 #define WINAMP_OPTIONS_DSIZE 40165 190 #define IDC_SORT_FILENAME 40166 191 #define IDC_SORT_FILETITLE 40167 192 #define IDC_SORT_ENTIREFILENAME 40168 193 #define IDC_SELECTALL 40169 194 #define IDC_SELECTNONE 40170 195 #define IDC_SELECTINV 40171 196 #define IDM_EQ_LOADPRE 40172 197 #define IDM_EQ_LOADMP3 40173 198 #define IDM_EQ_LOADDEFAULT 40174 199 #define IDM_EQ_SAVEPRE 40175 200 #define IDM_EQ_SAVEMP3 40176 201 #define IDM_EQ_SAVEDEFAULT 40177 202 #define IDM_EQ_DELPRE 40178 203 #define IDM_EQ_DELMP3 40180 204 #define IDC_PLAYLIST_PLAY 40184 205 #define WINAMP_FILE_LOC 40185 206 #define WINAMP_OPTIONS_EASYMOVE 40186 207 #define WINAMP_FILE_DIR 40187 208 #define WINAMP_EDIT_ID3 40188 209 #define WINAMP_TOGGLE_AUTOSCROLL 40189 210 #define WINAMP_VISSETUP 40190 211 #define WINAMP_PLGSETUP 40191 212 #define WINAMP_VISPLUGIN 40192 213 #define WINAMP_JUMP 40193 214 #define WINAMP_JUMPFILE 40194 215 #define WINAMP_JUMP10FWD 40195 216 #define WINAMP_JUMP10BACK 40197 217