diff options
author | Alexey Kulakov <panda75@bk.ru> | 2015-01-28 06:34:10 +0000 |
---|---|---|
committer | Alexey Kulakov <panda75@bk.ru> | 2015-01-28 06:34:10 +0000 |
commit | 86dfe0c06437f79fd6f5bdfe34659339ef9cf525 (patch) | |
tree | 3509d18cf6fb2bc41688f4ea029260a14795d384 /plugins/Watrack/lastfm | |
parent | 7690c901d9dd0e0992cdadebdeb817faa8358583 (diff) |
Watrack:
VLC processing moved to INI-file
MyShows fixes
Code style fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@11936 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Watrack/lastfm')
-rw-r--r-- | plugins/Watrack/lastfm/i_last_api.inc | 27 | ||||
-rw-r--r-- | plugins/Watrack/lastfm/i_last_dlg.inc | 12 |
2 files changed, 20 insertions, 19 deletions
diff --git a/plugins/Watrack/lastfm/i_last_api.inc b/plugins/Watrack/lastfm/i_last_api.inc index b43ba0703c..f43aac30db 100644 --- a/plugins/Watrack/lastfm/i_last_api.inc +++ b/plugins/Watrack/lastfm/i_last_api.inc @@ -7,8 +7,9 @@ const const
defreq = 'http://post.audioscrobbler.com/?hs=true&p=1.2.1&c=<client-id>&v=<client-ver>&u=<user>&t=<timestamp>&a=<auth>';
+ scraddr = 'http://ws.audioscrobbler.com/2.0/';
-function GetMD5Str(digest:TMD5Hash; buf:pAnsiChar):PAnsiChar;
+function GetMD5Str(const digest:TMD5Hash; buf:pAnsiChar):PAnsiChar;
begin
buf[00]:=HexDigitChrLo[digest[00] shr 4]; buf[01]:=HexDigitChrLo[digest[00] and $0F];
buf[02]:=HexDigitChrLo[digest[01] shr 4]; buf[03]:=HexDigitChrLo[digest[01] and $0F];
@@ -86,7 +87,7 @@ begin end;
end;
-function encode(dst,src:pAnsiChar):PAnsiChar;
+function Encode(dst,src:pAnsiChar):PAnsiChar;
begin
while src^<>#0 do
begin
@@ -121,12 +122,12 @@ begin pc:=StrCopyE(pc,'s='); pc:=StrCopyE(pc,session_id); //'?s='
pc:=StrCopyE(pc,'&a=');
if si^.artist=nil then pc:=StrCopyE(pc,'Unknown')
- else pc:=encode(pc,si^.artist);
+ else pc:=Encode(pc,si^.artist);
pc:=StrCopyE(pc,'&t=');
if si^.title =nil then pc:=StrCopyE(pc,'Unknown')
- else pc:=encode(pc,si^.title);
+ else pc:=Encode(pc,si^.title);
pc:=StrCopyE(pc,'&l='); if si^.total>0 then pc:=StrCopyE(pc,IntToStr(buf,si^.total));
- pc:=StrCopyE(pc,'&b='); pc:=encode(pc,si^.album);
+ pc:=StrCopyE(pc,'&b='); pc:=Encode(pc,si^.album);
pc:=StrCopyE(pc,'&n=');
if si^.track<>0 then
{pc:=}StrCopyE(pc,IntToStr(buf,si^.track));
@@ -160,10 +161,10 @@ begin pc:=StrCopyE(pc,'s=' ); pc:=StrCopyE(pc,session_id);
pc:=StrCopyE(pc,'&a[0]=');
if si^.artist=nil then pc:=StrCopyE(pc,'Unknown')
- else pc:=encode(pc,si^.artist);
+ else pc:=Encode(pc,si^.artist);
pc:=StrCopyE(pc,'&t[0]=');
if si^.title =nil then pc:=StrCopyE(pc,'Unknown')
- else pc:=encode(pc,si^.title);
+ else pc:=Encode(pc,si^.title);
pc:=StrCopyE(pc,'&i[0]='); pc:=StrCopyE(pc,timestamp);
pc:=StrCopyE(pc,'&r[0]=&m[0]=');
pc:=StrCopyE(pc,'&l[0]=');
@@ -176,7 +177,7 @@ begin begin
pc:=StrCopyE(pc,'&o[0]=R');
end;
- pc:=StrCopyE(pc,'&b[0]='); pc:=encode(pc,si^.album);
+ pc:=StrCopyE(pc,'&b[0]='); pc:=Encode(pc,si^.album);
pc:=StrCopyE(pc,'&n[0]=');
if si^.track<>0 then
{pc:=}StrCopyE(pc,IntToStr(buf,si^.track));
@@ -225,13 +226,13 @@ end; var
xmlparser:TXML_API_W;
-function FixInfo(info:pWideChar):pWideChar;
+function FixInfo(Info:pWideChar):pWideChar;
var
pc,ppc:pWideChar;
cnt:cardinal;
need:boolean;
begin
- pc:=info;
+ pc:=Info;
cnt:=0;
need:=false;
while pc^<>#0 do
@@ -248,8 +249,8 @@ begin end;
if need then
begin
- mGetMem(result,(StrLenW(info)+1+cnt)*SizeOf(WideChar));
- pc:=info;
+ mGetMem(result,(StrLenW(Info)+1+cnt)*SizeOf(WideChar));
+ pc:=Info;
ppc:=result;
while pc^<>#0 do
begin
@@ -265,7 +266,7 @@ begin ppc^:=#0;
end
else
- StrDupW(result,info);
+ StrDupW(result,Info);
end;
function GetArtistInfo(var data:tLastFMInfo;lang:integer):int;
diff --git a/plugins/Watrack/lastfm/i_last_dlg.inc b/plugins/Watrack/lastfm/i_last_dlg.inc index ee1f96092f..44beb5bdf7 100644 --- a/plugins/Watrack/lastfm/i_last_dlg.inc +++ b/plugins/Watrack/lastfm/i_last_dlg.inc @@ -18,13 +18,13 @@ const (code:'es' ; name: 'Spanish' ;)
);
-procedure ClearInfo(dlg:HWND);
+procedure ClearInfo(Dlg:HWND);
begin
- SetDlgItemTextW(dlg,IDC_DATA_ARTIST,'');
- SetDlgItemTextW(dlg,IDC_DATA_ALBUM ,'');
- SetDlgItemTextW(dlg,IDC_DATA_TRACK ,'');
- SetDlgItemTextW(dlg,IDC_DATA_TAGS ,'');
- SetDlgItemTextW(dlg,IDC_DATA_INFO ,'');
+ SetDlgItemTextW(Dlg,IDC_DATA_ARTIST,'');
+ SetDlgItemTextW(Dlg,IDC_DATA_ALBUM ,'');
+ SetDlgItemTextW(Dlg,IDC_DATA_TRACK ,'');
+ SetDlgItemTextW(Dlg,IDC_DATA_TAGS ,'');
+ SetDlgItemTextW(Dlg,IDC_DATA_INFO ,'');
end;
procedure ClearData(var data:tLastFMInfo);
|