rtoss - Blame information for rev 182

Subversion Repositories:
Rev:
Rev Author Line No. Line
182 roytam 1  
2 #ifndef NULLSOFT_WINAMP_IN2H
3 #define NULLSOFT_WINAMP_IN2H
181 roytam 4 #include "out.h"
5  
6 // note: exported symbol is now winampGetInModule2.
7  
182 roytam 8 #define IN_UNICODE 0x0F000000
9  
10 #ifdef UNICODE_INPUT_PLUGIN
11 #define in_char wchar_t
12 #define IN_VER (IN_UNICODE | 0x100)
13 #else
14 #define in_char char
181 roytam 15 #define IN_VER 0x100
182 roytam 16 #endif
181 roytam 17  
182 roytam 18 #define IN_MODULE_FLAG_USES_OUTPUT_PLUGIN 1
19 // By default, Winamp assumes that your input plugin wants to use Winamp's EQ, and doesn't do replay gain
20 // if you handle any of these yourself (EQ, Replay Gain adjustments), then set these flags accordingly
21 #define IN_MODULE_FLAG_EQ 2 // set this if you do your own EQ
22 #define IN_MODULE_FLAG_REPLAYGAIN 8 // set this if you adjusted volume for replay gain
23 // for tracks with no replay gain metadata, you should clear this flag
24 // UNLESS you handle "non_replaygain" gain adjustment yourself
25 #define IN_MODULE_FLAG_REPLAYGAIN_PREAMP 16 // use this if you queried for the replay gain preamp parameter and used it
26 // this parameter is new to 5.54
181 roytam 27 typedef struct
28 {
29 int version; // module type (IN_VER)
30 char *description; // description of module, with version string
31  
32 HWND hMainWindow; // winamp's main window (filled in by winamp)
33 HINSTANCE hDllInstance; // DLL instance handle (Also filled in by winamp)
34  
35 char *FileExtensions; // "mp3\0Layer 3 MPEG\0mp2\0Layer 2 MPEG\0mpg\0Layer 1 MPEG\0"
36 // May be altered from Config, so the user can select what they want
37  
38 int is_seekable; // is this stream seekable?
39 int UsesOutputPlug; // does this plug-in use the output plug-ins? (musn't ever change, ever :)
182 roytam 40 // note that this has turned into a "flags" field
41 // see IN_MODULE_FLAG_*
181 roytam 42  
43 void (*Config)(HWND hwndParent); // configuration dialog
44 void (*About)(HWND hwndParent); // about dialog
45  
46 void (*Init)(); // called at program init
47 void (*Quit)(); // called at program quit
48  
182 roytam 49 #define GETFILEINFO_TITLE_LENGTH 2048
50 void (*GetFileInfo)(const in_char *file, in_char *title, int *length_in_ms); // if file == NULL, current playing is used
51  
52 #define INFOBOX_EDITED 0
53 #define INFOBOX_UNCHANGED 1
54 int (*InfoBox)(const in_char *file, HWND hwndParent);
181 roytam 55  
182 roytam 56 int (*IsOurFile)(const in_char *fn); // called before extension checks, to allow detection of mms://, etc
181 roytam 57 // playback stuff
182 roytam 58 int (*Play)(const in_char *fn); // return zero on success, -1 on file-not-found, some other value on other (stopping winamp) error
181 roytam 59 void (*Pause)(); // pause stream
60 void (*UnPause)(); // unpause stream
61 int (*IsPaused)(); // ispaused? return 1 if paused, 0 if not
62 void (*Stop)(); // stop (unload) stream
63  
64 // time stuff
65 int (*GetLength)(); // get length in ms
66 int (*GetOutputTime)(); // returns current output time in ms. (usually returns outMod->GetOutputTime()
182 roytam 67 void (*SetOutputTime)(int time_in_ms); // seeks to point in stream (in ms). Usually you signal your thread to seek, which seeks and calls outMod->Flush()..
181 roytam 68  
69 // volume stuff
70 void (*SetVolume)(int volume); // from 0 to 255.. usually just call outMod->SetVolume
71 void (*SetPan)(int pan); // from -127 to 127.. usually just call outMod->SetPan
72  
73 // in-window builtin vis stuff
74  
75 void (*SAVSAInit)(int maxlatency_in_ms, int srate); // call once in Play(). maxlatency_in_ms should be the value returned from outMod->Open()
76 // call after opening audio device with max latency in ms and samplerate
77 void (*SAVSADeInit)(); // call in Stop()
78  
79  
80 // simple vis supplying mode
81 void (*SAAddPCMData)(void *PCMData, int nch, int bps, int timestamp);
82 // sets the spec data directly from PCM data
83 // quick and easy way to get vis working :)
84 // needs at least 576 samples :)
85  
86 // advanced vis supplying mode, only use if you're cool. Use SAAddPCMData for most stuff.
87 int (*SAGetMode)(); // gets csa (the current type (4=ws,2=osc,1=spec))
88 // use when calling SAAdd()
182 roytam 89 int (*SAAdd)(void *data, int timestamp, int csa); // sets the spec data, filled in by winamp
181 roytam 90  
91  
92 // vis stuff (plug-in)
93 // simple vis supplying mode
94 void (*VSAAddPCMData)(void *PCMData, int nch, int bps, int timestamp); // sets the vis data directly from PCM data
95 // quick and easy way to get vis working :)
96 // needs at least 576 samples :)
97  
98 // advanced vis supplying mode, only use if you're cool. Use VSAAddPCMData for most stuff.
99 int (*VSAGetMode)(int *specNch, int *waveNch); // use to figure out what to give to VSAAdd
182 roytam 100 int (*VSAAdd)(void *data, int timestamp); // filled in by winamp, called by plug-in
181 roytam 101  
102  
103 // call this in Play() to tell the vis plug-ins the current output params.
182 roytam 104 void (*VSASetInfo)(int srate, int nch); // <-- Correct (benski, dec 2005).. old declaration had the params backwards
181 roytam 105  
106  
107 // dsp plug-in processing:
182 roytam 108 // (filled in by winamp, calld by input plug)
181 roytam 109  
110 // returns 1 if active (which means that the number of samples returned by dsp_dosamples
111 // could be greater than went in.. Use it to estimate if you'll have enough room in the
112 // output buffer
113 int (*dsp_isactive)();
114  
115 // returns number of samples to output. This can be as much as twice numsamples.
116 // be sure to allocate enough buffer for samples, then.
117 int (*dsp_dosamples)(short int *samples, int numsamples, int bps, int nch, int srate);
118  
119  
120 // eq stuff
121 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.
122  
123 // info setting (filled in by winamp)
124 void (*SetInfo)(int bitrate, int srate, int stereo, int synched); // if -1, changes ignored? :)
125  
126 Out_Module *outMod; // filled in by winamp, optionally used :)
127 } In_Module;
128  
182 roytam 129 // return values from the winampUninstallPlugin(HINSTANCE hdll, HWND parent, int param)
130 // which determine if we can uninstall the plugin immediately or on winamp restart
131 //
132 // uninstall support was added from 5.0+ and uninstall now support from 5.5+
133 // it is down to you to ensure that if uninstall now is returned that it will not cause a crash
134 // (ie don't use if you've been subclassing the main window)
135 #define IN_PLUGIN_UNINSTALL_NOW 0x1
136 #define IN_PLUGIN_UNINSTALL_REBOOT 0x0
181 roytam 137  
182 roytam 138 #endif