diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-01 23:11:39 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-01 23:11:39 +0000 |
commit | 8ef40f0bd018c6f9295977c206714db8d1e6159c (patch) | |
tree | 2acbdcb3743bb4d1b6bbfc49953cc164b11a6089 /plugins/mRadio | |
parent | 427891e0d28becb428ae8435954399f2e4daa9fe (diff) |
code cleanup for pascal plugins
git-svn-id: http://svn.miranda-ng.org/main/trunk@3828 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/mRadio')
-rw-r--r-- | plugins/mRadio/i_bass.inc | 13 | ||||
-rw-r--r-- | plugins/mRadio/i_optdlg.inc | 30 | ||||
-rw-r--r-- | plugins/mRadio/i_search.inc | 109 |
3 files changed, 13 insertions, 139 deletions
diff --git a/plugins/mRadio/i_bass.inc b/plugins/mRadio/i_bass.inc index 77f0d3650a..e52d7f377a 100644 --- a/plugins/mRadio/i_bass.inc +++ b/plugins/mRadio/i_bass.inc @@ -53,7 +53,7 @@ begin end
else
pcw:=FastAnsiToWideBuf(BASS_ERRORS[idx],@buf);
-
+
MessageBoxW(0,TranslateW(pcw),
TranslateW('Oops! BASS error'),MB_ICONERROR)
end;
@@ -139,7 +139,7 @@ begin else
result:=true;
end;
-
+
end;
end;
@@ -316,9 +316,6 @@ begin if recpath<>nil then
begin
ConvertFileName(recpath,buf,ActiveContact);
-// pcw:=ParseVarString(recpath,ActiveContact);
-// CallService(MS_UTILS_PATHTOABSOLUTEW,dword(pcw),dword(buf));
-// mFreeMem(pcw);
if not ForceDirectories(buf) then
begin
result:=nil;
@@ -549,7 +546,7 @@ begin end
else
needtofree:=true;
-
+
// to avoid mem leak and wrong tag process
result:=true;
end;
@@ -699,7 +696,7 @@ begin end;
end;
end;
-{$IFDEF Debug}
+{$IFDEF Debug}
logmeta(tag,artist,title);
{$ENDIF}
mFreeMem(oldartist);
@@ -855,7 +852,7 @@ begin if chan=0 then
begin
- if (CallService(MS_RADIO_COMMAND,MRC_STATUS,RD_STATUS_GET)=RD_STATUS_ABORT) or
+ if (CallService(MS_RADIO_COMMAND,MRC_STATUS,RD_STATUS_GET)=RD_STATUS_ABORT) or
(plist=nil) then
begin
CallService(MS_RADIO_COMMAND,MRC_STOP,1);
diff --git a/plugins/mRadio/i_optdlg.inc b/plugins/mRadio/i_optdlg.inc index e047fe20a1..d9fe1c4779 100644 --- a/plugins/mRadio/i_optdlg.inc +++ b/plugins/mRadio/i_optdlg.inc @@ -148,7 +148,7 @@ begin if lstorage<>nil then
begin
list:=GetSectionList(lstorage);
-
+
pc:=list;
while pc^<>#0 do
begin
@@ -174,7 +174,7 @@ begin pc:=DBReadString(hContact,strCList,optMyHandle);
WritePrivateProfileStringA(section,'Name',pc,fname);
mFreeMem(pc);
-
+
pc:=DBReadString(hContact,PluginName,optStationURL);
WritePrivateProfileStringA(section,'URL',pc,fname);
mFreeMem(pc);
@@ -316,7 +316,7 @@ begin SetButtonIcon(ti.uId,IcoBtnAdd);
SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
+
ti.uId :=GetDlgItem(Dialog,IDC_EQ_DEL);
ti.lpszText:=TranslateW('Delete');
SetButtonIcon(ti.uId,IcoBtnDel);
@@ -331,7 +331,6 @@ var psr:TPROTOSEARCHRESULT;
dst:pWideChar;
i:dword;
-// info:BASS_CHANNELINFO;
vhi:TVARHELPINFO;
wnd:HWND;
p:pWideChar;
@@ -381,7 +380,7 @@ begin CheckDlgButton(Dialog,IDC_OFFLINE ,AsOffline);
SetDlgItemTextW(Dialog,IDC_STATUS,StatusTmpl);
-
+
DlgInit:=0;
end;
@@ -420,7 +419,7 @@ begin end;
IDC_BN_URLPATH: begin
-
+
dst:=ConstructFilter;
if ShowDlgW(@buf,nil,dst) then
SetDlgItemTextW(Dialog,IDC_STATIONURL,@buf);
@@ -467,20 +466,14 @@ begin StrDupW(email.w,@buf);
i:=Service_AddToList(0,tlparam(@psr));
-{
- GetDlgItemTextW(Dialog,IDC_STATION,@buf,SizeOf(buf));
- DBWriteUnicode(i,strCList,optMyHandle,@buf);
- GetDlgItemTextW(Dialog,IDC_STATIONURL,@buf,SizeOf(buf));
- DBWriteUnicode(i,PluginName,optStationURL,@buf);
-}
// "changing" station group
dst:=GetNewGroupName(Dialog);
if dst<>nil then
DBWriteUnicode(i,strCList,optGroup,dst)
else
DBDeleteSetting(i,strCList,optGroup);
-
+
end
else if loword(wParam)=IDC_ADD_INI then
begin
@@ -548,13 +541,6 @@ begin doLoop:=IsDlgButtonChecked(Dialog,IDC_LOOP);
if chan<>0 then
begin
-{
- BASS_ChannelGetInfo(chan,info);
- if doLoop<>BST_UNCHECKED then
- info.flags:=info.flags or BASS_SAMPLE_LOOP
- else
- info.flags:=info.flags and not BASS_SAMPLE_LOOP;
-}
BASS_ChannelFlags(chan,ord(doLoop<>BST_UNCHECKED),BASS_SAMPLE_LOOP);
end;
@@ -642,7 +628,7 @@ begin SendDlgItemMessageA(Dialog,IDC_0+i,WM_SETTEXT,0,tlparam(eq[i].text));
EnableWindow(eq[i].wnd,isEQ_OFF=BST_UNCHECKED);
end;
-
+
CheckDlgButton(Dialog,IDC_EQOFF,isEQ_OFF);
dst:=DBReadUnicode(0,PluginName,optBASSPath,nil);
@@ -922,7 +908,7 @@ begin DBWriteString(wParam,PluginName,optBitrate,IntToStr(buf,i));
exit;
end;
-
+
case value._type of
DBVT_DELETED,
DBVT_ASCIIZ ,
diff --git a/plugins/mRadio/i_search.inc b/plugins/mRadio/i_search.inc index d4330e84d1..ffd0b8b6de 100644 --- a/plugins/mRadio/i_search.inc +++ b/plugins/mRadio/i_search.inc @@ -1,90 +1,5 @@ {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,
@@ -239,7 +154,6 @@ begin with filter do
begin
-// CallService(MS_UTILS_PATHTOABSOLUTE,dword(@ini1),dword(@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
@@ -378,29 +292,6 @@ begin if lurl<>nil then
begin
-{
-// find contact
- hContact:=CallService(MS_DB_CONTACT_FINDFIRST,0,0);
- while hContact<>0 do
- begin
- if StrCmp(PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0)),
- PluginName)=0 then
- 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;
- end;
- hContact:=CallService(MS_DB_CONTACT_FINDNEXT,hContact,0);
- end;
-// if not found
-}
hContact:=CallService(MS_DB_CONTACT_ADD,0,0);
if hContact<>0 then
begin
|