diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-10-10 09:06:13 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-10-10 09:06:13 +0000 |
commit | 1216b6c0235d6f55c29671c6b2b1074c8962da38 (patch) | |
tree | da4617df8509d81c1751563a8da847872662a731 /plugins/mRadio/i_variables.inc | |
parent | 58a0d4659d4735f9d5c724f9d7c950e50565abf9 (diff) |
mRadio moved to protocols
in fpc.cfg added pathes for protocols folder
git-svn-id: http://svn.miranda-ng.org/main/trunk@1859 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/mRadio/i_variables.inc')
-rw-r--r-- | plugins/mRadio/i_variables.inc | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/plugins/mRadio/i_variables.inc b/plugins/mRadio/i_variables.inc deleted file mode 100644 index fead4afad8..0000000000 --- a/plugins/mRadio/i_variables.inc +++ /dev/null @@ -1,82 +0,0 @@ -{Variables support}
-const
- numvars = 8;
-type
- tvar = packed record
- name :PWideChar;
- help :PAnsiChar;
- end;
-const
- vars:array [0..numvars-1] of tvar = (
- (name:'radio_name' ;help:'Station Name'),
- (name:'radio_url' ;help:'Station/playlist URL'),
- (name:'radio_active' ;help:'Currently played URL'),
- (name:'radio_genre' ;help:'Genre'),
- (name:'radio_bitrate';help:'Bitrate'),
- (name:'radio_title' ;help:'Current stream title'),
- (name:'radio_codec' ;help:'Currently used decoder'),
- (name:'radio_status' ;help:'Current status'));
-// contact,protocol,host,port,file/path
-
-function GetField(ai:PARGUMENTSINFO):pWideChar; cdecl;
-var
- i:integer;
- res:PWideChar;
-begin
- res:=nil;
- if ActiveContact<>0 then
- begin
- i:=0;
- repeat
- if lstrcmpiw(PWideChar(ai^.argv^),vars[i].name)=0 then
- break;
- inc(i);
- until i=numvars;
- case i of
- 0: res:=DBReadUnicode(ActiveContact,strCList ,optMyHandle);
- 1: res:=DBReadUnicode(ActiveContact,PluginName,optStationURL);
- 2: StrDupW(res,ActiveURLw);
- 3: res:=DBReadUnicode(ActiveContact,PluginName,optGenre);
- 4: res:=DBReadUnicode(ActiveContact,PluginName,optBitrate);
- 5: res:=MakeMessage;
- 6: res:=DBReadUnicode(0,PluginName,optActiveCodec);
- 7: StrDupW(res,TranslateW(GetStatusText(CallService(MS_RADIO_COMMAND,MRC_STATUS,RD_STATUS_GET))));
- end;
- end;
- if res=nil then
- begin
- mGetMem(res,2);
- res^:=#0;
- end;
- result:=res;
-end;
-
-function FreeField(szReturn:PWideChar):int; cdecl;
-begin
- mFreeMem(szReturn);
- result:=1;
-end;
-
-procedure RegisterVariables;
-const
- Prefix:PAnsiChar = 'Radio'#9;
-var
- rt:TTOKENREGISTER;
- i:integer;
- s:array [0..127] of AnsiChar;
- p:pAnsiChar;
-begin
- rt.cbSize :=SizeOf(rt);
- rt.memType :=TR_MEM_OWNER;
- rt.szService :=@GetField;
- rt.szCleanupService:=@FreeField;
- rt.flags:=TRF_FIELD or TRF_CLEANUP or TRF_PARSEFUNC or TRF_CLEANUPFUNC or TRF_UNICODE;
- p:=StrCopyE(s,Prefix);
- rt.szHelpText:=@s;
- for i:=0 to numvars-1 do
- begin
- rt.szTokenString.w:=vars[i].name;
- StrCopy(p,vars[i].help);
- CallService(MS_VARS_REGISTERTOKEN,0,lparam(@rt));
- end;
-end;
|