Browse code

update for C++17 compliance, update to latest 2sf, add WINE cross-compile makefiles

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