////////////////////////////////////////////////////////////////////
// BSPlayer API v 1.1
//
// To get BSPlayer window handle use:
// bsp_hand:=FindWindow('BSPlayer',nil);
//
// then you can send messages, for ex. to get current version:
// bsp_ver := SendMessage(bsp_hand,WM_BSP_CMD,BSP_GETVERSION,0);
////////////////////////////////////////////////////////////////////
unit bsp;

interface

uses messages;

const
    WM_BSP_CMD = WM_USER+2;

    // bsp_ver := SendMessage(bsp_hand,WM_BSP_CMD,BSP_GETVERSION,0);
    // available in BSPlayer version 0.84.484+
    //
    // Return player version
    // format will be XX.YY.ZZZZ -> $XXYYZZZZ
    // for 0.84.484 -> $00840484
    BSP_GETVERSION = $10000;

    // mov_len := SendMessage(bsp_hand,WM_BSP_CMD,BSP_GetMovLen,0);
    // available in BSPlayer version 0.84.484+
    //
    // Return movie length in msec
    BSP_GetMovLen  = $10100;

    // mov_pos := SendMessage(bsp_hand,WM_BSP_CMD,BSP_GetMovPos,0);
    // available in BSPlayer version 0.84.484+
    //
    // Return current movie position in msec
    BSP_GetMovPos  = $10101;

    // status := SendMessage(bsp_hand,WM_BSP_CMD,BSP_GetStatus,0);
    // available in BSPlayer version 0.84.484+
    //
    // Return player status
    // 0 - STOP
    // 1 - PAUSE
    // 2 - PLAY
    // 4 - No movie open
    BSP_GetStatus  = $10102;

    // SendMessage(bsp_hand,WM_BSP_CMD,BSP_Seek,t);
    // t is time in msec
    // available in BSPlayer version 0.84.484+
    //
    // Seek to specified position
    BSP_Seek       = $10103;


    // SendMessage(bsp_hand,WM_BSP_CMD,BSP_SetVol,vol);
    // vol is volume in range 0-24
    // available in BSPlayer version 0.84.484+
    //
    // Set volume
    BSP_SetVol     = $10104;

    // vol := SendMessage(bsp_hand,WM_BSP_CMD,BSP_GetVol,0);
    // available in BSPlayer version 0.84.484+
    //
    //Get volume in range 0-24
    BSP_GetVol     = $10105;

    // v1.00+
    // all this messages with WM_COPYDATA message can be called from plugins like this:
    //
    // var buf:array[0..MAX_PATH] of char;
    // SendMessage(bsp_hand,WM_BSP_CMD,BSP_GetSkin,Lparam(@buf));
    //
    // SendMessage(bsp_hand,WM_BSP_CMD,BSP_SetSkin,LParam(Pchar('SkinName')));


    // cds:TCOPYDATASTRUCT;
    //                                           
    // cds.dwData:=BSP_SetSkin;
    // cds.lpData:=Pchar('skin_name');
    // cds.cbData:=strlen(cds.lpData)+1;
    // SendMessage(bsp_hand,WM_COPYDATA,0,lParam(@cds));
    // available in BSPlayer version 0.84.484+
    //
    // Set new skin
    BSP_SetSkin    = $10106;

    // cds:TCOPYDATASTRUCT;
    // buf:array[0..MAX_PATH-1] of char;
    // adr:pointer;
    //
    // adr:=@buf;
    // cds.dwData:=BSP_GetSkin;
    // cds.lpData:=@adr;
    // cds.cbData:=4;
    // SendMessage(bsp_hand,WM_COPYDATA,appHWND,lParam(@cds));
    // available in BSPlayer version 0.84.484+
    //
    // appHWND is calling application window handle
    //
    // Get current skin, skin name will be copied to buf
    BSP_GetSkin    = $10107;


    // cds:TCOPYDATASTRUCT;
    //
    // cds.dwData:=BSP_OpenFile;
    // cds.lpData:=Pchar('file.avi');
    // cds.cbData:=strlen(cds.lpData)+1;
    // SendMessage(bsp_hand,WM_COPYDATA,0,lParam(@cds));
    // available in BSPlayer version 0.84.484+
    //
    // Open file
    BSP_OpenFile    = $10108;

    // cds:TCOPYDATASTRUCT;
    //
    // cds.dwData:=BSP_LoadSub;
    // cds.lpData:=Pchar('subtitles.sub');
    // cds.cbData:=strlen(cds.lpData)+1;
    // SendMessage(bsp_hand,WM_COPYDATA,0,lParam(@cds));
    // available in BSPlayer version 0.84.484+
    //
    // Load subtitles
    BSP_LoadSub    = $10109;

    // cds:TCOPYDATASTRUCT;
    //
    // cds.dwData:=BSP_LoadAudio;
    // cds.lpData:=Pchar('file.mp3');
    // cds.cbData:=strlen(cds.lpData)+1;
    // SendMessage(bsp_hand,WM_COPYDATA,0,lParam(@cds));
    // available in BSPlayer version 0.84.484+
    //
    // Load external audio file
    BSP_LoadAudio    = $1010A;

    // cds:TCOPYDATASTRUCT;
    // buf:array[0..MAX_PATH-1] of char;
    // adr:pointer;
    //
    // adr:=@buf;
    // cds.dwData:=BSP_GetFileName;
    // cds.lpData:=@adr;
    // cds.cbData:=4;
    // SendMessage(bsp_hand,WM_COPYDATA,appHWND,lParam(@cds));
    // available in BSPlayer version 0.84.484+
    //
    // appHWND is calling application window handle
    // File name will be copied to buf
    //
    // Get open file name
    BSP_GetFileName  = $1010B;

    // cds:TCOPYDATASTRUCT;
    //
    // cds.dwData:=BSP_LoadPlaylist;
    // cds.lpData:=Pchar('file.bsl');
    // cds.cbData:=strlen(cds.lpData)+1;
    // SendMessage(bsp_hand,WM_COPYDATA,0,lParam(@cds));
    // available in BSPlayer version 1.00.800+
    //
    // Load playlist
    BSP_LoadPlaylist = $1010C;
    
    // cds:TCOPYDATASTRUCT;
    //
    // cds.dwData:=BSP_LoadPlaylistInt;
    // cds.lpData:=Pchar('file.bls');
    // cds.cbData:=strlen(cds.lpData)+1;
    // SendMessage(bsp_hand,WM_COPYDATA,0,lParam(@cds));
    // available in BSPlayer version 1.00.800+
    //
    // Load playlist in internal format
    BSP_LoadPlaylistInt = $1010D;

    // Other commands
    
    BSP_ExitFScreen=0;
    BSP_VolUp=1;
    BSP_VolDown=2;
    BSP_DeDynUp=3;
    BSP_DeDynPreUp=4;
    BSP_DeDynDown=5;
    BSP_DeDynPreDown=6;
    BSP_Preferences=7;
    BSP_FrmCapture=8;
    BSP_Frm2=9;
    BSP_FS_Switch=10;
    BSP_SubsEnDi=11;
    BSP_Skins=12;
    BSP_AStrmVolCyc=13;
    BSP_Rew=14;
    BSP_Forw=15;
    BSP_SubCorInc=16;
    BSP_SubCorDec=17;
    BSP_SubCorIncS=18;
    BSP_SubCorDecS=19;
    BSP_Play=20;
    BSP_Pause=21;
    BSP_Stop=22;
    BSP_ViewChp=23;
    BSP_VBlankSwitch=24;
    BSP_Prev=25;
    BSP_PrevCh=26;
    BSP_PrevCD=27;
    BSP_Next=28;
    BSP_NextCh=29;
    BSP_NextCD=30;
    BSP_ATop=31;
    BSP_OvrTop=32;
    BSP_AspCyc=33;
    BSP_PlayList=34;
    BSP_Mute=35;
    BSP_JumpToTime=36;
    BSP_Zoom50=37;
    BSP_Zoom100=38;
    BSP_Zoom200=39;
    BSP_AspOrg=40;
    BSP_Asp169=41;
    BSP_Asp43=42;
    BSP_AspAnamorph=43;
    BSP_MovieMode=44;
    BSP_VInf=45;
    BSP_PanIn=46;
    BSP_PanOut=47;
    BSP_ZoomIn=48;
    BSP_ZoomOut=49;
    BSP_MoveLeft=50;
    BSP_MoveRight=51;
    BSP_MoveUp=52;
    BSP_MoveDown=53;
    BSP_FRSizeLeft=54;
    BSP_FRSizeRight=55;
    BSP_FRSizeUp=56;
    BSP_FRSizeDown=57;
    BSP_ResetMov=58;
    BSP_HideCtrl=59;
    BSP_EQ=60;
    BSP_OpenAud=61;
    BSP_OpenSub=62;
    BSP_OpenMov=63;
    BSP_PanScan=64;
    BSP_CusPanScan=65;
    BSP_DeskMode=66;
    BSP_AddBk=67;
    BSP_EditBK=68;
    BSP_SkinRefr=69;
    BSP_About=70;
    BSP_CycleAS=71;
    BSP_CycleSub=72;
    BSP_IncPBRate=73;
    BSP_DecPBRate=74;
    BSP_IncPP=75;
    BSP_DecPP=76;
    BSP_Exit=77;
    BSP_CloseM=78;
    BSP_JumpF=79;
    BSP_JumpB=80;
    BSP_ChBordEx=81;
    BSP_CycleVid=82;
    BSP_IncFnt=83;
    BSP_DecFnt=84;
    BSP_IncBri=85;
    BSP_DecBri=86;
    BSP_MovSubUp=87;
    BSP_MovSubDown=88;
    BSP_SHTime=89;

    BSP_IncBriHW=90;
    BSP_DecBriHW=91;
    BSP_IncConHW=92;
    BSP_DecConHW=93;
    BSP_IncHueHW=94;
    BSP_DecHueHW=95;
    BSP_IncSatHW=96;
    BSP_DecSatHW=97;
    BSP_ShowHWClr=98;
    BSP_IncMovWin=99;
    BSP_DecMovWin=100;
    BSP_IncPBRate1=101;
    BSP_DecPBRate1=102;
    BSP_SWRepeat=103;
    BSP_SWDispFmt=104;
    BSP_FastForw=105;
    BSP_FastRew=106;
    BSP_BossBtn=107;
    BSP_MediaLib=108;
    BSP_OpenURL=109;
    BSP_Minimize=110;
    BSP_ShowMenu=111;
    BSP_LoadSwSub=112;
    BSP_CycleSubR=113;
    BSP_SubNextFnt=114;
    BSP_SubPrevFnt=115;
    BSP_AspCycR=116;
    BSP_DVDTitle=117;
    BSP_DVDChapter=118;
    BSP_DVDSub=119;
    BSP_DVDLang=120;
    BSP_Res8=121;
    BSP_Res9=122;
    
    BSP_ML_VIDEO = 6500;
    BSP_ML_DVD = 6501;
    BSP_ML_AUDIO = 6502;
    BSP_ML_RADIO = 6503;


implementation

end.
