//
unit bspplg;

interface

uses Windows;

//v2.11+
const BSP_PLUGIN_VER=2;
      keyShift   = $1;
      keyControl = $4;
      keyAlt     = $2;
      mouseLeft  = $8;
      mouseMiddle= $20;
      mouseRight = $10;

type pluginInfo=record
  description:array[0..255] of char; //Filled in by plugin
  plgCallback:function(const cmdID:DWORD;param1,param2:pointer):integer;stdcall; //Filled in by plugin

  hwndParent:HWND;//Filled in by BSPlayer
  hwndVideoWin:HWND;//Filled in by BSPlayer

  execAction:procedure(const a_action:integer);stdcall;//Filled in by BSPlayer

  //Subtitle functions
  // Register additional extension for subtitles
  //  subRegisterExt('*.mysub1;*.mysub2');
  //  for every registered extension function plgCallback will be called with cmdID EV_LOAD_SUB and param1 as file name
  subRegisterExt:procedure(const ext:Pchar);stdcall;//Filled in by BSPlayer
  createSubs:function(const subName:PChar):integer;stdcall;//Filled in by BSPlayer
  addLine:function(const subID,substart,substop:DWORD;subLine:Pchar):integer;stdcall;//Filled in by BSPlayer
  activateSubs:procedure(const subID:integer);stdcall;//Filled in by BSPlayer

  //OSD functions
  // showTime - How long should OSD be displayed
  // OSDid - must be >=50000 or 0
  ShowOSDText:procedure(const osdText:Pchar;const showTime,OSDid:DWORD);stdcall;//Filled in by BSPlayer
end;

type PpluginInfo=^pluginInfo;

//events
const
  EV_UNLOAD              = 40000; //plugin is unloading
  EV_BEFORE_FILE_OPEN    = 40001; //Called before file is loaded, param1 - pointer to filename
  EV_FILE_OPEN           = 40002; //Called after file is loaded (movie is open), param1 - pointer to filename
  EV_CONFIG              = 40003; //param1 - window handle
  EV_ABOUT               = 40004; //param1 - window handle
  EV_LOAD_SUB            = 40005; //param1 - file name and path to subtitle file
  EV_PLAY                = 40006;
  EV_STOP                = 40007;
  EV_PAUSE               = 40008;
//  EV_OSD                 = 40009; //Called on every OSD message, param1 pointer to OSD text
  EV_SKIN_LOAD           = 40010;
  EV_KEY_PRESS           = 40011; // 2.11+ Called on every key press, when mouse button is presseed and mouse wheel
                                  // should return 0 to continue default key processing

implementation

end.