From 91eb23f044911477f615e7e25e1425b667c3f1fa Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 12 Apr 2013 21:28:12 +0000 Subject: pascal sources sync git-svn-id: http://svn.miranda-ng.org/main/trunk@4435 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/mRadio/i_frameapi.inc | 4 ++-- plugins/mRadio/i_hotkey.inc | 1 + plugins/mRadio/i_myservice.inc | 26 +++++++++++--------------- plugins/mRadio/i_optdlg.inc | 12 ++++-------- plugins/mRadio/i_tray.inc | 34 +++++++++++++++------------------- plugins/mRadio/mradio.dpr | 17 ++++++----------- plugins/mRadio/mradio.rc | 3 ++- plugins/mRadio/variants.pas | 5 +++++ 8 files changed, 46 insertions(+), 56 deletions(-) (limited to 'plugins/mRadio') diff --git a/plugins/mRadio/i_frameapi.inc b/plugins/mRadio/i_frameapi.inc index baca5d885f..8f70edbf7a 100644 --- a/plugins/mRadio/i_frameapi.inc +++ b/plugins/mRadio/i_frameapi.inc @@ -47,7 +47,7 @@ begin WM_INITDIALOG: begin hMuteFrmCtrl:=GetDlgItem(Dialog,IDC_RADIO_MUTE); SendMessage(hMuteFrmCtrl, BUTTONSETASFLATBTN,0,0); - SetButtonIcon(hMuteFrmCtrl,IcoBtnOn); +// SetButtonIcon(hMuteFrmCtrl,IcoBtnOn); hwndTooltip:=CreateWindowW(TOOLTIPS_CLASS,nil,TTS_ALWAYSTIP, integer(CW_USEDEFAULT),integer(CW_USEDEFAULT), @@ -189,7 +189,7 @@ begin begin cbSize :=SizeOf(Frame); hWnd :=FrameWnd; - hIcon :=0; + hIcon :=CallService(MS_SKIN2_GETICON,0,lparam(IcoBtnSettings)); align :=alTop; height :=tr.bottom-tr.top+2; Flags :=F_VISIBLE or F_NOBORDER or F_UNICODE; diff --git a/plugins/mRadio/i_hotkey.inc b/plugins/mRadio/i_hotkey.inc index 8b165bdc23..44e4910699 100644 --- a/plugins/mRadio/i_hotkey.inc +++ b/plugins/mRadio/i_hotkey.inc @@ -65,6 +65,7 @@ begin CallService(MS_HOTKEY_UNREGISTER,0,lparam(HKN_PLAYPAUSE)); CallService(MS_HOTKEY_UNREGISTER,0,lparam(HKN_STOP)); CallService(MS_HOTKEY_UNREGISTER,0,lparam(HKN_MUTE)); + CallService(MS_HOTKEY_UNREGISTER,0,lparam(HKN_RECORD)); DestroyServiceFunction(hRadioHotkey); end; diff --git a/plugins/mRadio/i_myservice.inc b/plugins/mRadio/i_myservice.inc index e4e76ba10f..d938a08d92 100644 --- a/plugins/mRadio/i_myservice.inc +++ b/plugins/mRadio/i_myservice.inc @@ -29,25 +29,21 @@ begin cni.dwFlag:=CNF_DISPLAY or CNF_UNICODE; cni.szProto :=PluginName; - hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0); + hContact:=db_find_first(PluginName); while hContact<>0 do begin - p:=PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)); - if (p<>nil) and (StrCmp(p,PluginName)=0) then + cni.hContact:=hContact; + if CallService(MS_CONTACT_GETCONTACTINFO,0,tlparam(@cni))=0 then begin - cni.hContact:=hContact; - if CallService(MS_CONTACT_GETCONTACTINFO,0,tlparam(@cni))=0 then - begin - if lParam=1 then - i:=StrCmp(pAnsiChar(wParam),cni.retval.szVal.a) - else - i:=StrCmpW(pWideChar(wParam),cni.retval.szVal.w); - mir_free(cni.retval.szVal.w); - if i=0 then - break; - end; + if lParam=1 then + i:=StrCmp(pAnsiChar(wParam),cni.retval.szVal.a) + else + i:=StrCmpW(pWideChar(wParam),cni.retval.szVal.w); + mir_free(cni.retval.szVal.w); + if i=0 then + break; end; - hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0); + hContact:=db_find_next(hContact,PluginName); end; end; diff --git a/plugins/mRadio/i_optdlg.inc b/plugins/mRadio/i_optdlg.inc index 2b5d66535e..7e72aa5409 100644 --- a/plugins/mRadio/i_optdlg.inc +++ b/plugins/mRadio/i_optdlg.inc @@ -126,16 +126,12 @@ begin end else begin - hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0); + hContact:=db_find_first(PluginName); while hContact<>0 do begin - if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)), - PluginName)=0 then - begin - inc(result); - ExportRadioContact(result,dst,hContact); - end; - hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0); + inc(result); + ExportRadioContact(result,dst,hContact); + hContact:=db_find_next(hContact,PluginName); end; end; end; diff --git a/plugins/mRadio/i_tray.inc b/plugins/mRadio/i_tray.inc index fa63acc720..f0a463c5de 100644 --- a/plugins/mRadio/i_tray.inc +++ b/plugins/mRadio/i_tray.inc @@ -49,32 +49,28 @@ begin // Fill list FillChar(srch,SizeOf(srch),0); - hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0); + hContact:=db_find_first(PluginName); while hContact<>0 do begin - if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)),cPluginName)=0 then + p:=DBReadUnicode(hContact,strCList,'MyHandle',nil); + if p<>nil then begin - p:=DBReadUnicode(hContact,strCList,'MyHandle',nil); - if p<>nil then + srch.name:=p; + // search in list + if List_GetIndex(@trayStations,@srch,@idx)<>0 then + // found - set mark + pTrayRadioStation(trayStations.Items[idx]).presents:=1 + else // add if not found begin - srch.name:=p; - // search in list - if List_GetIndex(@trayStations,@srch,@idx)<>0 then - // found - set mark - pTrayRadioStation(trayStations.Items[idx]).presents:=1 - else // add if not found - begin - mGetMem(tmp,SizeOf(tTrayRadioStation)); - tmp.name :=p; - tmp.presents:=2; - tmp.hContact:=hContact; - List_InsertPtr(@trayStations,tmp); - end; + mGetMem(tmp,SizeOf(tTrayRadioStation)); + tmp.name :=p; + tmp.presents:=2; + tmp.hContact:=hContact; + List_InsertPtr(@trayStations,tmp); end; end; - hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0); + hContact:=db_find_next(hContact,PluginName); end; - // delete obsolete elements for i:=trayStations.realCount-1 downto 0 do begin diff --git a/plugins/mRadio/mradio.dpr b/plugins/mRadio/mradio.dpr index d8b0432b18..744ccc9813 100644 --- a/plugins/mRadio/mradio.dpr +++ b/plugins/mRadio/mradio.dpr @@ -70,14 +70,11 @@ begin if hContact=0 then begin - hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0); + hContact:=db_find_first(PluginName); while hContact<>0 do begin - if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)),PluginName)=0 then - begin - DBWriteWord(hContact,PluginName,optStatus,status); - end; - hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0); + DBWriteWord(hContact,PluginName,optStatus,status); + hContact:=db_find_next(hContact,PluginName); end; end else @@ -101,12 +98,12 @@ begin result:=@PluginInfo; PluginInfo.cbSize :=SizeOf(TPLUGININFOEX); PluginInfo.shortName :='mRadio Mod'; - PluginInfo.version :=$00000202; + PluginInfo.version :=$00000203; PluginInfo.description:='This plugin plays and records Internet radio streams.'+ ' Also local media files can be played.'; PluginInfo.author :='Awkward'; PluginInfo.authorEmail:='panda75@bk.ru; awk1975@ya.ru'; - PluginInfo.copyright :='(c) 2007-2012 Awkward'; + PluginInfo.copyright :='(c) 2007-2013 Awkward'; PluginInfo.homepage :='http://code.google.com/p/delphi-miranda-plugins/'; PluginInfo.flags :=UNICODE_AWARE; PluginInfo.uuid :=MIID_MRADIO; @@ -330,7 +327,6 @@ begin PluginStatus:=ID_STATUS_OFFLINE; end; mFreeMem(custom); - Result:=0; end; @@ -344,7 +340,6 @@ exports Load, Unload, MirandaPluginInfoEx; -initialization +begin DisableThreadLibraryCalls(hInstance); - end. diff --git a/plugins/mRadio/mradio.rc b/plugins/mRadio/mradio.rc index 126052f6ee..7037c10d42 100644 --- a/plugins/mRadio/mradio.rc +++ b/plugins/mRadio/mradio.rc @@ -153,7 +153,7 @@ IDI_ADD ICON "ico\new.ico" IDI_DEL ICON "ico\delete.ico" BTN_RECUP ICON "ico\recon.ico" BTN_RECDN ICON "ico\recoff.ico" - +/* LANGUAGE 0,0 VS_VERSION_INFO VERSIONINFO FILEVERSION 0,0,2,2 @@ -183,3 +183,4 @@ BEGIN VALUE "Translation",0,1200 END END +*/ \ No newline at end of file diff --git a/plugins/mRadio/variants.pas b/plugins/mRadio/variants.pas index c7c8fdc824..01337ae11c 100644 --- a/plugins/mRadio/variants.pas +++ b/plugins/mRadio/variants.pas @@ -2,6 +2,11 @@ unit variants; interface +var + Null: Variant; { Null standard constant } + implementation +initialization + TVarData(Null).VType := varNull; end. \ No newline at end of file -- cgit v1.2.3