summaryrefslogtreecommitdiff
path: root/plugins/Watrack
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Watrack')
-rw-r--r--plugins/Watrack/i_gui.inc18
-rw-r--r--plugins/Watrack/players/pl_mradio.pas26
-rw-r--r--plugins/Watrack/proto/i_proto_dlg.inc10
-rw-r--r--plugins/Watrack/proto/proto.pas15
4 files changed, 31 insertions, 38 deletions
diff --git a/plugins/Watrack/i_gui.inc b/plugins/Watrack/i_gui.inc
index 2ed5411bed..ad697d6fa5 100644
--- a/plugins/Watrack/i_gui.inc
+++ b/plugins/Watrack/i_gui.inc
@@ -25,7 +25,7 @@ begin
ttbState:=0
else
CallService(MS_TTB_SETBUTTONOPTIONS,(ttbState shl 16)+TTBO_TIPNAME,
- tlparam(Translate('Disable Plugin')));
+ tlparam(Translate('Disable WATrack')));
result:=0;
end;
@@ -38,7 +38,7 @@ begin
mi.szPopupName.a:=PluginShort;
mi.hIcon :=CallService(MS_SKIN2_GETICON,0,lparam(IcoBtnEnable));
- mi.szName.a :='Disable Plugin';
+ mi.szName.a :='Disable WATrack';
mi.pszService :=MS_WAT_PLUGINSTATUS;
mi.popupPosition:=MenuDisablePos;
hMenuDisable:=Menu_AddMainMenuItem(@mi);
@@ -55,12 +55,12 @@ begin
if f1<>0 then
begin
mi.hIcon :=CallService(MS_SKIN2_GETICON,0,lparam(IcoBtnDisable));
- mi.szName.a:='Enable Plugin';
+ mi.szName.a:='Enable WATrack';
end
else
begin
mi.hIcon :=CallService(MS_SKIN2_GETICON,0,lparam(IcoBtnEnable));
- mi.szName.a:='Disable Plugin';
+ mi.szName.a:='Disable WATrack';
end;
CallService(MS_CLIST_MODIFYMENUITEM,hMenuDisable,lparam(@mi));
@@ -68,12 +68,12 @@ begin
begin
if f1<>0 then
begin
- p:='Enable Plugin';
+ p:='Enable WATrack';
CallService(MS_TTB_SETBUTTONSTATE,ttbState,TTBST_RELEASED)
end
else
begin
- p:='Disable Plugin';
+ p:='Disable WATrack';
CallService(MS_TTB_SETBUTTONSTATE,ttbState,TTBST_PUSHED);
end;
CallService(MS_TTB_SETBUTTONOPTIONS,(ttbState shl 16)+TTBO_TIPNAME,
@@ -97,6 +97,12 @@ begin
// toptoolbar
if ServiceExists(MS_TTB_GETBUTTONOPTIONS)<>0 then
begin
+{
+ CallService(MS_TTB_GETBUTTONOPTIONS,(ttbInfo shl 16)+TTBO_ALLDATA,tlparam(@ttb));
+ ttb.hIconUp:=CallService(MS_SKIN2_GETICON,0,tlparam(IcoBtnInfo));
+ ttb.hIconDn:=ttb.hIconUp;
+ CallService(MS_TTB_SETBUTTONOPTIONS,(ttbInfo shl 16)+TTBO_ALLDATA,tlparam(@ttb));
+}
CallService(MS_TTB_GETBUTTONOPTIONS,(ttbState shl 16)+TTBO_ALLDATA,tlparam(@ttb));
ttb.hIconDn:=CallService(MS_SKIN2_GETICON,0,tlparam(IcoBtnEnable));
ttb.hIconUp:=CallService(MS_SKIN2_GETICON,0,tlparam(IcoBtnDisable));
diff --git a/plugins/Watrack/players/pl_mradio.pas b/plugins/Watrack/players/pl_mradio.pas
index 3d97037fbb..68589eb159 100644
--- a/plugins/Watrack/players/pl_mradio.pas
+++ b/plugins/Watrack/players/pl_mradio.pas
@@ -72,7 +72,7 @@ function Fill:integer;
var
i:integer;
begin
- CurrentStation:=CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ CurrentStation:=db_find_first(playername);
while CurrentStation<>0 do
begin
i:=DBReadWord(CurrentStation,playername,'Status',WORD(-1));
@@ -81,7 +81,7 @@ begin
result:=1;
exit;
end;
- CurrentStation:=CallService(MS_DB_CONTACT_FINDNEXT,CurrentStation,0);
+ CurrentStation:=db_find_next(CurrentStation,playername);
end;
result:=WAT_RES_NOTFOUND;
end;
@@ -234,9 +234,7 @@ end;
function GetInfo(var SongInfo:tSongInfo;flags:integer):integer;cdecl;
var
- lfile:pWideChar;
isRemote:bool;
- isChanging:bool;
begin
result:=0;
if (flags and WAT_OPT_PLAYERDATA)<>0 then
@@ -259,32 +257,20 @@ begin
end
else
begin
- lfile:=GetFileName(plwnd,flags);
- isRemote:=StrPosW(lfile,'://')<>nil;
- if (prevfile=nil) or isRemote or (StrCmpW(prevfile,lfile)<>0) then
+ isRemote:=StrPosW(mfile,'://')<>nil;
+ if (prevfile=nil) or isRemote or (StrCmpW(prevfile,mfile)<>0) then
begin
ClearTrackInfo(SongInfo,false);
- mfile:=lfile;
mFreeMem(prevfile);
StrDupW(prevfile,mfile);
- isChanging:=true;
- end
- else
- begin
- isChanging:=false;
- mFreeMem(lfile);
- end;
- if not isRemote then
- begin
- if isChanging then
+ if not isRemote then
begin
CallService(MS_WAT_GETFILEINFO,0,lparam(@SongInfo));
fsize:=GetFSize(mfile);
- mFreeMem(prevfile);
- StrDupW(prevfile,mfile);
end;
end;
+
//!!
if kbps =0 then kbps :=GetKbps;
if genre =nil then genre :=GetGenre;
diff --git a/plugins/Watrack/proto/i_proto_dlg.inc b/plugins/Watrack/proto/i_proto_dlg.inc
index 3c467c79ac..ebfd6d31c9 100644
--- a/plugins/Watrack/proto/i_proto_dlg.inc
+++ b/plugins/Watrack/proto/i_proto_dlg.inc
@@ -4,7 +4,7 @@ procedure SetAllContactStat(hwndList:HWND);
var
hContact,hItem:THANDLE;
begin
- hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact:=db_find_first();
while hContact<>0 do
begin
hItem:=SendMessage(hwndList,CLM_FINDCONTACT,hContact,0);
@@ -13,7 +13,7 @@ begin
SendMessage(hwndList,CLM_SETCHECKMARK,hItem,
DBReadByte(hContact,strCList,ShareOptText,0));
end;
- hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0);
+ hContact:=db_find_next(hContact);
end;
end;
@@ -21,7 +21,7 @@ procedure SaveAllContactStat(hwndList:HWND);
var
hContact,hItem:THANDLE;
begin
- hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact:=db_find_first();
while hContact<>0 do
begin
hItem:=SendMessage(hwndList,CLM_FINDCONTACT,hContact,0);
@@ -32,7 +32,7 @@ begin
else
DBDeleteSetting(hContact,strCList,ShareOptText);
end;
- hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0);
+ hContact:=db_find_next(hContact);
end;
end;
@@ -100,7 +100,7 @@ begin
cii.cbSize :=SizeOf(cii);
cii.flags :=CLCIIF_GROUPFONT or CLCIIF_CHECKBOX;
cii.pszText.w:=TranslateW('** All contacts **');
- hItemAll:=SendMessage(hList,CLM_ADDINFOITEM,0,dword(@cii));
+ hItemAll:=SendMessage(hList,CLM_ADDINFOITEM,0,tlparam(@cii));
}
SetAllContactStat(hList);
SetHistMask(Dialog);
diff --git a/plugins/Watrack/proto/proto.pas b/plugins/Watrack/proto/proto.pas
index 5ff19c1b25..416a610a31 100644
--- a/plugins/Watrack/proto/proto.pas
+++ b/plugins/Watrack/proto/proto.pas
@@ -185,18 +185,18 @@ begin
WideToAnsi(ss,p,UserCP);
if ccs^.wParam=0 then
begin
- ccs^.lParam:=dword(p);
+ ccs^.lParam:=tlparam(p);
end
else
begin
move(PAnsiChar(ss)^,(PAnsiChar(ss)+StrLen(p)+1)^,
(StrLenW(ss)+1)*SizeOf(WideChar));
StrCopy(PAnsiChar(ss),p);
- ccs^.lParam:=dword(ss);
+ ccs^.lParam:=tlparam(ss);
end;
result:=CallService(MS_PROTO_CHAINSEND,wParam,lParam);
mFreeMem(p);
- ccs^.lParam:=dword(s);
+ ccs^.lParam:=tlparam(s);
mFreeMem(ss);
exit;
end;
@@ -313,7 +313,7 @@ begin
i:=WideToCombo(textpos,encbuf,UserCP);
if (HistMask and hmOutInfo)<>0 then
AddEvent(ccs^.hContact,EVENTTYPE_WAT_MESSAGE,DBEF_SENT,encbuf,i);
-// if CallContactService(ccs^.hContact,PSS_MESSAGEW,PREF_UNICODE,dword(encbuf))=
+// if CallContactService(ccs^.hContact,PSS_MESSAGEW,PREF_UNICODE,tlparam(encbuf))=
// ACKRESULT_FAILED then
CallContactService(ccs^.hContact,PSS_MESSAGE,PREF_UNICODE,tlparam(encbuf));
end;
@@ -409,12 +409,12 @@ procedure RegisterContacts;
var
hContact:integer;
begin
- hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact:=db_find_first();
while hContact<>0 do
begin
if not IsChat(hContact) then
CallService(MS_PROTO_ADDTOCONTACT,hContact,lparam(PluginShort));
- hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0);
+ hContact:=db_find_next(hContact);
end;
end;
@@ -476,7 +476,7 @@ begin
FillChar(mi, sizeof(mi), 0);
mi.cbSize :=sizeof(mi);
mi.szPopupName.a:=PluginShort;
- mi.flags :=CMIF_NOTOFFLINE or CMIF_NOTOFFLIST or CMIF_ICONFROMICOLIB;
+ mi.flags :=CMIF_NOTOFFLINE or CMIF_NOTOFFLIST;
// mi.popupPosition:=MenuUserInfoPos;
mi.hIcon :=Icons.hIcolib;
mi.szName.a :='Get user''s Music Info';
@@ -517,6 +517,7 @@ begin
vproto.Init :=@InitProc;
vproto.DeInit :=@DeInitProc;
vproto.AddOption :=@AddOptionsPage;
+ vproto.Check :=nil;
vproto.ModuleName:='Protocol';
ModuleLink :=@vproto;
end;