1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
|
#ifndef M_MUSIC
#define M_MUSIC
#define MIID_WATRACK {0xfc6c81f4, 0x837e, 0x4430, {0x96, 0x01, 0xa0, 0xaa, 0x43, 0x17, 0x7a, 0xe3}}
typedef struct tSongInfoA {
CHAR *artist;
CHAR *title;
CHAR *album;
CHAR *genre;
CHAR *comment;
CHAR *year;
CHAR *mfile; // media file
int kbps;
int khz;
int channels;
int track;
int total; // music length
int time; // elapsed time
CHAR *wndtext; // window title
CHAR *player; // player name
int plyver; // player version
HANDLE icon; // player icon
int fsize; // media file size
int vbr;
int status; // player status: 0 - stopped; 1 - playing; 2 - paused
HWND plwnd; // player window
// video part
int codec;
int width;
int height;
int fps;
__int64 date;
CHAR *txtver;
CHAR *lyric;
CHAR *cover;
int volume;
CHAR *url;
} SONGINFOA, *LPSONGINFOA;
typedef struct tSongInfo {
WCHAR *artist;
WCHAR *title;
WCHAR *album;
WCHAR *genre;
WCHAR *comment;
WCHAR *year;
WCHAR *mfile; // media file
int kbps;
int khz;
int channels;
int track;
int total; // music length
int time; // elapsed time
WCHAR *wndtext; // window title
WCHAR *player; // player name
int plyver; // player version
HANDLE icon; // player icon
int fsize; // media file size
int vbr;
int status; // player status: 0 - stopped; 1 - playing; 2 - paused
HWND plwnd; // player window
// video part
int codec;
int width;
int height;
int fps;
__int64 date;
WCHAR txtver;
// not implemented yet
WCHAR *lyric;
WCHAR *cover;
int volume;
WCHAR *url;
} SONGINFO, *LPSONGINFO;
#if defined(_UNICODE)
#define WAT_INF_TCHAR WAT_INF_UNICODE
#define SongInfoT tSongInfo
#else
#define WAT_INF_TCHAR WAT_INF_ANSI
#define SongInfoT tSongInfoA
#endif
// result codes
#define WAT_RES_UNKNOWN -2
#define WAT_RES_NOTFOUND -1
#define WAT_RES_ERROR WAT_RES_NOTFOUND
#define WAT_RES_OK 0
#define WAT_RES_ENABLED WAT_RES_OK
#define WAT_RES_DISABLED 1
// internal
#define WAT_RES_NEWFILE 3
#define WAT_PLS_NORMAL WAT_RES_OK
#define WAT_PLS_NOMUSIC WAT_RES_DISABLED
#define WAT_PLS_NOTFOUND WAT_RES_NOTFOUND
#define WAT_INF_UNICODE 0
#define WAT_INF_ANSI 1
#define WAT_INF_UTF8 2
#define WAT_INF_CHANGES 0x100
/*
wParam : WAT_INF_* constant
lParam : pointer to LPSONGINGO (Unicode) or LPSONGINFOA (ANSI/UTF8)
Affects: Fill structure by currently played music info
returns: WAT_PLS_* constant
note: pointer will be point to global SONGINFO structure of plugin
warning: Non-Unicode data filled only by request
if lParam=0 only internal SongInfo structure will be filled
Example:
LPSONGINFO p;
PluginLink->CallService(MS_WAT_GETMUSICINFO,0,(DWORD)&p);
*/
#define MS_WAT_GETMUSICINFO "WATrack/GetMusicInfo"
/*
wParam:0
lParam : pointer to pSongInfo (Unicode)
Affects: Fill structure by info from file named in SongInfo.mfile
returns: 0, if success
note: fields, which values can't be obtained, leaves old values.
you must free given strings by miranda mmi.free
*/
#define MS_WAT_GETFILEINFO "WATrack/GetFileInfo"
/*
Get user's Music Info
*/
#define MS_WAT_GETCONTACTINFO = "WATrack/GetContactInfo"
#define WAT_CTRL_PREV 1
#define WAT_CTRL_PLAY 2
#define WAT_CTRL_PAUSE 3
#define WAT_CTRL_STOP 4
#define WAT_CTRL_NEXT 5
#define WAT_CTRL_VOLDN 6
#define WAT_CTRL_VOLUP 7
#define WAT_CTRL_SEEK 8 // lParam is new position (sec)
/*
wParam: button code (WAT_CTRL_* const)
lParam: 0, or value (see WAT_CTRL_* const comments)
Affects: emulate player button pressing
returns: 0 if unsuccesful
*/
#define MS_WAT_PRESSBUTTON "WATrack/PressButton"
// ------------ Plugin/player status ------------
/*
wParam: 1 - switch off plugin
0 - switch on plugin
-1 - switch plugin status
other - get plugin status
lParam: 0
Affects: Switch plugin status to enabled or disabled
returns: old plugin status, 0, if was enabled
*/
#define MS_WAT_PLUGINSTATUS "WATrack/PluginStatus"
#define ME_WAT_MODULELOADED "WATrack/ModuleLoaded"
#define WAT_EVENT_PLAYERSTATUS 1 // 0-normal; 1-no music (possibly stopped); 2-not found
#define WAT_EVENT_NEWTRACK 2
#define WAT_EVENT_PLUGINSTATUS 3 // 0-enabled; 1-dis.temporary; 2-dis.permanent
#define WAT_EVENT_NEWPLAYER 4 //
#define WAT_EVENT_NEWTEMPLATE 5 // TM_* constant
/*
Plugin or player status changed:
wParam: type of event (see above)
lParam: value
*/
#define ME_WAT_NEWSTATUS "WATrack/NewStatus"
// ---------- Popup module ------------
/*
wParam: not used
lParam: not used
Affects: Show popup or Info window with current music information
note: Only Info window will be showed if Popup plugin disabled
*/
#define MS_WAT_SHOWMUSICINFO "WATrack/ShowMusicInfo"
// --------- Statistic (report) module -------------
/*
wParam: pointer to log file name or NULL
lParam: pointer to report file name or NULL
Affects: Create report from log and run it (if option is set)
returns: 0 if unsuccesful
note: if wParam or lParam is a NULL then file names from options are used
*/
#define MS_WAT_MAKEREPORT "WATrack/MakeReport"
/*
wParam, lParam - not used
Affects: pack statistic file
*/
#define MS_WAT_PACKLOG = "WATrack/PackLog"
/*
wParam: not used
lParam: pointer to SongInfo
*/
#define MS_WAT_ADDTOLOG = "WATrack/AddToLog"
// ----------- Formats and players -----------
// media file status
#define WAT_MES_STOPPED 0
#define WAT_MES_PLAYING 1
#define WAT_MES_PAUSED 2
#define WAT_MES_UNKNOWN -1
#define WAT_ACT_REGISTER 1
#define WAT_ACT_UNREGISTER 2
#define WAT_ACT_DISABLE 3
#define WAT_ACT_ENABLE 4
#define WAT_ACT_GETSTATUS 5 // not found/enabled/disabled
#define WAT_ACT_SETACTIVE 6
#define WAT_ACT_REPLACE 0x10000 // can be combined with WAT_REGISTERFORMAT
// flags
#define WAT_OPT_DISABLED 0x0001 // format registered but disabled
#define WAT_OPT_ONLYONE 0x0002 // format can't be overwriten
#define WAT_OPT_PLAYERINFO 0x0004 // song info from player
#define WAT_OPT_WINAMPAPI 0x0008 // Winamp API support
#define WAT_OPT_CHECKTIME 0x0010 // check file time for changes
#define WAT_OPT_VIDEO 0x0020 // only for format registering used
#define WAT_OPT_LAST 0x0040 // (internal)
#define WAT_OPT_FIRS 0x0080 // (internal)
#define WAT_OPT_TEMPLATE 0x0100 // (internal)
#define WAT_OPT_IMPLANTANT 0x0200 // use process implantation
#define WAT_OPT_HASURL 0x0400 // (player registration) URL field present
#define WAT_OPT_CHANGES 0x0800 // obtain only chaged values
// (volume, status, window text, elapsed time)
#define WAT_OPT_MULTITHREAD 0x8000 // Use multithread scan
#define WAT_OPT_KEEPOLD 0x4000 // Keep Old opened file
typedef BOOL (__cdecl *LPREADFORMATPROC)(LPSONGINFO Info);
typedef struct tMusicFormat {
LPREADFORMATPROC proc;
CHAR ext[8];
int flags;
} MUSICFORMAT, *LPMUSICFORMAT;
/*
wParam: action
lParam: pointer to MUSICFORMAT if wParam = WAT_ACT_REGISTER,
else - pointer to extension string (ANSI)
returns: see result codes
*/
#define MS_WAT_FORMAT "WATrack/Format"
/*
wParam - pointer to SONGINFO structure (plwind field must be initialized)
lParam - flags
*/
#define MS_WAT_WINAMPINFO "WATrack/WinampInfo"
/*
wParam: window
lParam: LoWord - command; HiWord - value
*/
#define MS_WAT_WINAMPCOMMAND "WATrack/WinampCommand"
typedef WCHAR (__cdecl *LPNAMEPROC)();
typedef HWND (__cdecl *LPCHECKPROC)(int flags);
typedef int (__cdecl *LPINFOPROC)(LPSONGINFO Info, int flags);
typedef int (__cdecl *LPCOMMANDPROC)(int command, int value);
typedef struct tPlayerCell {
CHAR *Desc;
int flags;
HICON Icon; // can be 0. for registration only
LPCHECKPROC Check; // check player
LPNAMEPROC GetName; // can be NULL. get media filename
LPINFOPROC GetInfo; // can be NULL. get info from player
LPCOMMANDPROC Command; // can be NULL. send command to player
CHAR *URL; // only if WAT_OPT_HASURL flag present
} PLAYERCELL, *LPPLAYERCELL;
/*
wParam: action
lParam: pointer to PLAYERCELL if wParam = WAT_ACT_REGISTER,
else - pointer to player description string (ANSI)
returns: player window handle or value>0 if found
*/
#define MS_WAT_PLAYER "WATrack/Player"
// --------- Templates ----------
//templates
#define TM_MESSAGE 0 // privat message
#define TM_CHANNEL 1 // chat
#define TM_STAT_TITLE 2 // xstatus title
#define TM_STAT_TEXT 3 // [x]status text
#define TM_POPTITLE 4 // popup title
#define TM_POPTEXT 5 // popup text
#define TM_EXPORT 6 // other app
#define TM_FRAMEINFO 7 // frame
#define TM_SETTEXT 0x100 // only for service
#define TM_GETTEXT 0 // only for service
/*
wParam: not used
lParam: Unicode template
returns: New Unicode (replaced) string
*/
#define MS_WAT_REPLACETEXT "WATrack/ReplaceText"
/*
event types for History
Blob structure for EVENTTYPE_WAT_ANSWER:
Uniciode artist#0title#0album#0answer
*/
#define EVENTTYPE_WAT_REQUEST 9601
#define EVENTTYPE_WAT_ANSWER 9602
#define EVENTTYPE_WAT_ERROR 9603
#define EVENTTYPE_WAT_MESSAGE 9604
/*
wParam: Template type (TM_* constants).
lParam: Template string for template setup, or not used
returns: pointer to statically allocated string (DON'T free!)
note: Template set if wParam with TM_SETTEXT combined. If used for
Protocol-dependent templates, used only for default templates.
*/
#define MS_WAT_TEMPLATE = "WATrack/Templates"
#endif
|