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/docs/sampledll.dpr | |
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/docs/sampledll.dpr')
-rw-r--r-- | plugins/Watrack/docs/sampledll.dpr | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/plugins/Watrack/docs/sampledll.dpr b/plugins/Watrack/docs/sampledll.dpr new file mode 100644 index 0000000000..908fe60597 --- /dev/null +++ b/plugins/Watrack/docs/sampledll.dpr @@ -0,0 +1,139 @@ +library testdll;
+
+uses m_api, Windows,common;
+
+{$include m_helpers.inc}
+{$include m_music.inc}
+
+const
+ PluginInfo:TPLUGININFOEX=(
+ cbSize :sizeof(TPLUGININFOEX);
+ shortName :'Plugin Template';
+ version :$00000001;
+ description:'The long description of your plugin, to go in the plugin options dialog';
+ author :'J. Random Hacker';
+ authorEmail:'noreply@sourceforge.net';
+ copyright :'(c) 2003 J. Random Hacker';
+ homepage :'http://miranda-icq.sourceforge.net/';
+ flags :UNICODE_AWARE;
+ replacesDefaultModule:0;
+ uuid:'{00000000-0000-0000-0000-000000000000}'
+ );
+var
+ PluginInterfaces:array [0..1] of MUUID;
+
+var
+ hook:integer;
+ oldproc:tReadFormatProc;
+
+// -------- format --------
+Function mp3proc(var dst:tSongInfo):boolean;cdecl;
+begin
+{
+ MP3 Handler here
+}
+//messagebox(0,'ok','',0);
+// Example for old handler
+ if (int(@oldproc)<>WAT_RES_OK) and (int(@oldproc)<>WAT_RES_ERROR) then
+ result:=oldproc(dst)
+ else
+ result:=true;
+end;
+
+// ---------- Player ----------
+var
+ plwnd:HWND;
+
+function Check(flags:integer):HWND;cdecl;
+begin
+ result:=1;
+ plwnd:=12;
+end;
+
+function GetFileName:pWideChar;cdecl;
+begin
+ result:=nil;
+end;
+
+function GetInfo(var SongInfo:tSongInfo;flags:integer):integer;cdecl;
+begin
+ PluginLink^.CallService(MS_WAT_WINAMPINFO,integer(@SongInfo),flags);
+ SongInfo.plyver:=$1234;
+ result:=0;
+end;
+
+function Command(command:integer;value:integer):integer;cdecl;
+begin
+ result:=PluginLink^.CallService(MS_WAT_WINAMPCOMMAND,plwnd,
+ command+(value shl 16));
+end;
+
+function OnWATLoaded(wParam:WPARAM;lParam:LPARAM):int;cdecl;
+var
+ tmp:tMusicFormat;
+ tmp1:tPlayerCell;
+begin
+ PluginLink^.UnhookEvent(hook);
+
+ FillChar(tmp,SizeOf(tMusicFormat),0);
+ lstrcpy(tmp.ext,'MP3');
+ tmp.proc:=mp3proc;
+ oldproc:=tReadFormatProc(PluginLink^.CallService(MS_WAT_FORMAT,
+ WAT_ACT_REGISTER+WAT_ACT_REPLACE,dword(@tmp)));
+
+ FillChar(tmp1,SizeOf(tPlayerCell),0);
+ tmp1.desc :='Sampler';
+ tmp1.flags :=0;// WAT_OPT_WINAMPAPI
+ tmp1.Check :=@Check;
+ tmp1.GetInfo:=@GetInfo;
+ tmp1.Command:=@Command;
+ tmp1.GetName:=@GetFileName;
+ PluginLink^.CallService(MS_WAT_PLAYER,WAT_ACT_REGISTER+WAT_ACT_REPLACE,dword(@tmp1));
+ result:=0;
+end;
+
+function OnModuleLoaded(wParam:WPARAM;lParam:LPARAM):int;cdecl;
+begin
+ hook:=HookEvent(ME_WAT_MODULELOADED,@OnWATLoaded);
+ result:=0;
+end;
+
+function MirandaPluginInfo(mirandaVersion:DWORD):PPLUGININFO; cdecl;
+begin
+ result:=@PluginInfo;
+ PluginInfo.cbSize:=SizeOf(TPLUGININFO);
+end;
+
+function MirandaPluginInfoEx(mirandaVersion:DWORD):PPLUGININFOEX; cdecl;
+begin
+ result:=@PluginInfo;
+ PluginInfo.cbSize:=SizeOf(TPLUGININFOEX);
+end;
+
+function Load(link: PPLUGINLINK): int; cdecl;
+begin
+ PLUGINLINK := Pointer(link);
+ InitMMI;
+ Result:=0;
+ hook:=HookEvent(ME_SYSTEM_MODULESLOADED,@OnModuleLoaded);
+end;
+
+function Unload: int; cdecl;
+begin
+ Result:=0;
+end;
+
+function MirandaPluginInterfaces:PMUUID; cdecl;
+begin
+ PluginInterfaces[0]:=PluginInfo.uuid;
+ PluginInterfaces[1]:=MIID_LAST;
+ result:=@PluginInterfaces;
+end;
+
+exports
+ Load, Unload,
+ MirandaPluginInfo
+ ,MirandaPluginInterfaces,MirandaPluginInfoEx;
+
+begin
+end.
|