//---------------------------------------------------------------------------

#ifndef FrmCctvCtrlFH
#define FrmCctvCtrlFH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <Graphics.hpp>
#include <Menus.hpp>
#include <ImgList.hpp>
#include <ComCtrls.hpp>
#include <jpeg.hpp>
#include <AppEvnts.hpp>
//---------------------------------------------------------------------------
#include <windows.h>
#include <ADODB.hpp>
#include <DB.hpp>
#include "cxClasses.hpp"
#include "cxContainer.hpp"
#include "cxControls.hpp"
#include "cxEdit.hpp"
#include "cxGraphics.hpp"
#include "cxHint.hpp"
#include "cxLabel.hpp"
#include "cxLookAndFeelPainters.hpp"
#include "cxLookAndFeels.hpp"
#include "cxMaskEdit.hpp"
#include "cxPC.hpp"
#include "cxPCdxBarPopupMenu.hpp"
#include "cxSpinEdit.hpp"
#include "cxTextEdit.hpp"
#include "dxBar.hpp"
#include "dxCustomHint.hpp"
#include "dxRibbon.hpp"
#include "dxRibbonGallery.hpp"
#include "dxRibbonSkins.hpp"
#include "dxRibbonStatusBar.hpp"
#include "dxScreenTip.hpp"
#include "dxSkinBlack.hpp"
#include "dxSkinBlue.hpp"
#include "dxSkinCaramel.hpp"
#include "dxSkinChooserGallery.hpp"
#include "dxSkinCoffee.hpp"
#include "dxSkinDarkRoom.hpp"
#include "dxSkinDarkSide.hpp"
#include "dxSkinFoggy.hpp"
#include "dxSkinGlassOceans.hpp"
#include "dxSkiniMaginary.hpp"
#include "dxSkinLilian.hpp"
#include "dxSkinLiquidSky.hpp"
#include "dxSkinLondonLiquidSky.hpp"
#include "dxSkinMcSkin.hpp"
#include "dxSkinMoneyTwins.hpp"
#include "dxSkinOffice2007Black.hpp"
#include "dxSkinOffice2007Blue.hpp"
#include "dxSkinOffice2007Green.hpp"
#include "dxSkinOffice2007Pink.hpp"
#include "dxSkinOffice2007Silver.hpp"
#include "dxSkinOffice2010Black.hpp"
#include "dxSkinOffice2010Blue.hpp"
#include "dxSkinOffice2010Silver.hpp"
#include "dxSkinsCore.hpp"
#include "dxSkinscxPCPainter.hpp"
#include "dxSkinsdxBarPainter.hpp"
#include "dxSkinsdxRibbonPainter.hpp"
#include "dxSkinSeven.hpp"
#include "dxSkinsForm.hpp"
#include "dxSkinSharp.hpp"
#include "dxSkinSilver.hpp"
#include "dxSkinStardust.hpp"
#include "dxStatusBar.hpp"
#include "dxTabbedMDI.hpp"
#include <GIFImg.hpp>
#include <OleCtnrs.hpp>
//---------------------------------------------------------------------------
#include <OleCtrls.hpp>
#include "cxButtons.hpp"
#include "cxGroupBox.hpp"
#include "ImageBtn.h"
#include "TVSLib_OCX.h"
#include "cxDropDownEdit.hpp"
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
class TFrmCctvCtrl : public TForm//TdxCustomRibbonForm//TForm
{
__published:	// IDE-managed Components
    TcxHintStyleController *cxHintStyleController1;
    TTimer *TmrOnShow;
    TdxSkinController *dxSkinController1;
    TApplicationEvents *ApplicationEvents1;
    TPanel *PnlBack;
    TPanel *PnlCamConrtol;
    TcxButton *BtnImageSave;
    TPanel *PnlPTZ;
    TImageBtn *BtnUpLeft;
    TImageBtn *BtnUp;
    TImageBtn *BtnUpRight;
    TImageBtn *BtnLeft;
    TImageBtn *BtnHome;
    TImageBtn *BtnRight;
    TImageBtn *BtnDownLeft;
    TImageBtn *BtnDown;
    TImageBtn *BtnDownRight;
    TImageBtn *BtnZoomIn;
    TImageBtn *BtnZoomOut;
    TImageBtn *BtnFocusIn;
    TImageBtn *BtnFocusOut;
    TLabel *Label20;
    TTrackBar *PTZSpeed;
    TPanel *Panel1;
    TPanel *PnlStreamInfo;
    TcxLabel *cxLabel1;
    TcxButton *BtnCamera;
    TcxTextEdit *EdIp;
    TcxLabel *cxLabel2;
    TcxLabel *cxLabel3;
    TcxTextEdit *EdUserId;
    TcxTextEdit *EdUserPswd;
    TPanel *PnlCameraBack;
    TPanel *PnlCamera;
    TcxLabel *LblErrMsg;
    TTVSLiveControl *TVSLiveControl1;
    TcxTextEdit *EdPort;
    TcxLabel *cxLabel5;
    TcxLabel *cxLabel6;
    TcxComboBox *CbStream;
    TcxComboBox *CbChannel;
    TcxLabel *cxLabel4;
    TMemo *reMsg;
    void __fastcall FormCreate(TObject *Sender);
    void __fastcall FormShow(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    void __fastcall TmrOnShowTimer(TObject *Sender);
    void __fastcall ApplicationEvents1SettingChange(TObject *Sender, int Flag, const UnicodeString Section,
          int &Result);
    void __fastcall TVSLiveControl1ChannelNotify(TObject *Sender, long lChID, long eNewState, long eReason);
    void __fastcall TVSLiveControl1ServerEvent(TObject *Sender, long lChID, long eEventType, short nIndex, long eEventStatus,
          Variant vData);
    void __fastcall reMsgDblClick(TObject *Sender);
    void __fastcall BtnCameraClick(TObject *Sender);
    void __fastcall BtnPTZMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
    void __fastcall BtnPTZMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);


private:	// User declarations

    ITVSDisplay *m_pDisp;

    long m_lCurChID;
    String m_IpAddr;
    String m_Port;
    String m_UserId;
    String m_UserPswd;
    int m_nChannel;
    int m_nStream;

public:
    void __fastcall SetColorScheme(String ASkinName);

public:		// User declarations
    __fastcall TFrmCctvCtrl(TComponent* Owner);

    void __fastcall OnAppHint(TObject *Sender);
    void __fastcall OnAppException(TObject *Sender, Exception *exception);

	void __fastcall CommClose();

    bool __fastcall UpdateExplorerEmulatorVersion(String AAppName);

    bool __fastcall Connect();
    void __fastcall Disconnect();
};
//---------------------------------------------------------------------------
extern PACKAGE TFrmCctvCtrl *FrmCctvCtrl;
//---------------------------------------------------------------------------
#endif

