1 #include "out.h"
2 
3 // note: exported symbol is now winampGetInModule2.
4 
5 #define IN_VER 0x100
6 
7 typedef struct
8 {
9     int version;                // module type (IN_VER)
10     char *description;            // description of module, with version string
11 
12     HWND hMainWindow;            // winamp's main window (filled in by winamp)
13     HINSTANCE hDllInstance;        // DLL instance handle (Also filled in by winamp)
14 
15     char *FileExtensions;        // "mp3\0Layer 3 MPEG\0mp2\0Layer 2 MPEG\0mpg\0Layer 1 MPEG\0"
16                                 // May be altered from Config, so the user can select what they want
17 
18     int is_seekable;            // is this stream seekable?
19     int UsesOutputPlug;            // does this plug-in use the output plug-ins? (musn't ever change, ever :)
20 
21     void (*Config)(HWND hwndParent); // configuration dialog
22     void (*About)(HWND hwndParent);  // about dialog
23 
24     void (*Init)();                // called at program init
25     void (*Quit)();                // called at program quit
26 
27     void (*GetFileInfo)(char *file, char *title, int *length_in_ms); // if file == NULL, current playing is used
28     int (*InfoBox)(char *file, HWND hwndParent);
29 
30     int (*IsOurFile)(char *fn);    // called before extension checks, to allow detection of mms://, etc
31     // playback stuff
32     int (*Play)(char *fn);        // return zero on success, -1 on file-not-found, some other value on other (stopping winamp) error
33     void (*Pause)();            // pause stream
34     void (*UnPause)();            // unpause stream
35     int (*IsPaused)();            // ispaused? return 1 if paused, 0 if not
36     void (*Stop)();                // stop (unload) stream
37 
38     // time stuff
39     int (*GetLength)();            // get length in ms
40     int (*GetOutputTime)();        // returns current output time in ms. (usually returns outMod->GetOutputTime()
41     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()..
42 
43     // volume stuff
44     void (*SetVolume)(int volume);    // from 0 to 255.. usually just call outMod->SetVolume
45     void (*SetPan)(int pan);    // from -127 to 127.. usually just call outMod->SetPan
46 
47     // in-window builtin vis stuff
48 
49     void (*SAVSAInit)(int maxlatency_in_ms, int srate);        // call once in Play(). maxlatency_in_ms should be the value returned from outMod->Open()
50     // call after opening audio device with max latency in ms and samplerate
51     void (*SAVSADeInit)();    // call in Stop()
52 
53 
54     // simple vis supplying mode
55     void (*SAAddPCMData)(void *PCMData, int nch, int bps, int timestamp);
56                                             // sets the spec data directly from PCM data
57                                             // quick and easy way to get vis working :)
58                                             // needs at least 576 samples :)
59 
60     // advanced vis supplying mode, only use if you're cool. Use SAAddPCMData for most stuff.
61     int (*SAGetMode)();        // gets csa (the current type (4=ws,2=osc,1=spec))
62                             // use when calling SAAdd()
63     void (*SAAdd)(void *data, int timestamp, int csa); // sets the spec data, filled in by winamp
64 
65 
66     // vis stuff (plug-in)
67     // simple vis supplying mode
68     void (*VSAAddPCMData)(void *PCMData, int nch, int bps, int timestamp); // sets the vis data directly from PCM data
69                                             // quick and easy way to get vis working :)
70                                             // needs at least 576 samples :)
71 
72     // advanced vis supplying mode, only use if you're cool. Use VSAAddPCMData for most stuff.
73     int (*VSAGetMode)(int *specNch, int *waveNch); // use to figure out what to give to VSAAdd
74     void (*VSAAdd)(void *data, int timestamp); // filled in by winamp, called by plug-in
75 
76 
77     // call this in Play() to tell the vis plug-ins the current output params.
78     void (*VSASetInfo)(int nch, int srate);
79 
80 
81     // dsp plug-in processing:
82     // (filled in by winamp, called by input plug)
83 
84     // returns 1 if active (which means that the number of samples returned by dsp_dosamples
85     // could be greater than went in.. Use it to estimate if you'll have enough room in the
86     // output buffer
87     int (*dsp_isactive)();
88 
89     // returns number of samples to output. This can be as much as twice numsamples.
90     // be sure to allocate enough buffer for samples, then.
91     int (*dsp_dosamples)(short int *samples, int numsamples, int bps, int nch, int srate);
92 
93 
94     // eq stuff
95     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.
96 
97     // info setting (filled in by winamp)
98     void (*SetInfo)(int bitrate, int srate, int stereo, int synched); // if -1, changes ignored? :)
99 
100     Out_Module *outMod; // filled in by winamp, optionally used :)
101 } In_Module;
102