diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-10-08 18:43:29 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-10-08 18:43:29 +0000 |
commit | 864081102a5f252415f41950b3039a896b4ae9c5 (patch) | |
tree | c6b764651e9dd1f8f53b98eab05f16ba4a492a79 /plugins/Watrack/players/pl_1by1.pas | |
parent | db5149b48346c417e18add5702a9dfe7f6e28dd0 (diff) |
Awkwars's plugins - welcome to our trunk
git-svn-id: http://svn.miranda-ng.org/main/trunk@1822 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Watrack/players/pl_1by1.pas')
-rw-r--r-- | plugins/Watrack/players/pl_1by1.pas | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/plugins/Watrack/players/pl_1by1.pas b/plugins/Watrack/players/pl_1by1.pas new file mode 100644 index 0000000000..630b825363 --- /dev/null +++ b/plugins/Watrack/players/pl_1by1.pas @@ -0,0 +1,84 @@ +{1by1 player}
+unit pl_1by1;
+{$include compilers.inc}
+
+interface
+
+implementation
+uses windows,common,wrapper,srv_player,wat_api;
+
+const
+ ObOClass = '1by1WndClass';
+ ObOTitle = '1by1 - The Directory Player';
+
+function Check(wnd:HWND;flags:integer):HWND;cdecl;
+begin
+ if wnd<>0 then
+ begin
+ result:=0;
+ exit;
+ end;
+ result:=FindWindow(ObOClass,NIL);
+end;
+
+{
+ need to set 'Elapsed time in title bar'
+ and 'Show : instead of ' as minute char'
+}
+function GetElapsedTime(wnd:HWND):integer;
+var
+ s,p:PAnsiChar;
+begin
+ result:=0;
+ s:=GetDlgText(wnd,true);
+ if s<>nil then
+ begin
+ if (s^>='0') and (s^<='9') then
+ begin
+ p:=StrScan(s,' ');
+ if p<>nil then
+ p^:=#0;
+ result:=TimeToInt(s)
+ end;
+ mFreeMem(s);
+ end;
+end;
+
+function GetInfo(var SongInfo:tSongInfo;flags:integer):integer;cdecl;
+begin
+ result:=0;
+ if (flags and WAT_OPT_CHANGES)<>0 then
+ SongInfo.time:=GetElapsedTime(SongInfo.plwnd);
+end;
+
+const
+ plRec:tPlayerCell=(
+ Desc :'1by1';
+ flags :WAT_OPT_HASURL;
+ Icon :0;
+ Init :nil;
+ DeInit :nil;
+ Check :@Check;
+ GetStatus:nil;
+ GetName :nil;
+ GetInfo :@GetInfo;
+ Command :nil;
+ URL :'http://www.mpesch3.de/';
+ Notes :'To get elapsed time, needs to set "Elapsed time in title bar" and '#13#10+
+ '"Show : instead of '#39' as minute char" in player settings "Display" tab.'
+);
+
+var
+ LocalPlayerLink:twPlayer;
+
+procedure InitLink;
+begin
+ LocalPlayerLink.Next:=PlayerLink;
+ LocalPlayerLink.This:=@plRec;
+ PlayerLink :=@LocalPlayerLink;
+end;
+
+initialization
+// ServicePlayer(WAT_ACT_REGISTER,dword(@plRec));
+ InitLink;
+end.
|