fix bug where play() was dying instead of skipping over bad files
[platform/upstream/flac.git] / src / plugin_winamp2 / out.h
1 /* Standard Winamp output-plugin header
2  */
3
4 #define OUT_VER 0x10
5
6 typedef struct
7 {
8         int version;                            // module version (OUT_VER)
9         char *description;                      // description of module, with version string
10         int id;                                         // module id. each input module gets its own. non-nullsoft modules should
11                                                                 // be >= 65536.
12
13         HWND hMainWindow;                       // winamp's main window (filled in by winamp)
14         HINSTANCE hDllInstance;         // DLL instance handle (filled in by winamp)
15
16         void (*Config)(HWND hwndParent); // configuration dialog
17         void (*About)(HWND hwndParent);  // about dialog
18
19         void (*Init)();                         // called when loaded
20         void (*Quit)();                         // called when unloaded
21
22         int (*Open)(int samplerate, int numchannels, int bitspersamp, int bufferlenms, int prebufferms);
23                                         // returns >=0 on success, <0 on failure
24                                         // NOTENOTENOTE: bufferlenms and prebufferms are ignored in most if not all output plug-ins.
25                                         //    ... so don't expect the max latency returned to be what you asked for.
26                                         // returns max latency in ms (0 for diskwriters, etc)
27                                         // bufferlenms and prebufferms must be in ms. 0 to use defaults.
28                                         // prebufferms must be <= bufferlenms
29
30         void (*Close)();        // close the ol' output device.
31
32         int (*Write)(char *buf, int len);
33                                         // 0 on success. Len == bytes to write (<= 8192 always). buf is straight audio data.
34                                         // 1 returns not able to write (yet). Non-blocking, always.
35
36         int (*CanWrite)();      // returns number of bytes possible to write at a given time.
37                                                 // Never will decrease unless you call Write (or Close, heh)
38
39         int (*IsPlaying)(); // non0 if output is still going or if data in buffers waiting to be
40                                                 // written (i.e. closing while IsPlaying() returns 1 would truncate the song
41
42         int (*Pause)(int pause); // returns previous pause state
43
44         void (*SetVolume)(int volume); // volume is 0-255
45         void (*SetPan)(int pan); // pan is -128 to 128
46
47         void (*Flush)(int t);   // flushes buffers and restarts output at time t (in ms)
48                                                         // (used for seeking)
49
50         int (*GetOutputTime)(); // returns played time in MS
51         int (*GetWrittenTime)(); // returns time written in MS (used for synching up vis stuff)
52
53 } Out_Module;
54
55