OSDN Git Service

[portaudio] Import pa_stable_v190700_20210406
[timidity41/timidity41.git] / Winamp / OUT.H
1 #ifndef NULLSOFT_OUTH
2 #define NULLSOFT_OUTH
3 #include <windows.h>
4 #include <stddef.h>
5 // ids:
6 // waveout: 32
7 // gapless: 64
8 // xfade: 63
9 // disk: 33
10 // dsound: 38
11 // NULL: 65
12 // mm2: 69
13
14 #if (_MSC_VER <= 1200)
15 typedef int intptr_t;
16 #endif
17
18 #define OUT_VER 0x10
19
20 typedef struct 
21 {
22         int version;                            // module version (OUT_VER)
23         char *description;                      // description of module, with version string
24         intptr_t id;                                            // module id. each input module gets its own. non-nullsoft modules should
25                                                                 // be >= 65536. 
26
27         HWND hMainWindow;                       // winamp's main window (filled in by winamp)
28         HINSTANCE hDllInstance;         // DLL instance handle (filled in by winamp)
29
30         void (*Config)(HWND hwndParent); // configuration dialog 
31         void (*About)(HWND hwndParent);  // about dialog
32
33         void (*Init)();                         // called when loaded
34         void (*Quit)();                         // called when unloaded
35
36         int (*Open)(int samplerate, int numchannels, int bitspersamp, int bufferlenms, int prebufferms); 
37                                         // returns >=0 on success, <0 on failure
38
39                                         // NOTENOTENOTE: bufferlenms and prebufferms are ignored in most if not all output plug-ins. 
40                                         //    ... so don't expect the max latency returned to be what you asked for.
41                                         // returns max latency in ms (0 for diskwriters, etc)
42                                         // bufferlenms and prebufferms must be in ms. 0 to use defaults. 
43                                         // prebufferms must be <= bufferlenms
44                                         // pass bufferlenms==-666 to tell the output plugin that it's clock is going to be used to sync video
45                                         //   out_ds turns off silence-eating when -666 is passed
46
47         void (*Close)();        // close the ol' output device.
48
49         int (*Write)(char *buf, int len);       
50                                         // 0 on success. Len == bytes to write (<= 8192 always). buf is straight audio data. 
51                                         // 1 returns not able to write (yet). Non-blocking, always.
52
53         int (*CanWrite)();      // returns number of bytes possible to write at a given time. 
54                                                 // Never will decrease unless you call Write (or Close, heh)
55
56         int (*IsPlaying)(); // non0 if output is still going or if data in buffers waiting to be
57                                                 // written (i.e. closing while IsPlaying() returns 1 would truncate the song
58
59         int (*Pause)(int pause); // returns previous pause state
60
61         void (*SetVolume)(int volume); // volume is 0-255
62         void (*SetPan)(int pan); // pan is -128 to 128
63
64         void (*Flush)(int t);   // flushes buffers and restarts output at time t (in ms) 
65                                                         // (used for seeking)
66
67         int (*GetOutputTime)(); // returns played time in MS
68         int (*GetWrittenTime)(); // returns time written in MS (used for synching up vis stuff)
69
70 } Out_Module;
71
72
73 #endif