From 0ebb1294ecaf4d62ad6b3e911be6275248c05354 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 27 Nov 2016 21:02:54 +0300 Subject: correct type for ServiceExists() - bool --- plugins/Watrack/i_cover.inc | 2 +- plugins/Watrack/i_gui.inc | 4 ++-- plugins/Watrack/kolframe/kolframe.pas | 2 +- plugins/Watrack/myshows/i_myshows_api.inc | 21 +++------------------ plugins/Watrack/myshows/myshows.pas | 11 ++++------- plugins/Watrack/players/pl_mradio.pas | 2 +- plugins/Watrack/popup/popups.pas | 25 ++++++++++++------------- plugins/Watrack/status/i_opt_11.inc | 2 +- plugins/Watrack/status/i_status.inc | 4 +--- plugins/Watrack/status/status.pas | 5 ----- plugins/Watrack/watrack.dpr | 8 ++++---- 11 files changed, 30 insertions(+), 56 deletions(-) (limited to 'plugins/Watrack') diff --git a/plugins/Watrack/i_cover.inc b/plugins/Watrack/i_cover.inc index 96aec9da47..0d1e6b3e84 100644 --- a/plugins/Watrack/i_cover.inc +++ b/plugins/Watrack/i_cover.inc @@ -20,7 +20,7 @@ begin begin move(p1^,line,i*SizeOf(WideChar)); line[i]:=#0; - if ServiceExists(MS_WAT_REPLACETEXT)<>0 then + if ServiceExists(MS_WAT_REPLACETEXT) then wr:=pWideChar(CallService(MS_WAT_REPLACETEXT,0,lparam(@line))) else wr:=@line; diff --git a/plugins/Watrack/i_gui.inc b/plugins/Watrack/i_gui.inc index 7c77ab6ad7..0128d7c566 100644 --- a/plugins/Watrack/i_gui.inc +++ b/plugins/Watrack/i_gui.inc @@ -50,7 +50,7 @@ begin else Menu_ModifyItem(hMenuDisable, 'Disable WATrack', IcoLib_GetIcon(IcoBtnEnable,0)); - if ServiceExists(MS_TTB_SETBUTTONSTATE)<>0 then + if ServiceExists(MS_TTB_SETBUTTONSTATE) then begin if f1<>0 then begin @@ -75,7 +75,7 @@ begin Menu_ModifyItem(hMenuDisable, nil, IcoLib_GetIcon(IcoBtnEnable,0)); // toptoolbar - if ServiceExists(MS_TTB_GETBUTTONOPTIONS)<>0 then + if ServiceExists(MS_TTB_GETBUTTONOPTIONS) then begin CallService(MS_TTB_GETBUTTONOPTIONS,(ttbState shl 16)+TTBO_ALLDATA,tlparam(@ttb)); ttb.hIconDn:=IcoLib_GetIcon(IcoBtnEnable,0); diff --git a/plugins/Watrack/kolframe/kolframe.pas b/plugins/Watrack/kolframe/kolframe.pas index 20acfa9ffb..c8e33ce408 100644 --- a/plugins/Watrack/kolframe/kolframe.pas +++ b/plugins/Watrack/kolframe/kolframe.pas @@ -198,7 +198,7 @@ var FrameWnd:HWND; begin result:=false; - if ServiceExists(MS_CLIST_FRAMES_ADDFRAME)=0 then + if not ServiceExists(MS_CLIST_FRAMES_ADDFRAME) then exit; if parent=0 then diff --git a/plugins/Watrack/myshows/i_myshows_api.inc b/plugins/Watrack/myshows/i_myshows_api.inc index f753da56f4..25593311d7 100644 --- a/plugins/Watrack/myshows/i_myshows_api.inc +++ b/plugins/Watrack/myshows/i_myshows_api.inc @@ -36,7 +36,7 @@ begin end; StrCopyW(StrCopyEW(buf,'MyShows: '),TranslateW(ppc)); - if ServiceExists(MS_POPUP_SHOWMESSAGEW)<>0 then + if ServiceExists(MS_POPUP_SHOWMESSAGEW) then CallService(MS_POPUP_SHOWMESSAGEW,TWPARAM(@buf),SM_WARNING) else MessageBoxW(0,@buf,'ERROR',MB_ICONERROR) @@ -195,23 +195,11 @@ begin begin // Episode check StrCopy(StrCopyE(buf,API_URL+'profile/episodes/check/'),epId); -// json_free(epId); // !! cause memory error (no need for GetName?) - // StrCopy(request,API_URL+'profile/shows/'); + if SendMSRequest(buf,show) then begin -{ - if si.cover=nil then - begin - jn:=json_get(jroot,'show'); - img:=json_as_string(json_get(jn,'image')); - si:=pointer(CallService(MS_WAT_RETURNGLOBAL,WAT_INF_UNICODE,0)); - FastAnsiToWide(img,pSongInfoW(si)^.cover); - json_free(img); - end; -} - //!! add option to show it?? - if ServiceExists(MS_POPUP_SHOWMESSAGEW)<>0 then + if ServiceExists(MS_POPUP_SHOWMESSAGEW) then begin jn:=json_get(jroot,'show'); shId:=json_as_string(json_get(jn,'title')); @@ -232,9 +220,6 @@ begin '" checked'); CallService(MS_POPUP_SHOWMESSAGEW,TWPARAM(pc),SM_NOTIFY); mFreeMem(pc); - - {!!json_free(shId);} mir_free(shId); - {!!json_free(epId);} mir_free(epId); end; result:=true; end; diff --git a/plugins/Watrack/myshows/myshows.pas b/plugins/Watrack/myshows/myshows.pas index 53925f857b..cc89e9be16 100644 --- a/plugins/Watrack/myshows/myshows.pas +++ b/plugins/Watrack/myshows/myshows.pas @@ -109,13 +109,10 @@ begin begin if pSongInfo(lParam).width>0 then // for video only begin -//!! if ServiceExists(MS_JSON_GETINTERFACE)<>0 then - begin - timervalue:=integer(pSongInfo(lParam).total)*10*msh_scrobpos; // 1000(msec) div 100(%) - if timervalue=0 then - timervalue:=DefTimerValue; - hTimer:=SetTimer(0,0,timervalue,@TimerProc); - end; + timervalue:=integer(pSongInfo(lParam).total)*10*msh_scrobpos; // 1000(msec) div 100(%) + if timervalue=0 then + timervalue:=DefTimerValue; + hTimer:=SetTimer(0,0,timervalue,@TimerProc); end; end; end; diff --git a/plugins/Watrack/players/pl_mradio.pas b/plugins/Watrack/players/pl_mradio.pas index 2d27287796..e41a2bdeb2 100644 --- a/plugins/Watrack/players/pl_mradio.pas +++ b/plugins/Watrack/players/pl_mradio.pas @@ -186,7 +186,7 @@ var ptr:PavatarCacheEntry; begin result:=nil; - if ServiceExists(MS_AV_GETAVATARBITMAP)<>0 then + if ServiceExists(MS_AV_GETAVATARBITMAP) then begin ptr:=PavatarCacheEntry(CallService(MS_AV_GETAVATARBITMAP,CurrentStation,0)); if ptr<>nil then diff --git a/plugins/Watrack/popup/popups.pas b/plugins/Watrack/popup/popups.pas index 089fe0b957..026f03e82b 100644 --- a/plugins/Watrack/popup/popups.pas +++ b/plugins/Watrack/popup/popups.pas @@ -247,7 +247,6 @@ begin colorBack :=cb; colorText :=ct; - // if ServiceExists(MS_POPUP_REGISTERACTIONS)=0 then if ActionList=nil then flag:=0 else @@ -392,18 +391,18 @@ var begin result:=true; // Popups - newstate:=ServiceExists(MS_POPUP_ADDPOPUPW)<>0; + newstate:=ServiceExists(MS_POPUP_ADDPOPUPW); if newstate=PopupPresent then exit; PopupPresent:=newstate; if PopupPresent then begin - IsFreeImagePresent:=ServiceExists(MS_IMG_LOAD )<>0; - IsPopup2Present :=ServiceExists(MS_POPUP_ADDPOPUP2)<>0; + IsFreeImagePresent:=ServiceExists(MS_IMG_LOAD); + IsPopup2Present :=ServiceExists(MS_POPUP_ADDPOPUP2); opthook:=HookEvent(ME_OPT_INITIALISE,@OnOptInitialise); - if ServiceExists(MS_POPUP_REGISTERACTIONS)<>0 then + if ServiceExists(MS_POPUP_REGISTERACTIONS) then begin if RegisterButtonIcons then begin @@ -420,7 +419,7 @@ begin end; // TTB - newstate:=ServiceExists(MS_TTB_ADDBUTTON)<>0; + newstate:=ServiceExists(MS_TTB_ADDBUTTON); if newstate=(ttbInfo<>0) then exit; @@ -433,7 +432,7 @@ begin end else begin - if ServiceExists(MS_TTB_REMOVEBUTTON)>0 then + if ServiceExists(MS_TTB_REMOVEBUTTON) then CallService(MS_TTB_REMOVEBUTTON,WPARAM(ttbInfo),0); ttbInfo:=0; end; @@ -481,15 +480,15 @@ begin hMenuInfo:=Menu_AddMainMenuItem(@mi); ActionList:=nil; - if ServiceExists(MS_POPUP_ADDPOPUPW)<>0 then + if ServiceExists(MS_POPUP_ADDPOPUPW) then begin - IsFreeImagePresent:=ServiceExists(MS_IMG_LOAD )<>0; - IsPopup2Present :=ServiceExists(MS_POPUP_ADDPOPUP2)<>0; + IsFreeImagePresent:=ServiceExists(MS_IMG_LOAD); + IsPopup2Present :=ServiceExists(MS_POPUP_ADDPOPUP2); PopupPresent:=true; opthook:=HookEvent(ME_OPT_INITIALISE,@OnOptInitialise); loadpopup; - if ServiceExists(MS_POPUP_REGISTERACTIONS)<>0 then + if ServiceExists(MS_POPUP_REGISTERACTIONS) then begin if RegisterButtonIcons then begin @@ -508,7 +507,7 @@ begin plStatusHook:=HookEvent(ME_WAT_NEWSTATUS,@NewPlStatus); - if ServiceExists(MS_TTB_ADDBUTTON)>0 then + if ServiceExists(MS_TTB_ADDBUTTON) then begin onttbhook:=0; OnTTBLoaded(0,0); @@ -532,7 +531,7 @@ begin if ttbInfo<>0 then begin - if ServiceExists(MS_TTB_REMOVEBUTTON)>0 then + if ServiceExists(MS_TTB_REMOVEBUTTON) then CallService(MS_TTB_REMOVEBUTTON,WPARAM(ttbInfo),0); ttbInfo:=0; end; diff --git a/plugins/Watrack/status/i_opt_11.inc b/plugins/Watrack/status/i_opt_11.inc index 8039dae4c1..f996cae6c9 100644 --- a/plugins/Watrack/status/i_opt_11.inc +++ b/plugins/Watrack/status/i_opt_11.inc @@ -142,7 +142,7 @@ begin StrCopy(buf,GetProtoName(CurProto)); StrCat(buf,PS_GETCUSTOMSTATUSICON); - endis:=ServiceExists(buf)<>0; + endis:=ServiceExists(buf); EnableWindow(GetDlgItem(Dialog,IDC_CBEX ),endis); EnableWindow(GetDlgItem(Dialog,IDC_XSTAT_AUDIO),endis); diff --git a/plugins/Watrack/status/i_status.inc b/plugins/Watrack/status/i_status.inc index 9bb071a785..bbd8f2e1fa 100644 --- a/plugins/Watrack/status/i_status.inc +++ b/plugins/Watrack/status/i_status.inc @@ -91,9 +91,7 @@ begin todo :=true; end; - if (UseListeningTo<>BST_UNCHECKED) and - IsTunesSupported(j) then -// (ProtoServiceExists(proto,PS_SET_LISTENINGTO)<>0) then + if (UseListeningTo<>BST_UNCHECKED) and IsTunesSupported(j) then begin if doClear then CallProtoService(proto,PS_SET_LISTENINGTO,0,0) diff --git a/plugins/Watrack/status/status.pas b/plugins/Watrack/status/status.pas index cc52e6e1d1..81c1f20d9a 100644 --- a/plugins/Watrack/status/status.pas +++ b/plugins/Watrack/status/status.pas @@ -69,11 +69,6 @@ begin hINS:=CreateServiceFunction(MS_WAT_INSERT,@InsertProc); reghotkey; plStatusHook:=HookEvent(ME_WAT_NEWSTATUS,@NewPlStatus); - -// mStatus.ModuleStat:=1; - -// if ServiceExists(MS_LISTENINGTO_GETPARSEDTEXT)<>0 then -// hLTo:=CreateServiceFunction(MS_LISTENINGTO_GETPARSEDTEXT,@ListenProc); end; procedure DeInitProc(aSetDisable:boolean); diff --git a/plugins/Watrack/watrack.dpr b/plugins/Watrack/watrack.dpr index d766d53b06..c1c947704a 100644 --- a/plugins/Watrack/watrack.dpr +++ b/plugins/Watrack/watrack.dpr @@ -456,7 +456,7 @@ begin end; // TTB - newstate:=ServiceExists(MS_TTB_ADDBUTTON)<>0; + newstate:=ServiceExists(MS_TTB_ADDBUTTON); if newstate=(ttbState<>0) then exit; @@ -471,7 +471,7 @@ begin end else begin - if ServiceExists(MS_TTB_REMOVEBUTTON)>0 then + if ServiceExists(MS_TTB_REMOVEBUTTON) then CallService(MS_TTB_REMOVEBUTTON,WPARAM(ttbState),0); ttbState:=0; end; @@ -520,7 +520,7 @@ begin CreateMenus; - if ServiceExists(MS_TTB_ADDBUTTON)<>0 then + if ServiceExists(MS_TTB_ADDBUTTON) then HookEvent(ME_TTB_MODULELOADED,@OnTTBLoaded) else ttbState:=0; @@ -608,7 +608,7 @@ begin if ttbState<>0 then begin - if ServiceExists(MS_TTB_REMOVEBUTTON)>0 then + if ServiceExists(MS_TTB_REMOVEBUTTON) then CallService(MS_TTB_REMOVEBUTTON,TWPARAM(ttbState),0); ttbState:=0; end; -- cgit v1.2.3