library sample_plugin;

uses
  Windows,
  bspplg in '..\..\bspplg.pas',
  bsp in '..\..\..\bsp.pas';

var pInfo:PpluginInfo;


procedure Config(const winh:HWND);
begin
  Messagebox(winh,'Configuration','Info',0);
end;

function CallbackProc(const cmdID:DWORD;param1,param2:pointer):integer;stdcall;
begin
  case cmdID of
    EV_UNLOAD:Messagebox(pInfo.hwndParent,'Plugin is unloading','Info',0);
    EV_PLAY:pInfo.ShowOSDText('Hello from plugin',4000,50000);
    EV_CONFIG:Config(HWND(param1));
    EV_ABOUT:Messagebox(HWND(param1),'Sample plugin v 0.1','About',0);
  end;
end;

function pluginInit(plgInfo: PpluginInfo): BOOL; stdcall;
begin
  plgInfo.description:='Sample plugin';
  plgInfo.plgCallback:=CallbackProc;
  pInfo:=plgInfo;
  Messagebox(plgInfo.hwndParent,'Plugin init','Info',0);

  result:=true;
end;

exports pluginInit;

begin
end.
 