00001 #ifdef __cplusplus
00002 extern "C" {
00003 #endif
00004
00005 #define OUT_VER 0x10
00006
00007 typedef struct
00008 {
00009 int version; // module version (OUT_VER)
00010 char *description; // description of module, with version string
00011 int id; // module id. each input module gets its own. non-nullsoft modules should
00012 // be >= 65536.
00013
00014 HWND hMainWindow; // winamp's main window (filled in by winamp)
00015 HINSTANCE hDllInstance; // DLL instance handle (filled in by winamp)
00016
00017 void (*Config)(HWND hwndParent); // configuration dialog
00018 void (*About)(HWND hwndParent); // about dialog
00019
00020 void (*Init)(); // called when loaded
00021 void (*Quit)(); // called when unloaded
00022
00023 int (*Open)(int samplerate, int numchannels, int bitspersamp, int bufferlenms, int prebufferms);
00024 // returns >=0 on success, <0 on failure
00025 // NOTENOTENOTE: bufferlenms and prebufferms are ignored in most if not all output plug-ins.
00026 // ... so don't expect the max latency returned to be what you asked for.
00027 // returns max latency in ms (0 for diskwriters, etc)
00028 // bufferlenms and prebufferms must be in ms. 0 to use defaults.
00029 // prebufferms must be <= bufferlenms
00030
00031 void (*Close)(); // close the ol' output device.
00032
00033 int (*Write)(char *buf, int len);
00034 // 0 on success. Len == bytes to write (<= 8192 always). buf is straight audio data.
00035 // 1 returns not able to write (yet). Non-blocking, always.
00036
00037 int (*CanWrite)(); // returns number of bytes possible to write at a given time.
00038 // Never will decrease unless you call Write (or Close, heh)
00039
00040 int (*IsPlaying)(); // non0 if output is still going or if data in buffers waiting to be
00041 // written (i.e. closing while IsPlaying() returns 1 would truncate the song
00042
00043 int (*Pause)(int pause); // returns previous pause state
00044
00045 void (*SetVolume)(int volume); // volume is 0-255
00046 void (*SetPan)(int pan); // pan is -128 to 128
00047
00048 void (*Flush)(int t); // flushes buffers and restarts output at time t (in ms)
00049 // (used for seeking)
00050
00051 int (*GetOutputTime)(); // returns played time in MS
00052 int (*GetWrittenTime)(); // returns time written in MS (used for synching up vis stuff)
00053
00054 #ifdef __GNUC__
00055 } __attribute__ ((packed)) Out_Module;
00056 #else // __GNUC__
00057 } Out_Module;
00058 #endif // __GNUC__
00059
00060 #ifdef __cplusplus
00061 }
00062 #endif
00063
1.2.9.1 written by Dimitri van Heesch,
© 1997-2001