diff options
author | Alexey Kulakov <panda75@bk.ru> | 2014-04-24 14:55:20 +0000 |
---|---|---|
committer | Alexey Kulakov <panda75@bk.ru> | 2014-04-24 14:55:20 +0000 |
commit | c3a168743616db6606702db5ad0fecab4dfee3da (patch) | |
tree | 523ef1399093917f3565d769826ceecb7eb2ef6c /plugins/ExternalAPI | |
parent | 90ad600cb38a04c9272a3599c72d6559c822b155 (diff) |
Miranda API update
Watrack refactoring, API changes
git-svn-id: http://svn.miranda-ng.org/main/trunk@9068 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ExternalAPI')
-rw-r--r-- | plugins/ExternalAPI/delphi/m_music.inc | 96 | ||||
-rw-r--r-- | plugins/ExternalAPI/m_music.h | 213 |
2 files changed, 160 insertions, 149 deletions
diff --git a/plugins/ExternalAPI/delphi/m_music.inc b/plugins/ExternalAPI/delphi/m_music.inc index b17a25879d..205fdc5bf3 100644 --- a/plugins/ExternalAPI/delphi/m_music.inc +++ b/plugins/ExternalAPI/delphi/m_music.inc @@ -23,10 +23,10 @@ type wndtext :PAnsiChar; // window title
player :PAnsiChar; // player name
plyver :dword; // player version
- icon :THANDLE; // player icon
+ icon :HICON; // player icon
fsize :dword; // media file size
vbr :dword;
- status :integer; // WAT_MES_* const
+ status :integer; // WAT_PLS_*
plwnd :HWND; // player window
// video part
codec :dword;
@@ -44,26 +44,26 @@ type type
pSongInfo=^tSongInfo;
tSongInfo = record
- artist :PWideChar;
- title :PWideChar;
- album :PWideChar;
- genre :PWideChar;
- comment :PWideChar;
- year :PWideChar;
- mfile :PWideChar; // media file
+ artist :pWideChar;
+ title :pWideChar;
+ album :pWideChar;
+ genre :pWideChar;
+ comment :pWideChar;
+ year :pWideChar;
+ mfile :pWideChar; // media file
kbps :dword;
khz :dword;
channels :dword;
track :dword;
total :dword; // music length
time :dword; // elapsed time
- wndtext :PWideChar; // window title
- player :PWideChar; // player name
+ wndtext :pWideChar; // window title
+ player :pWideChar; // player name
plyver :dword; // player version
- icon :THANDLE; // player icon
+ icon :HICON; // player icon
fsize :dword; // media file size
vbr :dword;
- status :integer; // WAT_MES_* const
+ status :integer; // WAT_PLS_*
plwnd :HWND; // player window
// video part
codec :dword;
@@ -71,9 +71,9 @@ type height :dword;
fps :dword;
date :int64;
- txtver :PWideChar;
- lyric :PWideChar;
- cover :PWideChar; // cover path
+ txtver :pWideChar;
+ lyric :pWideChar;
+ cover :pWideChar; // cover path
volume :dword;
url :PWideChar; // player homepage
winampwnd:HWND;
@@ -93,12 +93,6 @@ const WAT_RES_NEWFILE = 3;
WAT_RES_NEWPLAYER = 4;
-// result for MS_WAT_GETMUSICINFO service
-const
- WAT_PLS_NORMAL = WAT_RES_OK;
- WAT_PLS_NOMUSIC = WAT_RES_DISABLED;
- WAT_PLS_NOTFOUND = WAT_RES_NOTFOUND;
-
const
WAT_INF_UNICODE = 0;
WAT_INF_ANSI = 1;
@@ -114,13 +108,13 @@ const wParam : WAT_INF_* constant
lParam : pointer to pSongInfo (Unicode) or pSongInfoA (ANSI/UTF8)
Affects: Fill structure by currently played music info
- returns: WAT_PLS_* constant
+ returns: WAT_RES_* 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:
var p:pSongInfo;
- CallService(MS_WAT_GETMUSICINFO,0,dword(@p));
+ CallService(MS_WAT_GETMUSICINFO,0,lparam(@p));
}
MS_WAT_GETMUSICINFO:PAnsiChar = 'WATrack/GetMusicInfo';
{
@@ -182,10 +176,16 @@ const }
MS_WAT_PLUGINSTATUS:PAnsiChar = 'WATrack/PluginStatus';
+// ---------- events ------------
+
+{
+ ME_WAT_MODULELOADED
+ wParam: 0, lParam: 0
+}
ME_WAT_MODULELOADED:PAnsiChar = 'WATrack/ModuleLoaded';
const
- WAT_EVENT_PLAYERSTATUS = 1; // WAT_PLS_* in loword, WAT_MES_* in hiword
+ WAT_EVENT_PLAYERSTATUS = 1; // WAT_PLS_*
WAT_EVENT_NEWTRACK = 2; // SongInfo ptr
WAT_EVENT_PLUGINSTATUS = 3; // 0-enabled; 1-dis.temporary; 2-dis.permanent
WAT_EVENT_NEWPLAYER = 4; //
@@ -234,13 +234,12 @@ const // ----------- Formats and players -----------
-// media file status
-
-const
- WAT_MES_STOPPED = 0;
- WAT_MES_PLAYING = 1;
- WAT_MES_PAUSED = 2;
- WAT_MES_UNKNOWN = -1;
+const // player status
+ WAT_PLS_NOTFOUND = 0; // player not found
+ WAT_PLS_PLAYING = 1;
+ WAT_PLS_PAUSED = 2;
+ WAT_PLS_STOPPED = 3; // player stopped, no music even searched
+ WAT_PLS_UNKNOWN = 4; // player found with unknown state
const
WAT_ACT_REGISTER = 1;
@@ -269,10 +268,11 @@ const WAT_OPT_APPCOMMAND = $00001000; // [options] Special (multimedia) key support
WAT_OPT_CHECKALL = $00002000; // [options] Check all players
WAT_OPT_KEEPOLD = $00004000; // [options] Keep Old opened file
- WAT_OPT_MULTITHREAD = $00008000; // [options] Use multithread scan
+// WAT_OPT_MULTITHREAD = $00008000; // [options] Use multithread scan
WAT_OPT_SINGLEINST = $00010000; // [players] Single player instance
WAT_OPT_PLAYERDATA = $00020000; // (internal) to obtain player data
WAT_OPT_CONTAINER = $00040000; // [formats] format is container (need to check full)
+ WAT_OPT_UNKNOWNFMT = $00080000; // [formats] check unknown (not disabled) formats (info from player)
type
tReadFormatProc = function(var Info:tSongInfo):boolean; cdecl;
@@ -309,7 +309,7 @@ type tInitProc = function():integer;cdecl;
tDeInitProc = function():integer;cdecl;
tStatusProc = function(wnd:HWND):integer;cdecl;
- tNameProc = function(wnd:HWND;flags:integer):PWideChar;cdecl;
+ tNameProc = function(wnd:HWND;flags:integer):pWideChar;cdecl;
tCheckProc = function(wnd:HWND;flags:integer):HWND;cdecl;
tInfoProc = function(var SongInfo:tSongInfo;flags:integer):integer;cdecl;
tCommandProc = function(wnd:HWND;command:integer;value:integer):integer;cdecl;
@@ -317,7 +317,7 @@ type pPlayerCell = ^tPlayerCell;
tPlayerCell = record
Desc :PAnsiChar; // Short player name
- flags :cardinal;
+ flags :dword;
Icon :HICON; // can be 0. for registration only
Init :pointer; // tInitProc; can be NIL. initialize any data
DeInit :pointer; // tDeInitProc; can be NIL. finalize player processing
@@ -349,11 +349,11 @@ const Returns: previous state
}
const
- MS_WAT_MYSHOWS:PAnsiChar = 'WATrack/MyShows';
+ MS_WAT_MYSHOWS:pAnsiChar = 'WATrack/MyShows';
const
- MS_WAT_MYSHOWSINFO:PAnsiChar = 'WATrack/MyShowsInfo';
+ MS_WAT_MYSHOWSINFO:pAnsiChar = 'WATrack/MyShowsInfo';
// --------- Last FM ---------
@@ -363,7 +363,7 @@ const Returns: previous state
}
const
- MS_WAT_LASTFM:PAnsiChar = 'WATrack/LastFM';
+ MS_WAT_LASTFM:pAnsiChar = 'WATrack/LastFM';
{
Get Info based on currently played song
@@ -374,18 +374,18 @@ type pLastFMInfo = ^tLastFMInfo;
tLastFMInfo = record
request:cardinal; // 0 - artist, 1 - album, 2 - track
- artist :PWideChar; // artist
- album :PWideChar; // album or similar artists for Artist info request
- title :PWideChar; // track title
- tags :PWideChar; // tags
- info :PWideChar; // artist bio or wiki article
- image :PAnsiChar; // photo/cover link
- similar:PWideChar;
- release:PWideChar;
+ artist :pWideChar; // artist
+ album :pWideChar; // album or similar artists for Artist info request
+ title :pWideChar; // track title
+ tags :pWideChar; // tags
+ info :pWideChar; // artist bio or wiki article
+ image :pAnsiChar; // photo/cover link
+ similar:pWideChar;
+ release:pWideChar;
trknum :cardinal;
end;
const
- MS_WAT_LASTFMINFO:PAnsiChar = 'WATrack/LastFMInfo';
+ MS_WAT_LASTFMINFO:pAnsiChar = 'WATrack/LastFMInfo';
// --------- Templates ----------
@@ -414,6 +414,6 @@ const lParam: 0
note: Shows Macro help window with edit aliases ability
}
- MS_WAT_MACROHELP:PAnsiChar = 'WATrack/MacroHelp';
+ MS_WAT_MACROHELP:pAnsiChar = 'WATrack/MacroHelp';
{$ENDIF M_MUSIC}
diff --git a/plugins/ExternalAPI/m_music.h b/plugins/ExternalAPI/m_music.h index f89dae99a0..24aacf22a9 100644 --- a/plugins/ExternalAPI/m_music.h +++ b/plugins/ExternalAPI/m_music.h @@ -4,73 +4,75 @@ #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
- DWORD kbps;
- DWORD khz;
- DWORD channels;
- DWORD track;
- DWORD total; // music length
- DWORD time; // elapsed time
- CHAR* wndtext; // window title
- CHAR* player; // player name
- DWORD plyver; // player version
- HANDLE icon; // player icon
- DWORD fsize; // media file size
- DWORD vbr;
- int status; // WAT_MES_* const
- HWND plwnd; // player window
- // video part
- DWORD codec;
- DWORD width;
- DWORD height;
- DWORD fps;
- __int64 date;
- CHAR* txtver;
- CHAR* lyric;
- CHAR* cover;
- DWORD volume;
- CHAR* url; // player homepage
+ CHAR* artist;
+ CHAR* title;
+ CHAR* album;
+ CHAR* genre;
+ CHAR* comment;
+ CHAR* year;
+ CHAR* mfile; // media file
+ DWORD kbps;
+ DWORD khz;
+ DWORD channels;
+ DWORD track;
+ DWORD total; // music length
+ DWORD time; // elapsed time
+ CHAR* wndtext; // window title
+ CHAR* player; // player name
+ DWORD plyver; // player version
+ HICON icon; // player icon
+ DWORD fsize; // media file size
+ DWORD vbr;
+ int status; // WAT_MES_* const
+ HWND plwnd; // player window
+ // video part
+ DWORD codec;
+ DWORD width;
+ DWORD height;
+ DWORD fps;
+ __int64 date;
+ CHAR* txtver;
+ CHAR* lyric;
+ CHAR* cover;
+ DWORD volume;
+ CHAR* url; // player homepage
+ HWND winampwnd; // player window
} SONGINFOA, *LPSONGINFOA;
typedef struct tSongInfo {
- WCHAR* artist;
- WCHAR* title;
- WCHAR* album;
- WCHAR* genre;
- WCHAR* comment;
- WCHAR* year;
- WCHAR* mfile; // media file
- DWORD kbps;
- DWORD khz;
- DWORD channels;
- DWORD track;
- DWORD total; // music length
- DWORD time; // elapsed time
- WCHAR* wndtext; // window title
- WCHAR* player; // player name
- DWORD* plyver; // player version
- HANDLE icon; // player icon
- DWORD fsize; // media file size
- DWORD vbr;
- int status; // WAT_MES_* const
- HWND plwnd; // player window
- // video part
- DWORD codec;
- DWORD width;
- DWORD height;
- DWORD fps;
- __int64 date;
- WCHAR* txtver;
- WCHAR* lyric;
- WCHAR* cover; // cover path
- DWORD volume;
- WCHAR* url; // player homepage
+ WCHAR* artist;
+ WCHAR* title;
+ WCHAR* album;
+ WCHAR* genre;
+ WCHAR* comment;
+ WCHAR* year;
+ WCHAR* mfile; // media file
+ DWORD kbps;
+ DWORD khz;
+ DWORD channels;
+ DWORD track;
+ DWORD total; // music length
+ DWORD time; // elapsed time
+ WCHAR* wndtext; // window title
+ WCHAR* player; // player name
+ DWORD plyver; // player version
+ HICON icon; // player icon
+ DWORD fsize; // media file size
+ DWORD vbr;
+ int status; // WAT_MES_* const
+ HWND plwnd; // player window
+ // video part
+ DWORD codec;
+ DWORD width;
+ DWORD height;
+ DWORD fps;
+ __int64 date;
+ WCHAR* txtver;
+ WCHAR* lyric;
+ WCHAR* cover;
+ DWORD volume;
+ WCHAR* url; // player homepage
+ HWND winampwnd; // player window
} SONGINFO, *LPSONGINFO;
#if defined(_UNICODE)
@@ -79,7 +81,7 @@ typedef struct tSongInfo { #else
#define WAT_INF_TCHAR WAT_INF_ANSI
#define SongInfoT tSongInfoA
-#endif
+#endif
// result codes
#define WAT_RES_UNKNOWN -2
@@ -92,11 +94,6 @@ typedef struct tSongInfo { #define WAT_RES_NEWFILE 3
#define WAT_RES_NEWPLAYER 4
-// result for MS_WAT_GETMUSICINFO service
-#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
@@ -106,13 +103,13 @@ typedef struct tSongInfo { 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
+ returns: WAT_RES_* 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);
+ PluginLink->CallService(MS_WAT_GETMUSICINFO,0,(LPARAM)&p);
*/
#define MS_WAT_GETMUSICINFO "WATrack/GetMusicInfo"
@@ -122,7 +119,7 @@ typedef struct tSongInfo { 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 mir_free
+ you must free given strings by miranda mmi.free
*/
#define MS_WAT_GETFILEINFO "WATrack/GetFileInfo"
@@ -229,12 +226,13 @@ typedef struct tSongInfo { // ----------- Formats and players -----------
-// media file status
+// player status
-#define WAT_MES_STOPPED 0
-#define WAT_MES_PLAYING 1
-#define WAT_MES_PAUSED 2
-#define WAT_MES_UNKNOWN -1
+#define WAT_PLS_NOTFOUUND 0
+#define WAT_PLS_PLAYING 1
+#define WAT_PLS_PAUSED 2
+#define WAT_PLS_STOPPED 3
+#define WAT_PLS_UNKNOWN 4
#define WAT_ACT_REGISTER 1
#define WAT_ACT_UNREGISTER 2
@@ -261,9 +259,11 @@ typedef struct tSongInfo { #define WAT_OPT_APPCOMMAND 0x01000 // Special (multimedia) key support
#define WAT_OPT_CHECKALL 0x02000 // Check all players
#define WAT_OPT_KEEPOLD 0x04000 // Keep Old opened file
-#define WAT_OPT_MULTITHREAD 0x08000 // Use multithread scan
+//#define WAT_OPT_MULTITHREAD 0x08000 // Use multithread scan
#define WAT_OPT_SINGLEINST 0x10000 // Single player instance
#define WAT_OPT_PLAYERDATA 0x20000 // (internal) to obtain player data
+#define WAT_OPT_CONTAINER 0x40000 // [formats] format is container (need to check full)
+#define WAT_OPT_UNKNOWNFMT 0x80000 // [formats] check unknown (not disabled) formats (info from player)
typedef BOOL (__cdecl *LPREADFORMATPROC)(LPSONGINFO Info);
@@ -304,18 +304,18 @@ typedef int (__cdecl *LPINFOPROC) (LPSONGINFO Info, int flags); typedef int (__cdecl *LPCOMMANDPROC)(HWND wnd, int command, int value);
typedef struct tPlayerCell {
- CHAR* Desc; // Short player name
- UINT flags;
- HICON Icon; // can be 0. for registration only
- LPINITPROC Init; // LPINITPROC; can be NULL. initialize any data
- LPDEINITPROC DeInit; // LPDEINITPROC; can be NULL. finalize player processing
- LPCHECKPROC Check; // check player
- LPSTATUSPROC GetStatus; // tStatusProc; can be NULL. get player status
- 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
- WCHAR* Notes; // any tips, notes etc for this player
+ CHAR* Desc; // Short player name
+ UINT flags;
+ HICON Icon; // can be 0. for registration only
+ LPINITPROC Init; // LPINITPROC; can be NULL. initialize any data
+ LPDEINITPROC DeInit; // LPDEINITPROC; can be NULL. finalize player processing
+ LPCHECKPROC Check; // check player
+ LPSTATUSPROC GetStatus; // tStatusProc; can be NULL. get player status
+ 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
+ WCHAR* Notes; // any tips, notes etc for this player
} PLAYERCELL, *LPPLAYERCELL;
/*
@@ -328,6 +328,17 @@ typedef struct tPlayerCell { */
#define MS_WAT_PLAYER "WATrack/Player"
+// --------- MyShows.ru ---------
+
+/*
+ Toggle MyShows scrobbling status
+ wParam,lParam=0
+ Returns: previous state
+*/
+#define MS_WAT_MYSHOWS "WATrack/MyShows"
+
+#define MS_WAT_MYSHOWSINFO "WATrack/MyShowsInfo"
+
// --------- Last FM ---------
/*
@@ -343,16 +354,16 @@ typedef struct tPlayerCell { lParam: int language (first 2 bytes - 2-letters language code)
*/
typedef struct tLastFMInfo {
- UINT request; // 0 - artist, 1 - album, 2 - track
- WCHAR* artist; // artist
- WCHAR* album; // album or similar artists for Artist info request
- WCHAR* title; // track title
- WCHAR* tags; // tags
- WCHAR* info; // artist bio or wiki article
- WCHAR* image; // photo/cover link
- WCHAR* similar;
- WCHAR* release;
- UINT trknum;
+ UINT request; // 0 - artist, 1 - album, 2 - track
+ WCHAR* artist; // artist
+ WCHAR* album; // album or similar artists for Artist info request
+ WCHAR* title; // track title
+ WCHAR* tags; // tags
+ WCHAR* info; // artist bio or wiki article
+ WCHAR* image; // photo/cover link
+ WCHAR* similar;
+ WCHAR* release;
+ UINT trknum;
}PLASTFMINFO, *LPLASTFMINFO;
#define MS_WAT_LASTFMINFO "WATrack/LastFMInfo"
|