From d83baeb842ea828eaee90a0cd6575872a95240e8 Mon Sep 17 00:00:00 2001 From: Alexey Kulakov Date: Sat, 8 Mar 2014 13:10:05 +0000 Subject: Pascal-style type correction Letter case correction small fixes Actman UA part dialog slightly changed git-svn-id: http://svn.miranda-ng.org/main/trunk@8473 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/mRadio/i_hotkey.inc | 2 +- plugins/mRadio/i_myservice.inc | 8 +-- plugins/mRadio/i_optdlg.inc | 4 +- plugins/mRadio/i_search.inc | 117 ++++++++++++++++++++++++++++++++++++++--- plugins/mRadio/i_service.inc | 4 +- plugins/mRadio/mradio.dpr | 2 +- plugins/mRadio/rbass.pas | 6 +-- plugins/mRadio/rframeapi.pas | 6 +-- plugins/mRadio/rglobal.pas | 6 +-- 9 files changed, 130 insertions(+), 25 deletions(-) (limited to 'plugins/mRadio') diff --git a/plugins/mRadio/i_hotkey.inc b/plugins/mRadio/i_hotkey.inc index 9fb613fe5f..7ec4cf766b 100644 --- a/plugins/mRadio/i_hotkey.inc +++ b/plugins/mRadio/i_hotkey.inc @@ -24,7 +24,7 @@ end; procedure RegisterHotKey; var - hkrec:HOTKEYDESC; + hkrec:THOTKEYDESC; begin hRadioHotkey:=CreateServiceFunction(MS_RADIO_HOTKEY,@mRadio_Hotkey); diff --git a/plugins/mRadio/i_myservice.inc b/plugins/mRadio/i_myservice.inc index 34f541689c..dc144b616d 100644 --- a/plugins/mRadio/i_myservice.inc +++ b/plugins/mRadio/i_myservice.inc @@ -4,7 +4,7 @@ function Service_RadioPlayStop(wParam:WPARAM;lParam:LPARAM):int;cdecl; var p:PAnsiChar; lnew:bool; - hContact:MCONTACT; + hContact:TMCONTACT; cni:TCONTACTINFO; i:integer; begin @@ -145,7 +145,7 @@ end; //----- Import-export ----- -function ImportOneStation(group:PAnsiChar;section:pointer):MCONTACT; +function ImportOneStation(group:PAnsiChar;section:pointer):TMCONTACT; var p:pWideChar; pc:pAnsiChar; @@ -218,7 +218,7 @@ begin end; end; -procedure ExportRadioContact(num:integer;fname:PAnsiChar;hContact:MCONTACT); +procedure ExportRadioContact(num:integer;fname:PAnsiChar;hContact:TMCONTACT); var pc:pAnsiChar; section:array [0..15] of AnsiChar; @@ -257,7 +257,7 @@ end; function ExportAll(wParam:WPARAM;lParam:LPARAM):int; cdecl; var dst:array [0..MAX_PATH-1] of AnsiChar; - hContact:MCONTACT; + hContact:TMCONTACT; begin result:=0; if lParam<>0 then diff --git a/plugins/mRadio/i_optdlg.inc b/plugins/mRadio/i_optdlg.inc index f807d65a22..c09e302e13 100644 --- a/plugins/mRadio/i_optdlg.inc +++ b/plugins/mRadio/i_optdlg.inc @@ -96,7 +96,7 @@ begin SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti)); end; -function DlgProcOpt(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall; +function DlgProcOpt(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall; const DlgInit:integer=1; var @@ -379,7 +379,7 @@ begin SendMessage(wnd,CB_SETCURSEL,def,0); end; -function DlgProcOptTech(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall; +function DlgProcOptTech(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall; const DlgInit:integer=1; var diff --git a/plugins/mRadio/i_search.inc b/plugins/mRadio/i_search.inc index f4d21a0955..81e1a00eca 100644 --- a/plugins/mRadio/i_search.inc +++ b/plugins/mRadio/i_search.inc @@ -1,5 +1,90 @@ {search station code} +(* +procedure SetAvatar(hContact:THANDLE); +var + success:boolean; + fname:pAnsiChar; + url:pWideChar; + buf,buf1,buf2:array [0..MAX_PATH-1] of AnsiChar; + ext:array [0..15] of AnsiChar; + section:pAnsiChar; + pc:pAnsiChar; + i:integer; +begin + // get url + url:=DBReadUnicode(hContact,PluginName,optStationURL); + // translate to Ansi + FastWideToAnsiBuf(url,buf); + mFreeMem(url); + + // search in INI + i:=GetFSize(storage); + if i=0 then + i:=32767; + mGetMem(pc,i+1); + pc^:=#0; + GetPrivateProfileSectionNamesA(pc,i,storage); + section:=pc; + + while section^<>#0 do + begin + GetPrivateProfileStringA(section,'URL','',buf1,SizeOf(buf1),storage); + if StrCmp(@buf,@buf1)=0 then + break; + + while section^<>#0 do inc(section); + inc(section); + end; + mFreeMem(pc); + + if section^<>#0 then + begin + // get avatar link + buf[0]:=#0; + GetPrivateProfileStringA(section,'Avatar','',buf,SizeOf(buf),storage); + + if buf[0]<>#0 then + begin + // Here we trying to get Avatar chache directory + // (create it if needs) + // and copy (load) owr avatars there + // in : buf = source avatar path + // out: fname = destination (file name in cache) + // rule for name is?.. + + + if StrPos(buf,'://')=nil then + begin + fname:=@buf; + success:=FileExists(fname); + // need to copy this file to avatar cache + end + else + begin + // download file +{ + GetTempPathA(MAX_PATH,pAnsiChar(@buf1)); + pc:=extract(pAnsiChar(@buf),true); + StrCat(pAnsiChar(@buf1),pc); + mFreeMem(pc); +} + //mrAvt + + GetExt(pAnsiChar(@buf),pAnsiChar(@ext)); + GetTempPathA(MAX_PATH,pAnsiChar(@buf2)); + GetTempFileNameA(pAnsiChar(@buf2),'mrAvt',GetCurrentTime,pAnsiChar(@buf1)); + ChangeExt(pAnsiChar(@buf1),PAnsiChar(@ext)); + // + fname:=@buf1; + success:=GetFile(pAnsiChar(@buf),fname); + end; + if success then + CallService(MS_AV_SETAVATAR,hContact,LPARAM(fname)); + end; + end; +end; +*) type TMySearchFilter = record lStation, @@ -19,7 +104,7 @@ var bitrate:integer; l:bool; columns:array [0..3] of TCHAR; - csr:CUSTOMSEARCHRESULTS; + csr:TCUSTOMSEARCHRESULTS; pc:pAnsiChar; buf:array [0..127] of AnsiChar; begin @@ -84,7 +169,7 @@ end; procedure ProcessSearch(var filter:TMySearchFilter;ini:PAnsiChar); var pc:PAnsiChar; - csr:CUSTOMSEARCHRESULTS; + csr:TCUSTOMSEARCHRESULTS; columns:array [0..3] of TCHAR; lstorage,section,list:pointer; begin @@ -154,6 +239,7 @@ begin with filter do begin +// CallService(MS_UTILS_PATHTOABSOLUTE,TWPARAM(@ini1),TLPARAM(@ini)); lBitrate:=GetDlgItemInt(wnd,IDC_BITRATE,ltmp,false); if IsDlgButtonChecked(wnd,IDC_LT)=BST_CHECKED then lBitrateMode:=-1 else if IsDlgButtonChecked(wnd,IDC_EQ)=BST_CHECKED then lBitrateMode:=0 @@ -182,7 +268,7 @@ begin else begin result:=AckHandle; - mir_forkthread(@BasicSearch,StrDup(PAnsiChar(lParam),PAnsiChar(lParam))); + {CloseHandle}(mir_forkthread(@BasicSearch,StrDup(PAnsiChar(lParam),PAnsiChar(lParam)))); end; end; @@ -193,13 +279,13 @@ begin else begin result:=AckHandle; - mir_forkthread(@ExtSearch,pointer(lParam)); + {CloseHandle}(mir_forkthread(@ExtSearch,pointer(lParam))); end; end; function Service_GetCaps(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl; forward; -function ExtSearchProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall; +function ExtSearchProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall; var buf:array [0..MAX_PATH-1] of AnsiChar; begin @@ -276,7 +362,7 @@ end; function Service_AddToList(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl; var - hContact:MCONTACT; + hContact:TMCONTACT; p:PWideChar; lurl:pWideChar; begin @@ -292,6 +378,25 @@ begin if lurl<>nil then begin +{ +// find contact + hContact:=db_find_first(PluginName); + while hContact<>0 do + begin + p:=DBReadString(hContact,PluginName,optStationURL); + l:=StrCmp(p,lurl)=0; + mFreeMem(p); + if l then + begin + DBDeleteSetting(hContact,strCList,'NotOnList'); + DBDeleteSetting(hContact,strCList,'Hidden'); + result:=hContact; + exit; + end; + hContact:=db_find_next(hContact,PluginName); + end; +// if not found +} hContact:=CallService(MS_DB_CONTACT_ADD,0,0); if hContact<>0 then begin diff --git a/plugins/mRadio/i_service.inc b/plugins/mRadio/i_service.inc index 6473b5e9b2..21271fcd3a 100644 --- a/plugins/mRadio/i_service.inc +++ b/plugins/mRadio/i_service.inc @@ -27,7 +27,7 @@ begin result:=0; end; -procedure GetAwayMsgProc(hContact:MCONTACT); cdecl; +procedure GetAwayMsgProc(hContact:TMCONTACT); cdecl; var buf,p:PWideChar; begin @@ -99,7 +99,7 @@ begin if (ccs^.hContact<>0) and (PluginStatus=ID_STATUS_ONLINE) and (DBReadWord(ccs^.hContact,PluginName,optStatus,ID_STATUS_OFFLINE)=ID_STATUS_ONLINE) then begin - {CloseHandle}(mir_forkthread(@GetAwayMsgProc,pointer(ccs^.hContact))); + {CloseHandle}(mir_forkthread(@GetAwayMsgProc,pointer(uint_ptr(ccs^.hContact)))); result:=AckHandle; end else diff --git a/plugins/mRadio/mradio.dpr b/plugins/mRadio/mradio.dpr index 9600988e0d..de7d7219da 100644 --- a/plugins/mRadio/mradio.dpr +++ b/plugins/mRadio/mradio.dpr @@ -27,7 +27,7 @@ uses {$include i_visual.inc} {$include i_optdlg.inc} -function MirandaPluginInfoEx(mirandaVersion:DWORD):PPLUGININFOEX; cdecl; +function MirandaPluginInfoEx(mirandaVersion:dword):PPLUGININFOEX; cdecl; begin result:=@PluginInfo; PluginInfo.cbSize :=SizeOf(TPLUGININFOEX); diff --git a/plugins/mRadio/rbass.pas b/plugins/mRadio/rbass.pas index 42bc4ffe62..77957f4a46 100644 --- a/plugins/mRadio/rbass.pas +++ b/plugins/mRadio/rbass.pas @@ -520,7 +520,7 @@ end; -procedure StatusProc(buffer:Pointer;len,user:DWORD); stdcall; +procedure StatusProc(buffer:pointer;len,user:dword); stdcall; var pc:pWideChar; pb:PByte; @@ -891,7 +891,7 @@ begin end; procedure MetaSync(handle:HSYNC;channel,data:dword;user:pointer); stdcall; -//var tagtype:Integer; +//var tagtype:integer; begin (* if handle=syncOGG then tagtype:=BASS_TAG_OGG @@ -964,7 +964,7 @@ end; procedure OpenURL(url:PWideChar); cdecl; var - len,progress:DWORD; + len,progress:dword; flags:dword; i:integer; EAXUsed:bool; diff --git a/plugins/mRadio/rframeapi.pas b/plugins/mRadio/rframeapi.pas index 471f8ccf71..dd44aaa353 100644 --- a/plugins/mRadio/rframeapi.pas +++ b/plugins/mRadio/rframeapi.pas @@ -42,7 +42,7 @@ begin end; end; -function SliderWndProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall; +function SliderWndProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall; begin if hMessage=WM_ERASEBKGND then result:=1 @@ -70,7 +70,7 @@ begin SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,tlparam(@ti)); end; -function RadioFrameProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall; +function RadioFrameProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall; var urd:TUTILRESIZEDIALOG; rc:TRECT; @@ -239,7 +239,7 @@ begin StrCopy(cid.name ,frm_back); StrCopy(cid.setting,'frame_back'); - cid.defcolour:=COLOR_3DFACE; + cid.defcolour:=GetSysColor(COLOR_3DFACE); cid.order :=0; ColourRegister(@cid); diff --git a/plugins/mRadio/rglobal.pas b/plugins/mRadio/rglobal.pas index 51caddc63c..313c62015c 100644 --- a/plugins/mRadio/rglobal.pas +++ b/plugins/mRadio/rglobal.pas @@ -21,7 +21,7 @@ const const chan :HSTREAM = 0; - ActiveContact:MCONTACT = 0; + ActiveContact:TMCONTACT = 0; ActiveURL :PWideChar = nil; const @@ -159,7 +159,7 @@ const function MakeMessage:pWideChar; -procedure SetStatus(hContact:MCONTACT;status:integer); +procedure SetStatus(hContact:TMCONTACT;status:integer); function GetDefaultRecPath:pWideChar; function GetStatusText(status:integer;toCList:boolean=false):PWideChar; @@ -169,7 +169,7 @@ implementation uses common, dbsettings; -procedure SetStatus(hContact:MCONTACT;status:integer); +procedure SetStatus(hContact:TMCONTACT;status:integer); begin // if Status=ID_STATUS_OFFLINE then // MyStopBass; -- cgit v1.2.3