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