library gen_remamp;
{$R *.res}
uses
Windows, SysUtils, Forms, IdBaseComponent, IdComponent, IdTCPServer;
type
PGeneralPlugin = ^TGeneralPlugin;
TGeneralPlugin =
record
Version: Integer;
Description: PChar;
InitProc:
procedure;
cdecl;
ConfigProc:
procedure;
cdecl;
QuitProc:
procedure;
cdecl;
hwndParent: THandle;
DllInstance: THandle;
end;
TCPServer1 =
class(TIdTCPServer)
private
procedure TCPServer1Execute(AThread: TIdPeerThread);
public
constructor CreateServer;
end;
var
PluginInfo: TGeneralPlugin;
HookHandle: Cardinal = 0;
hWinAmp: HWnd;
const
WM_USER = $0400;
WM_WA_IPC = $0400;
WM_COMMAND = $0111;
IPC_PLAYFILE = 100;
IPC_STARTPLAY = 102;
IPC_SETPLAYLISTPOS = 121;
IPC_GetListPos = 125;
IPC_GetPlaylistFile = 211;
IPC_UPDTITLE = 243;
IPC_PlayButton = 40045;
constructor TCPServer1.CreateServer;
begin
//inherited Create;
OnExecute:= TCPServer1Execute;
Bindings:=
nil;
CommandHandlers:=
nil;
Greeting.NumericCode:= 0;
MaxConnectionReply.NumericCode:= 0;
DefaultPort:= 35600;
//Active:= true;
end;
procedure TCPServer1.TCPServer1Execute(AThread: TIdPeerThread);
begin
MessageBox(0, PChar(AThread.Connection.ReadLn), '
Test', MB_OK);
end;
procedure InitPlugin;
cdecl
var
position: Integer;
begin
{//Start
position:= 1;
SendMessage(hWinAmp,WM_WA_IPC,position,IPC_SETPLAYLISTPOS);
SendMessage(hWinAmp,WM_WA_IPC,0,IPC_PLAYFILE);
//SendMessage(hWinAmp,WM_WA_IPC,0,IPC_UPDTITLE);
//SendMessage(hWinAmp,WM_WA_IPC,0,IPC_STARTPLAY);}
// Test des Indy-Clients
end;
procedure ConfigPlugin;
cdecl
begin
MessageBox(0, '
RemoteAmp - Control WinAmp via TCP/IP' + #13 +
#13 +
'
coded by GimbaR',
'
RemAmp - 09/05', mb_ok);
end;
procedure QuitPlugin;
cdecl;
begin
//Disconcect
end;
function GetPluginInfo: PGeneralPlugin;
begin
with PluginInfo
do
begin
Version:= $10;
Description:='
RemAmp - remote WinAmp [TCP/IP] - by GimbaR';
InitProc:= InitPlugin;
ConfigProc:= ConfigPlugin;
QuitProc:= QuitPlugin;
hwndParent:= 0;
DllInstance:= hInstance;
end;
result:= @PluginInfo;
hWinAmp:= FindWindow('
Winamp v1.x',
nil);
// Einstellungen des Indy-Servers setzen
TCPServer1:= TIdTCPServer.Create(Application);
//<-- hier
end;
exports
GetPluginInfo
name '
winampGetGeneralPurposePlugin';
end.