I am trying to develop a windows app based around cameras using xdview.ocx. www.ipcamerachina.com/downloads.
I have installed the ocx and can view the cameras ok. I can send some commands but need to expose all the properties of the cox. eg on the web I can change the email address , trigger what happens when an alarm happens etc.
I have been playing around with the commands:
code:
unit Unit9;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, SHDocVw, XDVIEWLib_TLB;
type
TForm9 = class(TForm)
Button1: TButton;
XDView1: TXDView;
Button2: TButton;
XDView2: TXDView;
Edit1: TEdit;
Memo1: TMemo;
Button3: TButton;
Button4: TButton;
procedure Button1Click(Sender: TObject);
procedure XDView1Alarms(ASender: TObject; nAlarms: Integer);
procedure XDView2Alarms(ASender: TObject; nAlarms: Integer);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure XDView2LBtnDblClk(Sender: TObject);
procedure XDView2RButtonDown(Sender: TObject);
procedure XDView2SelectedWindow(ASender: TObject; nWindow: Smallint);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form9: TForm9;
implementation
{$R *.dfm}
procedure TForm9.Button1Click(Sender: TObject);
begin
// webbrowser1.Navigate('rtsp://192.168.0.161:551');
// xdview1.URL := '192.168.0.161';
// XDView1.Port := 5001;
// XDView1.UserName := 'admin'; //Name
// XDView1.UserPswd := 'admin'; //Password
// XDView1.ChannelNum := '0';
// XDView1.LoginNVS(); //Channel 4
// XDView1.StartView();
xdview2.URL := '80.5.54.130';
xdview2.Port := 5003;
xdview2.UserName := 'admin'; //Name
xdview2.UserPswd := 'admin'; //Password
xdview2.ChannelNum := '1';
xdview2.LoginNVS(); //Channel 4
xdview2.StartView();
end;
procedure TForm9.Button2Click(Sender: TObject);
begin
XDView2.SetAlarmRecTime(120);
XDView2.AlarmBox_Off();
end;
procedure TForm9.Button3Click(Sender: TObject);
begin
XDView1.SetCapPath('c:\anprimages');
showmessage(XDView2.GetCapPath());
end;
procedure TForm9.Button4Click(Sender: TObject);
begin
// XDView2.SetVideoSignal(0,250,250,130,130);
// XDView2.SetNVS(1); // shows controls
// XDView2.FullWnd_Off(); // does nothing
// XDView2.ChannelCapture(0); // (1) shows the path
// XDView2.StartRecord() // selected channel
// XDView2.SetAlarmRecTime(100);
// XDView2.Refresh;
// showmessage(inttostr(XDView2.GetAlarmRecTime));
// showmessage(inttostr(XDView2.GetAlarmPreRecTime));
// showmessage(inttostr(XDView2.GetBrightness(0)));
// showmessage(XDView2.GetLensConfig);
// XDView2.RtOpenPlayFile(1,'1','C:\anprimages\2011-04-22\General\RearIn\1\17_51_45.MP6');
// XDView2.RtOpenPlayFile(1,'',''); //not working
// XDView2.RtPlay(1);
// XDView2.RtSearchFile(2,'RearIn','192.168.0.163',5003,'admin','admin',0,0,'2011-04-22','01:00','23:00'); // not working
showmessage(XDView2.GetVersion);
end;
procedure TForm9.XDView1Alarms(ASender: TObject; nAlarms: Integer);
begin
XDView1.Tips_On();
XDView1.AlarmBox_On();
edit1.text := 'alarmed workshop';
end;
procedure TForm9.XDView2Alarms(ASender: TObject; nAlarms: Integer);
begin
memo1.Lines.Add(inttostr(XDView2.GetAlarm)) ;
// showmessage(inttostr(XDView2.GetAlarm));
// XDView2.Tips_On();
// edit1.text := 'alarmed ouside';
end;
procedure TForm9.XDView2LBtnDblClk(Sender: TObject);
begin
showmessage('left d click');
end;
procedure TForm9.XDView2RButtonDown(Sender: TObject);
begin
showmessage('right down');
end;
procedure TForm9.XDView2SelectedWindow(ASender: TObject; nWindow: Smallint);
begin
// showmessage(nAlarmInfo);
end;
end.
When I use XDView2.SetNVS(1) I get a new window where I can set all the properties. I have no idea how to get at these ( I would have thought there would be a .pas file somewhere).
The cox file is as follows:
unit XDVIEWLib_TLB;
// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //
// $Rev: 8291 $
// File generated on 22/04/2011 14:12:46 from Type Library described below.
// ************************************************************************ //
// Type Lib: C:\Windows\System32\XDView.ocx (1)
// LIBID: {E8842BAB-5332-4480-9787-07B11D88B321}
// LCID: 0
// Helpfile: C:\Windows\System32\XDView.hlp
// HelpString: XDView ActiveX Control module
// DepndLst:
// (1) v2.0 stdole, (C:\Windows\system32\stdole2.tlb)
// ************************************************************************ //
// *************************************************************************//
// NOTE:
// Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties
// which return objects that may need to be explicitly created via a function
// call prior to any access via the property. These items have been disabled
// in order to prevent accidental use from within the object inspector. You
// may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively
// removing them from the $IFDEF blocks. However, such items must still be
// programmatically created via a method of the appropriate CoClass before
// they can be used.
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interface
uses Windows, ActiveX, Classes, Graphics, OleCtrls, OleServer, StdVCL, Variants;
// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:
// Type Libraries : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Non-DISP interfaces: IID_xxxx
// *********************************************************************//
const
// TypeLibrary Major and minor versions
XDVIEWLibMajorVersion = 1;
XDVIEWLibMinorVersion = 0;
LIBID_XDVIEWLib: TGUID = '{E8842BAB-5332-4480-9787-07B11D88B321}';
DIID__DXDView: TGUID = '{5E0D7C46-F463-42AC-A10A-2A5252377681}';
DIID__DXDViewEvents: TGUID = '{B1839AF1-E776-45DC-B060-B91A639C81D6}';
CLASS_XDView: TGUID = '{08353A15-031B-4FE1-9BF5-5B4F721BA61A}';
type
// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
_DXDView = dispinterface;
_DXDViewEvents = dispinterface;
// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
XDView = _DXDView;
// *********************************************************************//
// DispIntf: _DXDView
// Flags: (4112) Hidden Dispatchable
// GUID: {5E0D7C46-F463-42AC-A10A-2A5252377681}
// *********************************************************************//
_DXDView = dispinterface
['{5E0D7C46-F463-42AC-A10A-2A5252377681}']
function OnListen_Off: WordBool; dispid 20;
procedure SetNVS(bEnableLocalSetting: Smallint); dispid 39;
function StartRecord: WordBool; dispid 22;
function StartView: WordBool; dispid 21;
function ClearNvsAlarm: WordBool; dispid 40;
function OutputCtrl_Off: WordBool; dispid 43;
function OnTalkback_Off: WordBool; dispid 38;
function OnTalkback_On: WordBool; dispid 37;
procedure Audio_Off; dispid 28;
procedure Audio_On; dispid 27;
procedure AlarmBox_Off; dispid 26;
procedure Tips_On; dispid 29;
function LoginNVS: Smallint; dispid 16;
function OnListen_On: WordBool; dispid 19;
function OnListen: WordBool; dispid 18;
procedure LogoutNVS; dispid 17;
function GetLensConfig: WideString; dispid 125;
procedure SetLoginMode(nMode: Smallint); dispid 126;
function OnChannelRecord: WordBool; dispid 34;
function Seek(nSecond: Integer): Integer; dispid 75;
function ScheduleRestart(nOpen: Smallint; nMode: Smallint; nHour: Smallint; nMin: Smallint;
nSec: Smallint): Integer; dispid 129;
function SetDisplayWnd(nPort: Integer; nFirstScreenWidth: Integer): Integer; dispid 130;
function AGCCtrl(bOpen: Smallint): WordBool; dispid 123;
function BLCCtrl(bOpen: Smallint): WordBool; dispid 124;
procedure FullWnd_Off; dispid 32;
procedure FullWnd_On; dispid 31;
function OutputCtrl_On: WordBool; dispid 42;
function OutputCtrl: WordBool; dispid 41;
function OnTalkback: WordBool; dispid 36;
procedure PlayRecord; dispid 35;
procedure Tips_Off; dispid 30;
function OnChannelView: WordBool; dispid 33;
function ChannelCapture(bPump: Smallint): WordBool; dispid 48;
procedure SetDecPriority(bDecPriority: Smallint); dispid 51;
function SetCapPath(const lpPath: WideString): WordBool; dispid 46;
function GetAlarm: Integer; dispid 45;
function FrameFast: Integer; dispid 70;
function Back: Integer; dispid 69;
procedure SetDeInterlace(bDeInterlace: Smallint); dispid 50;
function CaptureChannel(nCh: Smallint): WideString; dispid 49;
function GetDecPriority: WordBool; dispid 52;
function GetRecPath: WideString; dispid 57;
function GetCapPath: WideString; dispid 56;
function GetDeInterlace: WordBool; dispid 53;
procedure SetVideoSignal(nCh: Integer; brightness: Integer; chroma: Integer; contrast: Integer;
saturation: Integer); dispid 58;
function SetRecPath(const lpPath: WideString): WordBool; dispid 47;
function GetChroma(nCh: Smallint): Integer; dispid 60;
function GetBrightness(nCh: Smallint): Integer; dispid 59;
function Stop: Integer; dispid 66;
function Play: Integer; dispid 65;
function OpenFile(const lpFileName: WideString): Integer; dispid 64;
function Pause: Integer; dispid 67;
function StopView: WordBool; dispid 24;
function StopRecord: WordBool; dispid 23;
procedure ControlPTZ; dispid 44;
procedure AlarmBox_On; dispid 25;
function SetAudio(bAudio: Smallint): Integer; dispid 74;
function LoopPlay(bLoop: Smallint): Integer; dispid 73;
function Fast: Integer; dispid 68;
function FrameBack: Integer; dispid 71;
function GetSaturation(nCh: Smallint): Integer; dispid 62;
function GetContrast(nCh: Smallint): Integer; dispid 61;
function Resume: Integer; dispid 72;
function SearchFile(const date: WideString; const begtime: WideString;
const endtime: WideString; channo: Smallint): WordBool; dispid 63;
function GetVersion: WideString; dispid 127;
procedure CheckRelay(bCheck: Smallint); dispid 84;
procedure SetNetMode(nMode: Smallint); dispid 85;
function FileCapture(bPump: Smallint): WordBool; dispid 76;
procedure SetRecPackTime(nTime: Integer); dispid 77;
function RtOpenPlayFile(nWindow: Smallint; const szChannel: WideString;
const szFileName: WideString): Integer; dispid 95;
function CheckRecordFun: WordBool; dispid 107;
procedure SetRunMode(nRunMode: Smallint); dispid 82;
procedure StartRemotePlayer; dispid 83;
procedure RtStopSearchFile; dispid 94;
procedure SetAlarmPreRecTime(nSecond: Integer); dispid 91;
procedure ControlImageSize(bOpen: Smallint); dispid 88;
function RtSearchFile(nFrom: Smallint; const szNVSName: WideString; const szURL: WideString;
nSvrPort: Integer; const szUserName: WideString;
const szUserPwd: WideString; nRecType: Smallint; nChannel: Smallint;
const szDate: WideString; const szBeginTime: WideString;
const szEndTime: WideString): WordBool; dispid 93;
function GetRecPackTime: Integer; dispid 78;
procedure CheckDDNS(bCheck: Smallint); dispid 81;
function GetAlarmPreRecTime: Integer; dispid 92;
procedure Release; dispid 86;
function RtPlay(nChannel: Smallint): Integer; dispid 96;
function RtStopPlay(nChannel: Smallint): Integer; dispid 97;
function RtPause(nChannel: Smallint): Integer; dispid 98;
function RtFast(nChannel: Smallint): Integer; dispid 99;
function RtFrame(nChannel: Smallint): Integer; dispid 100;
function RtSetAudio(nChannel: Smallint; bAudio: Smallint): Integer; dispid 101;
function RtCapture(nChannel: Smallint; bPump: Smallint): WordBool; dispid 102;
function RtDownloadFile(const szChannel: WideString; const szFileName: WideString): Integer; dispid 103;
function GetChannelCount: Smallint; dispid 106;
function RtLoop(nWindow: Smallint; bLoop: Smallint): Integer; dispid 111;
procedure RtShowDonwloadInfo(bShow: Smallint); dispid 108;
procedure SetImageHighQulity(nHight: Smallint); dispid 105;
function RtFastBack(nWindow: Smallint): Integer; dispid 110;
procedure ReStopDownload(nID: Integer); dispid 144;
function RtResume(nWindow: Smallint): Integer; dispid 112;
procedure RtInitPlayer; dispid 109;
function GetConfigStr(const lpAppName: WideString; const lpKeyName: WideString; nSize: Integer;
const lpFileName: WideString): WideString; dispid 131;
procedure ImageZoomIn(bOpen: Smallint); dispid 143;
procedure HideSelLine; dispid 118;
procedure AutoIrisLevel(nAddOrSub: Smallint); dispid 119;
function DownloadPTZProtocol(nType: Smallint; const szFileName: WideString): Integer; dispid 142;
function SetStudentInfo(const userData: WideString; nDataLen: Integer): Integer; dispid 148;
function ChannelCaptureReturnpath(bPump: Integer): WideString; dispid 145;
function GetStreamType: Smallint; dispid 141;
procedure SetRecFileName(const szFileName: WideString); dispid 116;
function RtOpenFile(nWindow: Smallint; const szFileName: WideString; const szURL: WideString;
nSvrPort: Integer; const szUserName: WideString; const szUserPwd: WideString): Integer; dispid 117;
function SetDisplayGUID(const pGuid: WideString): Integer; dispid 128;
function AWBCtrl(bOpen: Smallint): WordBool; dispid 122;
function AutoIris(bAdd: Smallint): WordBool; dispid 120;
function luminationCtrl(bAuto: Smallint): WordBool; dispid 121;
procedure RtSetWindow(nWndAmount: Smallint); dispid 114;
function RtFrameBack(nWindow: Smallint): Integer; dispid 115;
function SendCommData(COMMNo: Smallint; Baudrate: Integer; CheckType: Smallint;
Databit: Smallint; Flowctrl: Smallint; Stopbit: Smallint;
DataLen: Smallint): Integer; dispid 136;
procedure SetCommData(Data: Smallint; DataPos: Smallint); dispid 137;
function SetArea(nChannel: Smallint; nArea: Smallint; nLeft: Integer; nTop: Integer;
nWidth: Integer; nHeight: Integer): Integer; dispid 138;
function GetArea(nChannel: Smallint): Integer; dispid 139;
function GetAlarmRecTime: Integer; dispid 90;
procedure RefreshCtrl; dispid 87;
function RtSeek(nWindow: Smallint; nToSecond: Integer): Integer; dispid 113;
procedure SetAlarmRecTime(nSecond: Integer); dispid 89;
function GetStudentInfo: WideString; dispid 147;
procedure SetCodeStream(nStreamType: Smallint); dispid 140;
procedure AboutBox; dispid -552;
procedure ImageZoomInShowHide(bShow: Integer); dispid 146;
function SetConfigStr(const lpAppName: WideString; const lpKeyName: WideString;
const lpStrValue: WideString; const lpFileName: WideString): Integer; dispid 132;
function ExecuteProgram(const szProgram: WideString): Integer; dispid 133;
function FullScreen: Integer; dispid 134;
function RtFullScreen: Integer; dispid 135;
property VcRunMode: Smallint dispid 15;
property VcLoginMode: Smallint dispid 14;
property NvsName: WideString dispid 12;
property ChannelNum: WideString dispid 11;
property CommPort: Smallint dispid 10;
property PTZParam: Smallint dispid 9;
property PTZCmd: Smallint dispid 8;
property OutCtrlPort: Smallint dispid 7;
property English: Smallint dispid 6;
property SocketProtocol: Smallint dispid 5;
property Port: Integer dispid 4;
property UserPswd: WideString dispid 3;
property UserName: WideString dispid 2;
property URL: WideString dispid 1;
end;
// *********************************************************************//
// DispIntf: _DXDViewEvents
// Flags: (4096) Dispatchable
// GUID: {B1839AF1-E776-45DC-B060-B91A639C81D6}
// *********************************************************************//
_DXDViewEvents = dispinterface
['{B1839AF1-E776-45DC-B060-B91A639C81D6}']
procedure OnPlayProgress(nTime: Integer); dispid 1;
procedure SearchRet(const URL: WideString; const date: WideString; const time: WideString;
length: Integer; const fname: WideString; channo: Smallint); dispid 2;
procedure OnAlarms(nAlarms: Integer); dispid 3;
procedure UpdateKernelProgress(nPer: Smallint); dispid 4;
procedure UpdateSavePercent(nPer: Smallint); dispid 5;
procedure UpdateSendPercent(nPer: Smallint); dispid 6;
procedure OnLogoutDVS; dispid 7;
procedure OnGetCurrentChRecStatus(nStatus: Smallint); dispid 8;
procedure OnSelected; dispid 9;
procedure OnLBtnDblClk; dispid 10;
procedure OnHotKey(nKey: Integer); dispid 11;
procedure OnAlarmRecordStatus(nCh: Smallint; nStatus: Smallint); dispid 12;
procedure RtOnSearchResult(const szChannel: WideString; const szFileName: WideString); dispid 13;
procedure RtOnPlayProgress(nWindow: Smallint; nTotalTime: Integer; nUseTime: Integer); dispid 14;
procedure RtOnDownload(nID: Integer; const szChannel: WideString; const szFileName: WideString;
nFileSize: Integer; nDownSize: Integer; nSpeed: Integer;
nStatus: Smallint; const szPath: WideString); dispid 15;
procedure OnSelectedWindow(nWindow: Smallint); dispid 16;
procedure RtOnFinishDownload(nID: Integer; const szFile: WideString); dispid 17;
procedure RtOnRefreshWndStatus(nWindows: Smallint; nFlag: Smallint); dispid 18;
procedure RtOnSearchEnd; dispid 19;
procedure OnSaveRecFile(const szRecFile: WideString); dispid 20;
procedure OnLoginNVSResult(nResult: Integer); dispid 21;
procedure RtOnNetOpenFile(nResult: Integer); dispid 22;
procedure RtOnSetButtonsStatus(nPLAY: Integer; nPAUSE: Integer; nSTOP: Integer; nBACK: Integer;
nFORWARD: Integer; nSTEPBACK: Integer; nSTEPIN: Integer;
nAUDIO: Integer; nLOOP: Integer; nCAPTURE: Integer); dispid 23;
procedure OnGetArea(nChannel: Smallint; nAreaCount: Smallint; nArea: Smallint; nLeft: Integer;
nTop: Integer; nWidth: Integer; nHeight: Integer); dispid 24;
procedure OnSaveCapFile(const szFileName: WideString); dispid 25;
procedure OnViewChannelTotal(nChTotal: Smallint); dispid 26;
procedure OnRButtonDown; dispid 27;
procedure OnMouseMove; dispid 28;
procedure OnLButtonDown; dispid 29;
procedure OnLButtonUp; dispid 30;
procedure RtOnSearchResultEx(const szChannel: WideString; const szFileName: WideString); dispid 31;
end;
// *********************************************************************//
// OLE Control Proxy class declaration
// Control Name : TXDView
// Help String : XDView Control
// Default Interface: _DXDView
// Def. Intf. DISP? : Yes
// Event Interface: _DXDViewEvents
// TypeFlags : (34) CanCreate Control
// *********************************************************************//
TXDViewOnPlayProgress = procedure(ASender: TObject; nTime: Integer) of object;
TXDViewSearchRet = procedure(ASender: TObject; const URL: WideString; const date: WideString;
const time: WideString; length: Integer;
const fname: WideString; channo: Smallint) of object;
TXDViewOnAlarms = procedure(ASender: TObject; nAlarms: Integer) of object;
TXDViewUpdateKernelProgress = procedure(ASender: TObject; nPer: Smallint) of object;
TXDViewUpdateSavePercent = procedure(ASender: TObject; nPer: Smallint) of object;
TXDViewUpdateSendPercent = procedure(ASender: TObject; nPer: Smallint) of object;
TXDViewOnGetCurrentChRecStatus = procedure(ASender: TObject; nStatus: Smallint) of object;
TXDViewOnHotKey = procedure(ASender: TObject; nKey: Integer) of object;
TXDViewOnAlarmRecordStatus = procedure(ASender: TObject; nCh: Smallint; nStatus: Smallint) of object;
TXDViewRtOnSearchResult = procedure(ASender: TObject; const szChannel: WideString;
const szFileName: WideString) of object;
TXDViewRtOnPlayProgress = procedure(ASender: TObject; nWindow: Smallint; nTotalTime: Integer;
nUseTime: Integer) of object;
TXDViewRtOnDownload = procedure(ASender: TObject; nID: Integer; const szChannel: WideString;
const szFileName: WideString;
nFileSize: Integer; nDownSize: Integer;
nSpeed: Integer; nStatus: Smallint;
const szPath: WideString) of object;
TXDViewOnSelectedWindow = procedure(ASender: TObject; nWindow: Smallint) of object;
TXDViewRtOnFinishDownload = procedure(ASender: TObject; nID: Integer; const szFile: WideString) of object;
TXDViewRtOnRefreshWndStatus = procedure(ASender: TObject; nWindows: Smallint; nFlag: Smallint) of object;
TXDViewOnSaveRecFile = procedure(ASender: TObject; const szRecFile: WideString) of object;
TXDViewOnLoginNVSResult = procedure(ASender: TObject; nResult: Integer) of object;
TXDViewRtOnNetOpenFile = procedure(ASender: TObject; nResult: Integer) of object;
TXDViewRtOnSetButtonsStatus = procedure(ASender: TObject; nPLAY: Integer; nPAUSE: Integer;
nSTOP: Integer; nBACK: Integer;
nFORWARD: Integer; nSTEPBACK: Integer;
nSTEPIN: Integer; nAUDIO: Integer;
nLOOP: Integer; nCAPTURE: Integer) of object;
TXDViewOnGetArea = procedure(ASender: TObject; nChannel: Smallint; nAreaCount: Smallint;
nArea: Smallint; nLeft: Integer; nTop: Integer;
nWidth: Integer; nHeight: Integer) of object;
TXDViewOnSaveCapFile = procedure(ASender: TObject; const szFileName: WideString) of object;
TXDViewOnViewChannelTotal = procedure(ASender: TObject; nChTotal: Smallint) of object;
TXDViewRtOnSearchResultEx = procedure(ASender: TObject; const szChannel: WideString;
const szFileName: WideString) of object;
TXDView = class(TOleControl)
private
FOnPlayProgress: TXDViewOnPlayProgress;
FOnSearchRet: TXDViewSearchRet;
FOnAlarms: TXDViewOnAlarms;
FOnUpdateKernelProgress: TXDViewUpdateKernelProgress;
FOnUpdateSavePercent: TXDViewUpdateSavePercent;
FOnUpdateSendPercent: TXDViewUpdateSendPercent;
FOnLogoutDVS: TNotifyEvent;
FOnGetCurrentChRecStatus: TXDViewOnGetCurrentChRecStatus;
FOnSelected: TNotifyEvent;
FOnLBtnDblClk: TNotifyEvent;
FOnHotKey: TXDViewOnHotKey;
FOnAlarmRecordStatus: TXDViewOnAlarmRecordStatus;
FOnRtOnSearchResult: TXDViewRtOnSearchResult;
FOnRtOnPlayProgress: TXDViewRtOnPlayProgress;
FOnRtOnDownload: TXDViewRtOnDownload;
FOnSelectedWindow: TXDViewOnSelectedWindow;
FOnRtOnFinishDownload: TXDViewRtOnFinishDownload;
FOnRtOnRefreshWndStatus: TXDViewRtOnRefreshWndStatus;
FOnRtOnSearchEnd: TNotifyEvent;
FOnSaveRecFile: TXDViewOnSaveRecFile;
FOnLoginNVSResult: TXDViewOnLoginNVSResult;
FOnRtOnNetOpenFile: TXDViewRtOnNetOpenFile;
FOnRtOnSetButtonsStatus: TXDViewRtOnSetButtonsStatus;
FOnGetArea: TXDViewOnGetArea;
FOnSaveCapFile: TXDViewOnSaveCapFile;
FOnViewChannelTotal: TXDViewOnViewChannelTotal;
FOnRButtonDown: TNotifyEvent;
FOnMouseMove: TNotifyEvent;
FOnLButtonDown: TNotifyEvent;
FOnLButtonUp: TNotifyEvent;
FOnRtOnSearchResultEx: TXDViewRtOnSearchResultEx;
FIntf: _DXDView;
function GetControlInterface: _DXDView;
protected
procedure CreateControl;
procedure InitControlData; override;
public
function OnListen_Off: WordBool;
procedure SetNVS(bEnableLocalSetting: Smallint);
function StartRecord: WordBool;
function StartView: WordBool;
function ClearNvsAlarm: WordBool;
function OutputCtrl_Off: WordBool;
function OnTalkback_Off: WordBool;
function OnTalkback_On: WordBool;
procedure Audio_Off;
procedure Audio_On;
procedure AlarmBox_Off;
procedure Tips_On;
function LoginNVS: Smallint;
function OnListen_On: WordBool;
function OnListen: WordBool;
procedure LogoutNVS;
function GetLensConfig: WideString;
procedure SetLoginMode(nMode: Smallint);
function OnChannelRecord: WordBool;
function Seek(nSecond: Integer): Integer;
function ScheduleRestart(nOpen: Smallint; nMode: Smallint; nHour: Smallint; nMin: Smallint;
nSec: Smallint): Integer;
function SetDisplayWnd(nPort: Integer; nFirstScreenWidth: Integer): Integer;
function AGCCtrl(bOpen: Smallint): WordBool;
function BLCCtrl(bOpen: Smallint): WordBool;
procedure FullWnd_Off;
procedure FullWnd_On;
function OutputCtrl_On: WordBool;
function OutputCtrl: WordBool;
function OnTalkback: WordBool;
procedure PlayRecord;
procedure Tips_Off;
function OnChannelView: WordBool;
function ChannelCapture(bPump: Smallint): WordBool;
procedure SetDecPriority(bDecPriority: Smallint);
function SetCapPath(const lpPath: WideString): WordBool;
function GetAlarm: Integer;
function FrameFast: Integer;
function Back: Integer;
procedure SetDeInterlace(bDeInterlace: Smallint);
function CaptureChannel(nCh: Smallint): WideString;
function GetDecPriority: WordBool;
function GetRecPath: WideString;
function GetCapPath: WideString;
function GetDeInterlace: WordBool;
procedure SetVideoSignal(nCh: Integer; brightness: Integer; chroma: Integer; contrast: Integer;
saturation: Integer);
function SetRecPath(const lpPath: WideString): WordBool;
function GetChroma(nCh: Smallint): Integer;
function GetBrightness(nCh: Smallint): Integer;
function Stop: Integer;
function Play: Integer;
function OpenFile(const lpFileName: WideString): Integer;
function Pause: Integer;
function StopView: WordBool;
function StopRecord: WordBool;
procedure ControlPTZ;
procedure AlarmBox_On;
function SetAudio(bAudio: Smallint): Integer;
function LoopPlay(bLoop: Smallint): Integer;
function Fast: Integer;
function FrameBack: Integer;
function GetSaturation(nCh: Smallint): Integer;
function GetContrast(nCh: Smallint): Integer;
function Resume: Integer;
function SearchFile(const date: WideString; const begtime: WideString;
const endtime: WideString; channo: Smallint): WordBool;
function GetVersion: WideString;
procedure CheckRelay(bCheck: Smallint);
procedure SetNetMode(nMode: Smallint);
function FileCapture(bPump: Smallint): WordBool;
procedure SetRecPackTime(nTime: Integer);
function RtOpenPlayFile(nWindow: Smallint; const szChannel: WideString;
const szFileName: WideString): Integer;
function CheckRecordFun: WordBool;
procedure SetRunMode(nRunMode: Smallint);
procedure StartRemotePlayer;
procedure RtStopSearchFile;
procedure SetAlarmPreRecTime(nSecond: Integer);
procedure ControlImageSize(bOpen: Smallint);
function RtSearchFile(nFrom: Smallint; const szNVSName: WideString; const szURL: WideString;
nSvrPort: Integer; const szUserName: WideString;
const szUserPwd: WideString; nRecType: Smallint; nChannel: Smallint;
const szDate: WideString; const szBeginTime: WideString;
const szEndTime: WideString): WordBool;
function GetRecPackTime: Integer;
procedure CheckDDNS(bCheck: Smallint);
function GetAlarmPreRecTime: Integer;
procedure Release;
function RtPlay(nChannel: Smallint): Integer;
function RtStopPlay(nChannel: Smallint): Integer;
function RtPause(nChannel: Smallint): Integer;
function RtFast(nChannel: Smallint): Integer;
function RtFrame(nChannel: Smallint): Integer;
function RtSetAudio(nChannel: Smallint; bAudio: Smallint): Integer;
function RtCapture(nChannel: Smallint; bPump: Smallint): WordBool;
function RtDownloadFile(const szChannel: WideString; const szFileName: WideString): Integer;
function GetChannelCount: Smallint;
function RtLoop(nWindow: Smallint; bLoop: Smallint): Integer;
procedure RtShowDonwloadInfo(bShow: Smallint);
procedure SetImageHighQulity(nHight: Smallint);
function RtFastBack(nWindow: Smallint): Integer;
procedure ReStopDownload(nID: Integer);
function RtResume(nWindow: Smallint): Integer;
procedure RtInitPlayer;
function GetConfigStr(const lpAppName: WideString; const lpKeyName: WideString; nSize: Integer;
const lpFileName: WideString): WideString;
procedure ImageZoomIn(bOpen: Smallint);
procedure HideSelLine;
procedure AutoIrisLevel(nAddOrSub: Smallint);
function DownloadPTZProtocol(nType: Smallint; const szFileName: WideString): Integer;
function SetStudentInfo(const userData: WideString; nDataLen: Integer): Integer;
function ChannelCaptureReturnpath(bPump: Integer): WideString;
function GetStreamType: Smallint;
procedure SetRecFileName(const szFileName: WideString);
function RtOpenFile(nWindow: Smallint; const szFileName: WideString; const szURL: WideString;
nSvrPort: Integer; const szUserName: WideString; const szUserPwd: WideString): Integer;
function SetDisplayGUID(const pGuid: WideString): Integer;
function AWBCtrl(bOpen: Smallint): WordBool;
function AutoIris(bAdd: Smallint): WordBool;
function luminationCtrl(bAuto: Smallint): WordBool;
procedure RtSetWindow(nWndAmount: Smallint);
function RtFrameBack(nWindow: Smallint): Integer;
function SendCommData(COMMNo: Smallint; Baudrate: Integer; CheckType: Smallint;
Databit: Smallint; Flowctrl: Smallint; Stopbit: Smallint;
DataLen: Smallint): Integer;
procedure SetCommData(Data: Smallint; DataPos: Smallint);
function SetArea(nChannel: Smallint; nArea: Smallint; nLeft: Integer; nTop: Integer;
nWidth: Integer; nHeight: Integer): Integer;
function GetArea(nChannel: Smallint): Integer;
function GetAlarmRecTime: Integer;
procedure RefreshCtrl;
function RtSeek(nWindow: Smallint; nToSecond: Integer): Integer;
procedure SetAlarmRecTime(nSecond: Integer);
function GetStudentInfo: WideString;
procedure SetCodeStream(nStreamType: Smallint);
procedure AboutBox;
procedure ImageZoomInShowHide(bShow: Integer);
function SetConfigStr(const lpAppName: WideString; const lpKeyName: WideString;
const lpStrValue: WideString; const lpFileName: WideString): Integer;
function ExecuteProgram(const szProgram: WideString): Integer;
function FullScreen: Integer;
function RtFullScreen: Integer;
property ControlInterface: _DXDView read GetControlInterface;
property DefaultInterface: _DXDView read GetControlInterface;
published
property Anchors;
property TabStop;
property Align;
property DragCursor;
property DragMode;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property Visible;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnStartDrag;
property VcRunMode: Smallint index 15 read GetSmallintProp write SetSmallintProp stored False;
property VcLoginMode: Smallint index 14 read GetSmallintProp write SetSmallintProp stored False;
property NvsName: WideString index 12 read GetWideStringProp write SetWideStringProp stored False;
property ChannelNum: WideString index 11 read GetWideStringProp write SetWideStringProp stored False;
property CommPort: Smallint index 10 read GetSmallintProp write SetSmallintProp stored False;
property PTZParam: Smallint index 9 read GetSmallintProp write SetSmallintProp stored False;
property PTZCmd: Smallint index 8 read GetSmallintProp write SetSmallintProp stored False;
property OutCtrlPort: Smallint index 7 read GetSmallintProp write SetSmallintProp stored False;
property English: Smallint index 6 read GetSmallintProp write SetSmallintProp stored False;
property SocketProtocol: Smallint index 5 read GetSmallintProp write SetSmallintProp stored False;
property Port: Integer index 4 read GetIntegerProp write SetIntegerProp stored False;
property UserPswd: WideString index 3 read GetWideStringProp write SetWideStringProp stored False;
property UserName: WideString index 2 read GetWideStringProp write SetWideStringProp stored False;
property URL: WideString index 1 read GetWideStringProp write SetWideStringProp stored False;
property OnPlayProgress: TXDViewOnPlayProgress read FOnPlayProgress write FOnPlayProgress;
property OnSearchRet: TXDViewSearchRet read FOnSearchRet write FOnSearchRet;
property OnAlarms: TXDViewOnAlarms read FOnAlarms write FOnAlarms;
property OnUpdateKernelProgress: TXDViewUpdateKernelProgress read FOnUpdateKernelProgress write FOnUpdateKernelProgress;
property OnUpdateSavePercent: TXDViewUpdateSavePercent read FOnUpdateSavePercent write FOnUpdateSavePercent;
property OnUpdateSendPercent: TXDViewUpdateSendPercent read FOnUpdateSendPercent write FOnUpdateSendPercent;
property OnLogoutDVS: TNotifyEvent read FOnLogoutDVS write FOnLogoutDVS;
property OnGetCurrentChRecStatus: TXDViewOnGetCurrentChRecStatus read FOnGetCurrentChRecStatus write FOnGetCurrentChRecStatus;
property OnSelected: TNotifyEvent read FOnSelected write FOnSelected;
property OnLBtnDblClk: TNotifyEvent read FOnLBtnDblClk write FOnLBtnDblClk;
property OnHotKey: TXDViewOnHotKey read FOnHotKey write FOnHotKey;
property OnAlarmRecordStatus: TXDViewOnAlarmRecordStatus read FOnAlarmRecordStatus write FOnAlarmRecordStatus;
property OnRtOnSearchResult: TXDViewRtOnSearchResult read FOnRtOnSearchResult write FOnRtOnSearchResult;
property OnRtOnPlayProgress: TXDViewRtOnPlayProgress read FOnRtOnPlayProgress write FOnRtOnPlayProgress;
property OnRtOnDownload: TXDViewRtOnDownload read FOnRtOnDownload write FOnRtOnDownload;
property OnSelectedWindow: TXDViewOnSelectedWindow read FOnSelectedWindow write FOnSelectedWindow;
property OnRtOnFinishDownload: TXDViewRtOnFinishDownload read FOnRtOnFinishDownload write FOnRtOnFinishDownload;
property OnRtOnRefreshWndStatus: TXDViewRtOnRefreshWndStatus read FOnRtOnRefreshWndStatus write FOnRtOnRefreshWndStatus;
property OnRtOnSearchEnd: TNotifyEvent read FOnRtOnSearchEnd write FOnRtOnSearchEnd;
property OnSaveRecFile: TXDViewOnSaveRecFile read FOnSaveRecFile write FOnSaveRecFile;
property OnLoginNVSResult: TXDViewOnLoginNVSResult read FOnLoginNVSResult write FOnLoginNVSResult;
property OnRtOnNetOpenFile: TXDViewRtOnNetOpenFile read FOnRtOnNetOpenFile write FOnRtOnNetOpenFile;
property OnRtOnSetButtonsStatus: TXDViewRtOnSetButtonsStatus read FOnRtOnSetButtonsStatus write FOnRtOnSetButtonsStatus;
property OnGetArea: TXDViewOnGetArea read FOnGetArea write FOnGetArea;
property OnSaveCapFile: TXDViewOnSaveCapFile read FOnSaveCapFile write FOnSaveCapFile;
property OnViewChannelTotal: TXDViewOnViewChannelTotal read FOnViewChannelTotal write FOnViewChannelTotal;
property OnRButtonDown: TNotifyEvent read FOnRButtonDown write FOnRButtonDown;
property OnMouseMove: TNotifyEvent read FOnMouseMove write FOnMouseMove;
property OnLButtonDown: TNotifyEvent read FOnLButtonDown write FOnLButtonDown;
property OnLButtonUp: TNotifyEvent read FOnLButtonUp write FOnLButtonUp;
property OnRtOnSearchResultEx: TXDViewRtOnSearchResultEx read FOnRtOnSearchResultEx write FOnRtOnSearchResultEx;
end;
procedure Register;
resourcestring
dtlServerPage = 'ActiveX';
dtlOcxPage = 'ActiveX';
implementation
uses ComObj;
procedure TXDView.InitControlData;
const
CEventDispIDs: array [0..30] of DWORD = (
$00000001, $00000002, $00000003, $00000004, $00000005, $00000006,
$00000007, $00000008, $00000009, $0000000A, $0000000B, $0000000C,
$0000000D, $0000000E, $0000000F, $00000010, $00000011, $00000012,
$00000013, $00000014, $00000015, $00000016, $00000017, $00000018,
$00000019, $0000001A, $0000001B, $0000001C, $0000001D, $0000001E,
$0000001F);
CControlData: TControlData2 = (
ClassID: '{08353A15-031B-4FE1-9BF5-5B4F721BA61A}';
EventIID: '{B1839AF1-E776-45DC-B060-B91A639C81D6}';
EventCount: 31;
EventDispIDs: @CEventDispIDs;
LicenseKey: nil (*HR:$80004005*);
Flags: $00000000;
Version: 401);
begin
ControlData := @CControlData;
TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnPlayProgress) - Cardinal(Self);
end;
procedure TXDView.CreateControl;
procedure DoCreate;
begin
FIntf := IUnknown(OleObject) as _DXDView;
end;
begin
if FIntf = nil then DoCreate;
end;
function TXDView.GetControlInterface: _DXDView;
begin
CreateControl;
Result := FIntf;
end;
function TXDView.OnListen_Off: WordBool;
begin
Result := DefaultInterface.OnListen_Off;
end;
procedure TXDView.SetNVS(bEnableLocalSetting: Smallint);
begin
DefaultInterface.SetNVS(bEnableLocalSetting);
end;
function TXDView.StartRecord: WordBool;
begin
Result := DefaultInterface.StartRecord;
end;
function TXDView.StartView: WordBool;
begin
Result := DefaultInterface.StartView;
end;
function TXDView.ClearNvsAlarm: WordBool;
begin
Result := DefaultInterface.ClearNvsAlarm;
end;
function TXDView.OutputCtrl_Off: WordBool;
begin
Result := DefaultInterface.OutputCtrl_Off;
end;
function TXDView.OnTalkback_Off: WordBool;
begin
Result := DefaultInterface.OnTalkback_Off;
end;
function TXDView.OnTalkback_On: WordBool;
begin
Result := DefaultInterface.OnTalkback_On;
end;
procedure TXDView.Audio_Off;
begin
DefaultInterface.Audio_Off;
end;
procedure TXDView.Audio_On;
begin
DefaultInterface.Audio_On;
end;
procedure TXDView.AlarmBox_Off;
begin
DefaultInterface.AlarmBox_Off;
end;
procedure TXDView.Tips_On;
begin
DefaultInterface.Tips_On;
end;
function TXDView.LoginNVS: Smallint;
begin
Result := DefaultInterface.LoginNVS;
end;
function TXDView.OnListen_On: WordBool;
begin
Result := DefaultInterface.OnListen_On;
end;
function TXDView.OnListen: WordBool;
begin
Result := DefaultInterface.OnListen;
end;
procedure TXDView.LogoutNVS;
begin
DefaultInterface.LogoutNVS;
end;
function TXDView.GetLensConfig: WideString;
begin
Result := DefaultInterface.GetLensConfig;
end;
procedure TXDView.SetLoginMode(nMode: Smallint);
begin
DefaultInterface.SetLoginMode(nMode);
end;
function TXDView.OnChannelRecord: WordBool;
begin
Result := DefaultInterface.OnChannelRecord;
end;
function TXDView.Seek(nSecond: Integer): Integer;
begin
Result := DefaultInterface.Seek(nSecond);
end;
function TXDView.ScheduleRestart(nOpen: Smallint; nMode: Smallint; nHour: Smallint; nMin: Smallint;
nSec: Smallint): Integer;
begin
Result := DefaultInterface.ScheduleRestart(nOpen, nMode, nHour, nMin, nSec);
end;
function TXDView.SetDisplayWnd(nPort: Integer; nFirstScreenWidth: Integer): Integer;
begin
Result := DefaultInterface.SetDisplayWnd(nPort, nFirstScreenWidth);
end;
function TXDView.AGCCtrl(bOpen: Smallint): WordBool;
begin
Result := DefaultInterface.AGCCtrl(bOpen);
end;
function TXDView.BLCCtrl(bOpen: Smallint): WordBool;
begin
Result := DefaultInterface.BLCCtrl(bOpen);
end;
procedure TXDView.FullWnd_Off;
begin
DefaultInterface.FullWnd_Off;
end;
procedure TXDView.FullWnd_On;
begin
DefaultInterface.FullWnd_On;
end;
function TXDView.OutputCtrl_On: WordBool;
begin
Result := DefaultInterface.OutputCtrl_On;
end;
function TXDView.OutputCtrl: WordBool;
begin
Result := DefaultInterface.OutputCtrl;
end;
function TXDView.OnTalkback: WordBool;
begin
Result := DefaultInterface.OnTalkback;
end;
procedure TXDView.PlayRecord;
begin
DefaultInterface.PlayRecord;
end;
procedure TXDView.Tips_Off;
begin
DefaultInterface.Tips_Off;
end;
function TXDView.OnChannelView: WordBool;
begin
Result := DefaultInterface.OnChannelView;
end;
function TXDView.ChannelCapture(bPump: Smallint): WordBool;
begin
Result := DefaultInterface.ChannelCapture(bPump);
end;
procedure TXDView.SetDecPriority(bDecPriority: Smallint);
begin
DefaultInterface.SetDecPriority(bDecPriority);
end;
function TXDView.SetCapPath(const lpPath: WideString): WordBool;
begin
Result := DefaultInterface.SetCapPath(lpPath);
end;
function TXDView.GetAlarm: Integer;
begin
Result := DefaultInterface.GetAlarm;
end;
function TXDView.FrameFast: Integer;
begin
Result := DefaultInterface.FrameFast;
end;
function TXDView.Back: Integer;
begin
Result := DefaultInterface.Back;
end;
procedure TXDView.SetDeInterlace(bDeInterlace: Smallint);
begin
DefaultInterface.SetDeInterlace(bDeInterlace);
end;
function TXDView.CaptureChannel(nCh: Smallint): WideString;
begin
Result := DefaultInterface.CaptureChannel(nCh);
end;
function TXDView.GetDecPriority: WordBool;
begin
Result := DefaultInterface.GetDecPriority;
end;
function TXDView.GetRecPath: WideString;
begin
Result := DefaultInterface.GetRecPath;
end;
function TXDView.GetCapPath: WideString;
begin
Result := DefaultInterface.GetCapPath;
end;
function TXDView.GetDeInterlace: WordBool;
begin
Result := DefaultInterface.GetDeInterlace;
end;
procedure TXDView.SetVideoSignal(nCh: Integer; brightness: Integer; chroma: Integer;
contrast: Integer; saturation: Integer);
begin
DefaultInterface.SetVideoSignal(nCh, brightness, chroma, contrast, saturation);
end;
function TXDView.SetRecPath(const lpPath: WideString): WordBool;
begin
Result := DefaultInterface.SetRecPath(lpPath);
end;
function TXDView.GetChroma(nCh: Smallint): Integer;
begin
Result := DefaultInterface.GetChroma(nCh);
end;
function TXDView.GetBrightness(nCh: Smallint): Integer;
begin
Result := DefaultInterface.GetBrightness(nCh);
end;
function TXDView.Stop: Integer;
begin
Result := DefaultInterface.Stop;
end;
function TXDView.Play: Integer;
begin
Result := DefaultInterface.Play;
end;
function TXDView.OpenFile(const lpFileName: WideString): Integer;
begin
Result := DefaultInterface.OpenFile(lpFileName);
end;
function TXDView.Pause: Integer;
begin
Result := DefaultInterface.Pause;
end;
function TXDView.StopView: WordBool;
begin
Result := DefaultInterface.StopView;
end;
function TXDView.StopRecord: WordBool;
begin
Result := DefaultInterface.StopRecord;
end;
procedure TXDView.ControlPTZ;
begin
DefaultInterface.ControlPTZ;
end;
procedure TXDView.AlarmBox_On;
begin
DefaultInterface.AlarmBox_On;
end;
function TXDView.SetAudio(bAudio: Smallint): Integer;
begin
Result := DefaultInterface.SetAudio(bAudio);
end;
function TXDView.LoopPlay(bLoop: Smallint): Integer;
begin
Result := DefaultInterface.LoopPlay(bLoop);
end;
function TXDView.Fast: Integer;
begin
Result := DefaultInterface.Fast;
end;
function TXDView.FrameBack: Integer;
begin
Result := DefaultInterface.FrameBack;
end;
function TXDView.GetSaturation(nCh: Smallint): Integer;
begin
Result := DefaultInterface.GetSaturation(nCh);
end;
function TXDView.GetContrast(nCh: Smallint): Integer;
begin
Result := DefaultInterface.GetContrast(nCh);
end;
function TXDView.Resume: Integer;
begin
Result := DefaultInterface.Resume;
end;
function TXDView.SearchFile(const date: WideString; const begtime: WideString;
const endtime: WideString; channo: Smallint): WordBool;
begin
Result := DefaultInterface.SearchFile(date, begtime, endtime, channo);
end;
function TXDView.GetVersion: WideString;
begin
Result := DefaultInterface.GetVersion;
end;
procedure TXDView.CheckRelay(bCheck: Smallint);
begin
DefaultInterface.CheckRelay(bCheck);
end;
procedure TXDView.SetNetMode(nMode: Smallint);
begin
DefaultInterface.SetNetMode(nMode);
end;
function TXDView.FileCapture(bPump: Smallint): WordBool;
begin
Result := DefaultInterface.FileCapture(bPump);
end;
procedure TXDView.SetRecPackTime(nTime: Integer);
begin
DefaultInterface.SetRecPackTime(nTime);
end;
function TXDView.RtOpenPlayFile(nWindow: Smallint; const szChannel: WideString;
const szFileName: WideString): Integer;
begin
Result := DefaultInterface.RtOpenPlayFile(nWindow, szChannel, szFileName);
end;
function TXDView.CheckRecordFun: WordBool;
begin
Result := DefaultInterface.CheckRecordFun;
end;
procedure TXDView.SetRunMode(nRunMode: Smallint);
begin
DefaultInterface.SetRunMode(nRunMode);
end;
procedure TXDView.StartRemotePlayer;
begin
DefaultInterface.StartRemotePlayer;
end;
procedure TXDView.RtStopSearchFile;
begin
DefaultInterface.RtStopSearchFile;
end;
procedure TXDView.SetAlarmPreRecTime(nSecond: Integer);
begin
DefaultInterface.SetAlarmPreRecTime(nSecond);
end;
procedure TXDView.ControlImageSize(bOpen: Smallint);
begin
DefaultInterface.ControlImageSize(bOpen);
end;
function TXDView.RtSearchFile(nFrom: Smallint; const szNVSName: WideString;
const szURL: WideString; nSvrPort: Integer;
const szUserName: WideString; const szUserPwd: WideString;
nRecType: Smallint; nChannel: Smallint; const szDate: WideString;
const szBeginTime: WideString; const szEndTime: WideString): WordBool;
Result := DefaultInterface.RtSearchFile(nFrom, szNVSName, szURL, nSvrPort, szUserName, szUserPwd,
nRecType, nChannel, szDate, szBeginTime, szEndTime);
end;
function TXDView.GetRecPackTime: Integer;
begin
Result := DefaultInterface.GetRecPackTime;
end;
procedure TXDView.CheckDDNS(bCheck: Smallint);
begin
DefaultInterface.CheckDDNS(bCheck);
end;
function TXDView.GetAlarmPreRecTime: Integer;
begin
Result := DefaultInterface.GetAlarmPreRecTime;
end;
procedure TXDView.Release;
begin
DefaultInterface.Release;
end;
function TXDView.RtPlay(nChannel: Smallint): Integer;
begin
Result := DefaultInterface.RtPlay(nChannel);
end;
function TXDView.RtStopPlay(nChannel: Smallint): Integer;
begin
Result := DefaultInterface.RtStopPlay(nChannel);
end;
function TXDView.RtPause(nChannel: Smallint): Integer;
begin
Result := DefaultInterface.RtPause(nChannel);
end;
function TXDView.RtFast(nChannel: Smallint): Integer;
begin
Result := DefaultInterface.RtFast(nChannel);
end;
function TXDView.RtFrame(nChannel: Smallint): Integer;
begin
Result := DefaultInterface.RtFrame(nChannel);
end;
function TXDView.RtSetAudio(nChannel: Smallint; bAudio: Smallint): Integer;
begin
Result := DefaultInterface.RtSetAudio(nChannel, bAudio);
end;
function TXDView.RtCapture(nChannel: Smallint; bPump: Smallint): WordBool;
begin
Result := DefaultInterface.RtCapture(nChannel, bPump);
end;
function TXDView.RtDownloadFile(const szChannel: WideString; const szFileName: WideString): Integer;
begin
Result := DefaultInterface.RtDownloadFile(szChannel, szFileName);
end;
function TXDView.GetChannelCount: Smallint;
begin
Result := DefaultInterface.GetChannelCount;
end;
function TXDView.RtLoop(nWindow: Smallint; bLoop: Smallint): Integer;
begin
Result := DefaultInterface.RtLoop(nWindow, bLoop);
end;
procedure TXDView.RtShowDonwloadInfo(bShow: Smallint);
begin
DefaultInterface.RtShowDonwloadInfo(bShow);
end;
procedure TXDView.SetImageHighQulity(nHight: Smallint);
begin
DefaultInterface.SetImageHighQulity(nHight);
end;
function TXDView.RtFastBack(nWindow: Smallint): Integer;
begin
Result := DefaultInterface.RtFastBack(nWindow);
end;
procedure TXDView.ReStopDownload(nID: Integer);
begin
DefaultInterface.ReStopDownload(nID);
end;
function TXDView.RtResume(nWindow: Smallint): Integer;
begin
Result := DefaultInterface.RtResume(nWindow);
end;
procedure TXDView.RtInitPlayer;
begin
DefaultInterface.RtInitPlayer;
end;
function TXDView.GetConfigStr(const lpAppName: WideString; const lpKeyName: WideString;
nSize: Integer; const lpFileName: WideString): WideString;
Result := DefaultInterface.GetConfigStr(lpAppName, lpKeyName, nSize, lpFileName);
end;
procedure TXDView.ImageZoomIn(bOpen: Smallint);
begin
DefaultInterface.ImageZoomIn(bOpen);
end;
procedure TXDView.HideSelLine;
begin
DefaultInterface.HideSelLine;
end;
procedure TXDView.AutoIrisLevel(nAddOrSub: Smallint);
begin
DefaultInterface.AutoIrisLevel(nAddOrSub);
end;
function TXDView.DownloadPTZProtocol(nType: Smallint; const szFileName: WideString): Integer;
begin
Result := DefaultInterface.DownloadPTZProtocol(nType, szFileName);
end;
function TXDView.SetStudentInfo(const userData: WideString; nDataLen: Integer): Integer;
begin
Result := DefaultInterface.SetStudentInfo(userData, nDataLen);
end;
function TXDView.ChannelCaptureReturnpath(bPump: Integer): WideString;
begin
Result := DefaultInterface.ChannelCaptureReturnpath(bPump);
end;
function TXDView.GetStreamType: Smallint;
begin
Result := DefaultInterface.GetStreamType;
end;
procedure TXDView.SetRecFileName(const szFileName: WideString);
begin
DefaultInterface.SetRecFileName(szFileName);
end;
function TXDView.RtOpenFile(nWindow: Smallint; const szFileName: WideString;
const szURL: WideString; nSvrPort: Integer;
const szUserName: WideString; const szUserPwd: WideString): Integer;
Result := DefaultInterface.RtOpenFile(nWindow, szFileName, szURL, nSvrPort, szUserName, szUserPwd);
end;
function TXDView.SetDisplayGUID(const pGuid: WideString): Integer;
begin
Result := DefaultInterface.SetDisplayGUID(pGuid);
end;
function TXDView.AWBCtrl(bOpen: Smallint): WordBool;
begin
Result := DefaultInterface.AWBCtrl(bOpen);
end;
function TXDView.AutoIris(bAdd: Smallint): WordBool;
begin
Result := DefaultInterface.AutoIris(bAdd);
end;
function TXDView.luminationCtrl(bAuto: Smallint): WordBool;
begin
Result := DefaultInterface.luminationCtrl(bAuto);
end;
procedure TXDView.RtSetWindow(nWndAmount: Smallint);
begin
DefaultInterface.RtSetWindow(nWndAmount);
end;
function TXDView.RtFrameBack(nWindow: Smallint): Integer;
begin
Result := DefaultInterface.RtFrameBack(nWindow);
end;
function TXDView.SendCommData(COMMNo: Smallint; Baudrate: Integer; CheckType: Smallint;
Databit: Smallint; Flowctrl: Smallint; Stopbit: Smallint;
DataLen: Smallint): Integer;
begin
Result := DefaultInterface.SendCommData(COMMNo, Baudrate, CheckType, Databit, Flowctrl, Stopbit,
DataLen);
end;
procedure TXDView.SetCommData(Data: Smallint; DataPos: Smallint);
begin
DefaultInterface.SetCommData(Data, DataPos);
end;
function TXDView.SetArea(nChannel: Smallint; nArea: Smallint; nLeft: Integer; nTop: Integer;
nWidth: Integer; nHeight: Integer): Integer;
begin
Result := DefaultInterface.SetArea(nChannel, nArea, nLeft, nTop, nWidth, nHeight);
end;
function TXDView.GetArea(nChannel: Smallint): Integer;
begin
Result := DefaultInterface.GetArea(nChannel);
end;
function TXDView.GetAlarmRecTime: Integer;
begin
Result := DefaultInterface.GetAlarmRecTime;
end;
procedure TXDView.RefreshCtrl;
begin
DefaultInterface.RefreshCtrl;
end;
function TXDView.RtSeek(nWindow: Smallint; nToSecond: Integer): Integer;
begin
Result := DefaultInterface.RtSeek(nWindow, nToSecond);
end;
procedure TXDView.SetAlarmRecTime(nSecond: Integer);
begin
DefaultInterface.SetAlarmRecTime(nSecond);
end;
function TXDView.GetStudentInfo: WideString;
begin
Result := DefaultInterface.GetStudentInfo;
end;
procedure TXDView.SetCodeStream(nStreamType: Smallint);
begin
DefaultInterface.SetCodeStream(nStreamType);
end;
procedure TXDView.AboutBox;
begin
DefaultInterface.AboutBox;
end;
procedure TXDView.ImageZoomInShowHide(bShow: Integer);
begin
DefaultInterface.ImageZoomInShowHide(bShow);
end;
function TXDView.SetConfigStr(const lpAppName: WideString; const lpKeyName: WideString;
const lpStrValue: WideString; const lpFileName: WideString): Integer;
Result := DefaultInterface.SetConfigStr(lpAppName, lpKeyName, lpStrValue, lpFileName);
end;
function TXDView.ExecuteProgram(const szProgram: WideString): Integer;
begin
Result := DefaultInterface.ExecuteProgram(szProgram);
end;
function TXDView.FullScreen: Integer;
begin
Result := DefaultInterface.FullScreen;
end;
function TXDView.RtFullScreen: Integer;
begin
Result := DefaultInterface.RtFullScreen;
end;
procedure Register;
begin
RegisterComponents(dtlOcxPage, [TXDView]);
end;
end.
I have found and used the following text file that has some information.
??XDViewV5.0 Explain and Demo
Demo window 1
DVS Login
Please input parameter
URL:
Port:
Name:
Password:
chunnel:
Demo window 2
Active window active window
Socket Protocol
Record file packet time Minute
Please confirm Capture file path before Capture the picture
Replay
??Use Explain
Table of contents
Foreword
??Operating the DVS
??PTZ Control
A?PTZ Control explain
B?PTZCmd Command
??Replaying and Downloading
??Other Parameter Settings
??Directions of callback functions
Foreword Top
name: XDView.ocx
function: DVS operation and record file Replaying
other instructions:
1?XDView1 is an ActiveX control object in XDView.ocx V5.0.
2?Several objects can be loaded onto one page for DVS operation.
3?each object maps a DVS or a record file replay window.
4?each object can play all videos for one DVS. In this case, please set up XDView1.ChannelNum to zero in "start preview".
5?each object can also play one video through a certain channel for one DVS. In this case, please set up XDView1.ChannelNum to 1~4 in "start preview".
6?ActiveX control clsid:08353A15-031B-4FE1-9BF5-5B4F721BA61A
??DVS Operating Top
1?Log on DVS
Log on 1 (setup below parameters for the demo )
XDView1.NvsName = "" //DVS Name can be vacant as ""
XDView1.URL = "192.168.101.101" //DVS address
XDView1.Port = 5001 //port
XDView1.UserName = "antenanet" //user name
XDView1.UserPswd = "radenko" //password
XDView1.LoginNVS()
// Log on callback functions
// nResult >= 2 Log on succeed, nResult = 5 System administrator, 2=< nResult < 5 user ;other be defeated
// The Reason of Login failed:
// -1 Operation defeat!
// -2 Request be rejected!
// -3 Login users to be full !
// -4 User name or password not match with system!
// -5 IE is close!
// -6 Connect dns failure!
// -7 getparms failure!
void OnLoginNVSResult(long nResult)
Log on 2 (enter the login parameters through input interface provided by ActiveX.)
XDView1.LoginNVS()
1.2?Login settings
// XDViewV5.60.cab 2007-11-21 Add Funcation
// Function:login setting
// nMode=0 blocking mode (former version,it is the default mode of new version)
// nMode=1 nonblocking mode ,need the call-back function "OnLoginNVSResult" to get the result of login
// Instruction:login device with "nonblocking mode",it must do "SetLoginMode (1)" before to "Login NVS"
void CXDViewCtrl::SetLoginMode(short nMode)
2?Logout DVS
XDView1.LogoutNVS()
3?Listen
listen ON
XDView1.OnListen_On()
listen OFF
XDView1.OnListen_Off()
4?Talkback
talkback ON
XDView1.OnTalkback_On()
talkback OFF
XDView1.OnTalkback_Off()
5?Setup DVS
void SetNVS(short bEnableLocalSetting)
if bEnableLocalSetting is 1, then the page of "local setting" will be displayed.
if bEnableLocalSetting is 0, then the page of "local setting" will not be displayed(carry out local setting through interface )
usage: XDView1.SetNVS(1)
or: XDView1.SetNVS(0)
6?Clear Alarm
XDView1.ClearNvsAlarm()
7?Show alarm message without video
popup alarm message window
XDView1.AlarmBox_On() // alarm window can be dispayed.
Hide alarm message window
XDView1.AlarmBox_Off() // alarm window can not be displayed. can call back onalarms(long nalarminfo) to process alarminfor.(please refer to "long nAlarmInfo instructions)
8?display prompt in window
display Prompt
XDView1.Tips_On() //(Default:On)
close Prompt
XDView1.Tips_Off()
9?Output control 1
ON
XDView1.OutCtrlPort = 1
XDView1.OutputCtrl_On()
OFF
XDView1.OutCtrlPort = 1
XDView1.OutputCtrl_Off()
10?Output control 2
ON
XDView1.OutCtrlPort = 2
XDView1.OutputCtrl_On()
OFF
XDView1.OutCtrlPort = 2
XDView1.OutputCtrl_Off()
11?Setting capture path (Default C:\xdnvs)
XDView1.SetCapPath(path) //set capture path
XDView1.GetCapPath() //get capture path
12?Setting record path (Default C:\xdnvs)
XDView1.SetRecPath(path) //set record path
XDView1.GetRecPath() //get record path
13?Setting record file packet time
XDView1.SetRecPackTime(Rectime) //set record file packet time
XDView1.GetRecPackTime() //get record file packet time
14?SettingDelnterlace
XDView1.SetDeInterlace(DeInterlace) //set Delnterlace
XDView1.GetDeInterlace() //get Delnterlace
15?SettingPreview mode Set Preview mode
XDView1.SetDecPriority(DecPriority)
XDView1.GetDecPriority() //Get Preview mode
16?Show the way for the very first time at the single channels
XDView1.FullWnd_On() (Default:full window)
XDView1.FullWnd_Off() (images size)
17?Liveview
XDView1.NvsName = ""
XDView1.URL = "192.168.101.101" //URL
XDView1.Port = 5001 //Port
XDView1.UserName = "antenanet" //Name
XDView1.UserPswd = "radenko" //Password
XDView1.ChannelNum= 4 //Channel 4
XDView1.StartView() //Liveview Log on succeed:OnLoginNVSResult() ,Call
ChannelNum:XDView1.ChannelNum= 0 all channels,XDView1.ChannelNum= 1 channel 1 , XDView1.ChannelNum= 2 channel 2?
18?Stop liveview
XDView1.StopView()
19?Record (active channel)
XDView1.StartRecord()
20?Stop Record (active channel)
XDView1.StopRecord()
21?Capture 1 (If when the DVS have several channel, then aim at to be picked out at present of channel.)
XDView1.ChannelCapture(bTips) // bTips=0 : make a return impossible,bTips=1 : make a return
Capture 2 (return picture path)
XDView1.CaptureChannel(nchannel) // nchannel: channel
22? Trigger return when a action event occurs.(for example:click)
void OnSelected()
return: none
detail: see "directions of callback functions"
23?activate and use this control when object is loaded.
XDView1.RefreshCtrl()
24?whether activate and return to dblclick or not
XDView1.ControlImageSize(0) //not to activate and return to dblclick(default)
XDView1.ControlImageSize(1) // activate and return to dblclick
25?dblclick object and callback function (setup activated object and dblclick first) note: video needs to be connected before dblclick object and callback function.
void OnLBtnDblClk()
return: none
detail: see "directions of callback functions"
26? Alarm Record:
void SetAlarmRecTime(long nSecond)
Setting record time(second),>0
long GetAlarmRecTime()
Getting record time(second)
27? Alarm Prerecord Record:
void SetAlarmPreRecTime(long nSecond)
Setting Prerecord time(second),>0
long GetAlarmPreRecTime()
Getting Prerecord time(second)
28? Alarm Record return function :
void OnAlarmRecordStatus(short nCH, short nStatus)
nCH channel 0~3
nStatus True : Starting record. False Stop record
detail: see "directions of callback functions"
30? Set Image Qulity
void SetImageHighQulity(short nHight)
parameter:nHight=1 High Qulity , nHight=0 normal Qulity
Explain:1. In loading or liveview, to execute a call.
2. If don't execute, Silence gives consent.
3. The function is valid in DVS, but not in IPCam.
4. If showed more than 8 OCX in an IE, suggest execute SetImageHighQulity(0)
31? Get Channel number
void long GetChannelCount()
return:The Channel of device counts at present
Explain:Have to at register into after carry out should connect
32? Examining the device records image function
BOOL CheckRecordFun()
return:TRUE The device has already recorded image function
Explain:Have to at register into after carry out should connect
33? While activating window way, the OCX returns to window slogan:
void OnSelectedWindow(short nWindow)
explain:While activating window way, the OCX returns to window slogan
Parameters:nWindow ,window no(0~3)
detail: see "directions of callback functions"
34? Get record status
void OnGetCurrentChRecStatus(short nStatus)
0 stop 1 The start record but doesn't record 2 record
35?Hue setting
[id(73)] void SetVideoSignal(nchannel,long brightness, long chroma, long contrast, long saturation) ;
[id(74)] long GetBrightness(nchannel); //get Brightness 0-255
[id(75)] long GetChroma(nchannel); //get Chroma 0-255
[id(76)] long GetContrast(nchannel); //get Contrast 0-128
[id(77)] long GetSaturation(nchannel); //get Saturation 0-128
36? UpdateKernel(Filetype,FilePath)
function: upload kernel and upgrade function.
Parameters:file type, 0 is kernel , 1 is control,2 is page,3 is other.
FilePath is local path of the file.
Return:none
detail:login first and then execute the function.
37? DownloadPTZ(FilePath)
function: upload PTZ protocol and upgrade function
Parameters: FilePath is local path of the file.
Return:none
detail:login first and then execute the function.
38? OCX returns to the window num and callback function when user select a certain window of the control:
void UpdateSendPercent(nPer)
detail:upload file and callback function.
Parameters:none
return: percentage of file that has been uploaded.
detail: see "directions of callback functions"
39? OCX returns to the window num and callback function when user select a certain window of the control:
void UpdateSavePercent(nPer)
detail:install file and callback function
Parameters:none
return: ercentage of file that has been uploaded.
detail: see "directions of callback functions"
// ==========================================
40? // Function:Get lens parameters (IPCam effective)
// Return:character string,length=0 failure,length=4 success?
// Each number(only 0 and 1) means the following information:
// Automatic White Balance (AW/B) 1 On
// Automatic Gain Control (AGC) 1 On
// Back Light Compensation (BLC) 1 On
// Brightness control 1 Auto , 0 Electron
BSTR CXDViewCtrl::GetLensConfig()
// ==========================================
41? // Funcion:Auto-Iris leveling adjustment(for IPCam)
// Input:bAdd=TRUE adding ; bAdd=FALSE decreasing
BOOL CXDViewCtrl::AutoIris(BOOL bAdd)
// ==========================================
42? // Function:Brightness control(for IPCam)
// Input:bAuto=TRUE Auto ; bAuto=FALSE electron
BOOL CXDViewCtrl::luminationCtrl(BOOL bAuto)
// ==========================================
43? // Function:AW/B (for IPCam)
// Input:bOpen=TRUE On ; bOpen=FALSE OFF
BOOL CXDViewCtrl::AWBCtrl(BOOL bOpen)
// ==========================================
44? // Function:AGC (for IPCam)
// Input:bOpen=TRUE On ; bOpen=FALSE Off
BOOL CXDViewCtrl::AGCCtrl(BOOL bOpen)
// ==========================================
45? // Funtion:BLC (for IPCam)
// Input:bOpen=TRUE On ; bOpen=FALSE Off
BOOL CXDViewCtrl::BLCCtrl(BOOL bOpen)
// ==========================================
46?// Function:Getting OCX version
// Return:character string,for example:4,7,4,0
BSTR CXDViewCtrl::GetVersion()
47? // Function: open network file failure, callback functions
// Return: nResult //The error codes
// The error codes this:
void RtOnNetOpenFile(long nResult)
typedef enum _HHERR_CODE
{
HHERR_SUCCESS, //operation succeed 0
HHERR_FAILURE, //operation failure 1
HHERR_REFUSE_REQ, //Request refused 2
HHERR_USER_FULL, //Login busy 3
HHERR_PREVIEW_FULL, //Preview busy 4
HHERR_TASK_FULL, //System busy,try later 5
HHERR_CHANNEL_NOT_EXIST, //The channel busy or not exist 6
HHERR_DEVICE_NAME, //The device doesn't exist 7
HHERR_IS_TALKING, //TALKING 8
HHERR_QUEUE_FAILUE, //QUEUE FAILUE 9
HHERR_USER_PASSWORD, //username or password is error 10
HHERR_SHARE_SOCKET, //socket error 11
HHERR_RELAY_NOT_OPEN, //transmit Request failure 12
HHERR_RELAY_MULTI_PORT, //transmit Multicast port error 13
HHERR_VIEWPUSH_CHANNEL_USING, //channel busy 14
HHERR_VIEWPUSH_DECODE_TYPE, //DECODE TYPE error,0channel(4cif,2cif,cif),1channel(2cif,cif),2channel(cif),3channel(cif) 15
HHERR_AUTO_LINK_FAILURE, //transmit connect failure 16
HHERR_NOT_LOGON, 17
HHERR_IS_SETTING, 18
HHERR_COMMAND_FAILURE, 19
HHERR_INVALID_PARAMETER=100, //parameter failure 100
HHERR_LOGON_FAILURE, //Login failure 101
HHERR_TIME_OUT, //operation timeout 102
HHERR_SOCKET_ERR, //SOCKET error 103
HHERR_NOT_LINKSERVER, //connect server failure 104
HHERR_BUFFER_EXTCEED_LIMIT, //cushion over - limit 105
HHERR_LOW_PRIORITY, //operation not enough operaiton access 106
HHERR_BUFFER_SMALL, //Internet abnormal 107
HHERR_IS_BUSY, //System busy,try later 108
HHERR_UPDATE_FILE, //upgrade file error 109
HHERR_UPDATE_UNMATCH, //upgrade file & device don't matching 110
HHERR_PORT_INUSE, //The port busy 111
HHERR_RELAY_DEVICE_EXIST, //The device name exist 112
HHERR_CONNECT_REFUSED, //connect refused 113
HHERR_PROT_NOT_SURPPORT, //protocol error 114
HHERR_FILE_OPEN_ERR, //open file failure 115
HHERR_FILE_SEEK_ERR, //fseek failure 116
HHERR_FILE_WRITE_ERR, //write failure 117
HHERR_FILE_READ_ERR, //fread failure 118
HHERR_FILE_CLOSING, //Close file 119
}HHERR_CODE;
??PTZ Control(If when the DVS have several channel, then aim at to be picked out at present of channel.) Top
1?PTZ Up
XDView1.PTZParam = 50 //Seep
XDView1.PTZCmd = 1 //command code
XDView1.ControlPTZ() //execute
2?PTZ Down
XDView1.PTZParam = 50
XDView1.PTZCmd = 2
XDView1.ControlPTZ()
3?PTZ Left
XDView1.PTZParam = 50
XDView1.PTZCmd = 3
XDView1.ControlPTZ()
4?PTZ Right
XDView1.PTZParam = 50
XDView1.PTZCmd = 4
XDView1.ControlPTZ()
5?Focus +
XDView1.PTZCmd = 5
XDView1.ControlPTZ()
6?Focus-
XDView1.PTZCmd = 6
XDView1.ControlPTZ()
7?Aperture +
XDView1.PTZCmd = 7
XDView1.ControlPTZ()
8?Aperture -
XDView1.PTZCmd = 8
XDView1.ControlPTZ()
9?Zoom +
XDView1.PTZCmd = 9
XDView1.ControlPTZ()
11?Zoom -
XDView1.PTZCmd = 10
XDView1.ControlPTZ()
12?Preset
XDView1.PTZCmd = 19
XDView1.PTZParam = 1 // value: 1~128
XDView1.ControlPTZ()
13?Call preset
XDView1.PTZCmd = 20
XDView1.PTZParam = 1 // value: 1~128
XDView1.ControlPTZ()
14?PTZ Up -> Stop
XDView1.PTZCmd = 30
XDView1.ControlPTZ()
15?PTZ Down -> Stop
XDView1.PTZCmd = 31
XDView1.ControlPTZ()
16?PTZ Left -> Stop
XDView1.PTZCmd = 32
XDView1.ControlPTZ()
17?PTZ Right -> Stop
XDView1.PTZCmd = 33
XDView1.ControlPTZ()
18?Focus+ ->Stop
XDView1.PTZCmd = 34
XDView1.ControlPTZ()
19?Focus- ->Stop
XDView1.PTZCmd = 35
XDView1.ControlPTZ()
20?Aperture+ ->Stop
XDView1.PTZCmd = 36
XDView1.ControlPTZ()
21?Aperture- ->Stop
XDView1.PTZCmd = 37
XDView1.ControlPTZ()
22?Zoom+ ->Stop
XDView1.PTZCmd = 38
XDView1.ControlPTZ()
23?Zoom- ->Stop
XDView1.PTZCmd = 39
XDView1.ControlPTZ()
24?Light
ON
XDView1.PTZCmd = 13
XDView1.ControlPTZ()
OFF
XDView1.PTZCmd = 14
XDView1.ControlPTZ()
25?Brush
ON
XDView1.PTZCmd = 15
XDView1.ControlPTZ()
OFF
XDView1.PTZCmd = 16
XDView1.ControlPTZ()
26?Water
ON
XDView1.PTZCmd = 17
XDView1.ControlPTZ()
OFF
XDView1.PTZCmd = 18
XDView1.ControlPTZ()
27?PTZ Auto
ON
XDView1.PTZCmd = 11
XDView1.ControlPTZ()
OFF
XDView1.PTZCmd = 12
XDView1.ControlPTZ()
PTZCmd Command Code Top
1 //PTZ Up
2 //PTZ Down
3 //PTZ Left
4 //PTZ Right
5 //Foucs +
6 //Foucs -
7 //Aperture +
8 //Aperture -
9 //Zoom +
10 //Zoom-
11 //Auto ON
12 //Auto OFF
13 //Light ON
14 //Light OFF
15 //Brush ON
16 //Brush OFF
17 //Water ON
18 //Water OFF
19 //Preset
20 //Call Preset
30 //PTZ Up ->Stop
31 //PTZ Down ->Stop
32 //PTZ Left ->Stop
33 //PTZ Right ->Stop
34 //Focus+ ->Stop
35 //Focus- ->Stop
36 //Aperture+ ->Stop
37 //Aperture- ->Stop
38 //Zoom+ ->Stop
39 //Zoom- -Stop
PTZParam Parameters :
when controlling the PTZ to up, down, left, and right, the PTZParam transmitting speed is 0~100. the defoult speed is 50.
when preset or call preset presetting bit,PTZParam is presetting bit.
?? Replaying and Downloading Top
1?Function:Searching record files from device in some condition.
BOOL CXDViewCtrl::RtSearchFile(LPCTSTR nFrom,LPCTSTR szNVSName,LPCTSTR szURL,long nSvrPort,LPCTSTR szUserName,LPCTSTR szUserPwd,short nRecType, short nChannel,LPCTSTR szDate, LPCTSTR szBeginTime, LPCTSTR szEndTime)
Return:FALSE if fail to connect or login device,else TRUE.
Parameters:nFrom (0 = searching from device , 1 = searching from localhost , 2 = searching from local PC server)
szNVSName device name
szURL device address
nSvrPort service port(same with video channel port)
szUserName user name
szUserPwd password
nRecType record type ( 0-all,1-alarm,2-manmanual,3-timing)
nChannel channel (0-all,1-channel 1,2-channel 2,3-channel3, 4-channel 4
szDate date,the format is: 2007-07-01 (July January 2007)
szBeginTime start time, the format is: 09:06
szEndTime end time, the format is: 21:12
2?Function:stop searching
void RtStopSearchFile()
Return:TRUE success,FALSE fail
Parameters:none
3?Function:open record file and play
long RtOpenPlayFile(short nWindow,LPCTSTR szChannel, LPCTSTR szFileName)
Return:time length of record file
Parameters:nWindow,coresponding the window of 0 to 3(the record file can be played in any window,the four windows can play record file at the same time)
nChannel channel no(1~4)
szFileName file name(not including the directory name)
remark: You can pass empty value to szChannel and szFileName if you want to pump file open dialog
4?Function:play
long RtPlay(int nWindow)
Return:0 success,else fail
Parameters:nWindow ,window no(0~3)
5?Function:stop
long RtStopPlay(short nWindow)
Return:0 success,else fail
Parameters:nWindow ,window no(0~3)
6?Function::pause
long RtPause(short nWindow)
Return:0 success,else fail
Parameters:nWindow ,window no(0~3)
7?Function:fast play
long RtFast(short nWindow)
Return:0 success,else fail
Parameters:nWindow ,window no(0~3)
8?Function:frame skip
long RtFrame(short nWindow)
Return:0 success,else fail
Parameters:nWindow ,window no(0~3)
9?Function:audio switcher
long RtSetAudio(short nWindow,BOOL bAudio)
Return:0 success,else fail
Parameters:nWindow ,window no(0~3)
bAudio TRUE open audio, FALSE close audio
10?Function:capture picture
BOOL RtCapture(short nWindow,BOOL bPump)
Return:0 success,else fail
Parameters:nWindow ,window no(0~3)
bPump TRUE show tip window, FALSE silence
11?Function:download record file
long RtDownloadFileRtDownloadFile(LPCTSTR szChannel, LPCTSTR szFileName)
Return:0 fail,else return the download no
Parameters:nChannel ,channel no(1~4)
szFileName file name(not including the directory name and extertion name)
12? Function:searching result
void RtOnSearchResult(LPCTSTR nChannel, BSTR szFileName)
Parameters:nChannel ,channel no(1~4)
szFileName file name(not including the directory name and extertion name) Return:none
detail: see"directions of callback functions"
13?Function:playing progress
void RtOnPlayProgress(short nWindow, long nTotalTime, long nUseTime);
Parameters:nWindow ,window no(0~3)
nTotalTime total time length of file
nUseTime played time length
detail: see"directions of callback functions"
14?Function:infomation of downloading
void RtOnFinishDownload(long nID,LPCTSTR szFileName)
Parameters:nID ,download id
szFileName full path of downloaded file,including channel information
remark:after downloading,the OCX control call this interface
detail: see"directions of callback functions"
15?Function:show window of downloading infomation
void RtShowDonwloadInfo(short bShow)
Parameters:bShow=TRUE,show, bShow=FALSE,hide
remark:the default value of bShow is FALSE
examples: RtShowDonwloadInfo(1) //show
RtShowDonwloadInfo(0) //hide
Return:none
16?Function:initialization of remote player
void RtInitPlayer()
Parameters:none
Return:none
remark:call once
16_2? Function:initialization of remote player (same with RtInitPlayer,add windows controling)
void CXDViewCtrl::RtSetWindow(short nWndCount)
Parameters:nWndCount, windows number(1 or 4)
Return:none
remark:call once
17? Function:refresh window status
void RtOnRefreshWndStatus(short nWindows, short nFlag)
Parameters:nWindows,window no
nFlag, when user select a play window(0~3),OCX output the play event to IE by nFlag.this parameter is between 0 to 4
// remark: different nFlag value can disble different function
// 0 no play job
// 1 play remote picture,disabled:play,stop,pause,fast skip,fast back,frame skip,frame back,loop,audio,capture
// 2 play remote record,disabled:fast back,frame back,loop
// 3 play local picture,disabled:play,stop,pause,fast skip,fast back,frame skip,frame back,loop,audio,capture
// 4 paly local record,disabled:none
18?Function:fast back
long RtFastBack(short nWindow)
Return:0 success,else fail
Parameters:nWindow ,window no(0~3)
19?Function:loop switcher
long RtLoop(short nWindow, BOOL bLoop)
Return:0 success,else fail
Parameters:nWindow ,window no(0~3)
20?Function:resume(coresponding to pause)
long RtResume(short nWindow)
Return:0 success,else fail
Parameters:nWindow ,window no(0~3)
21?Function:locate the player
long RtSeek(short nWindow, long nToSecond)
Return:0 success,else fail
Parameters:nWindow ,window no(0~3)
nToSecond ,locate time(less than total time length)
remark:called when user drag the progress pointer.only for local playing.
14?Function:finish searching
void RtOnSearchEnd()
Parameters:none
Return:none
remark:after searching file,the ocx call this interface
detail: see "directions of callback functions"
23? Function:frame back
long CXDViewCtrl::RtFrameBack(short nWindow)
Return:0 success,else fail
Parameters:nWindow ,window no(0~3)
24? // Function:play estate
// Parameters:
nPLAY //Play 0 Close 1 enable
nPAUSE //PAUSE 0 Close 1 enable
nSTOP //STOP 0 Close 1 enable
nBACK //BACK 0 Close 1 enable
nFORWARD //FORWARD 0 Close 1 enable
nSTEPBACK //STEPBACK 0 Close 1 enable
nSTEPIN //STEPIN 0 Close 1 enable
nAUDIO //AUDIO___on-off 0 Close 1 OFF 2 ON
nLOOP //LOOP___on-off 0 Close 1 OFF 2 ON
nCAPTURE //CAPTURE 0 Close 1 enable
RtOnSetButtonsStatus(long nPLAY, long nPAUSE, long nSTOP, long nBACK, long nFORWARD, long nSTEPBACK, long nSTEPIN, long nAUDIO, long nLOOP, long nCAPTURE);
??Other Parameters setting Top
1?communication Protocols ( 0-TCP 1-UDP 2-multiple broadcast )
setting communication protocol by cXDView1.SocketProtocol
??Directions of callback functions Top
1?Display alarm information
void OnAlarms(long nAlarmInfo)
Return:none
Parameters:nAlarmInfo,this parameter is identified by bit from low to high,indicating the alarm status.
remark:
0~3 bit identify the alarm coming of sensor 1 to 4
4~7 bit identify the motion alarm coming of sensor 1 to 4
8~11 bit identify the video lost alarm coming of sensor 1 to 4
12bit 0 alarm, 1 alarm close
detail:see " RtOnPlayProgress"
2?the usage of RtOnPlayProgress
Paste the code below into behind of <body>,RtOnPlayProgressis the callbacck function of controller,OnPlay is the function of script handler of client,programed by itself!(Example:file replaying!please pay attention to the left corner of status bar of explorer;[for instance:23/135,it can be seen the total time of file length is 135s,the current playing time is 23s])
<script language="vbscript" for="XDView1" event="RtOnPlayProgress(nWindow, nTotalTime, nUseTime)">
OnPlay(nWindow, nTotalTime, nUseTime) //processing of client
</script>
3?usage of window selection callback(focus on multiple ocx control in one page)
Paste the code below into behind of <body>,OnSelectedWindow is the callbacck function of xdview ocx control,called when a ocx window get the focus.
<script language="vbscript" for="OCX ID" event="OnSelectedWindow(nWindow)">
// processing of client
</script>
remark:You must set this function for every OCX object.
CopyRight __ HHDIGITAL
I am out of my depth here so any info at idiot level please. I have requested info from the manufactures but have not received anything yet. They do have a SDK but this is ib C++ so might as well be in chinese. I know I can produce the app once I know all the properties and can change them in code.
Cheers
SteveW