// Borland C++ Builder
// Copyright (c) 1995, 1998 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'VideoCap.pas' rev: 3.00

#ifndef VideoCapHPP
#define VideoCapHPP
#include <iedefs.hpp>
#include <ImageEnProc.hpp>
#include <ImageEnView.hpp>
#include <Dialogs.hpp>
#include <Forms.hpp>
#include <Controls.hpp>
#include <Graphics.hpp>
#include <Classes.hpp>
#include <StdCtrls.hpp>
#include <SysUtils.hpp>
#include <Messages.hpp>
#include <Windows.hpp>
#include <SysInit.hpp>
#include <System.hpp>

//-- user supplied -----------------------------------------------------------

namespace Videocap
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TVideoCapException;
class PASCALIMPLEMENTATION TVideoCapException : public Sysutils::Exception 
{
	typedef Sysutils::Exception inherited;
	
public:
	/* Exception.Create */ __fastcall TVideoCapException(const System::AnsiString Msg) : Sysutils::Exception(
		Msg) { }
	/* Exception.CreateFmt */ __fastcall TVideoCapException(const System::AnsiString Msg, const System::TVarRec 
		* Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
	/* Exception.CreateRes */ __fastcall TVideoCapException(int Ident, Extended Dummy) : Sysutils::Exception(
		Ident, Dummy) { }
	/* Exception.CreateResFmt */ __fastcall TVideoCapException(int Ident, const System::TVarRec * Args, 
		const int Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
	/* Exception.CreateHelp */ __fastcall TVideoCapException(const System::AnsiString Msg, int AHelpContext
		) : Sysutils::Exception(Msg, AHelpContext) { }
	/* Exception.CreateFmtHelp */ __fastcall TVideoCapException(const System::AnsiString Msg, const System::TVarRec 
		* Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
		) { }
	/* Exception.CreateResHelp */ __fastcall TVideoCapException(int Ident, int AHelpContext) : Sysutils::
		Exception(Ident, AHelpContext) { }
	/* Exception.CreateResFmtHelp */ __fastcall TVideoCapException(int Ident, const System::TVarRec * Args
		, const int Args_Size, int AHelpContext) : Sysutils::Exception(Ident, Args, Args_Size, AHelpContext
		) { }
	
public:
	/* TObject.Destroy */ __fastcall virtual ~TVideoCapException(void) { }
	
};

enum TVCDisplayMode { dmPreview, dmOverlay };

typedef void __fastcall (__closure *TVideoFrameEvent)(System::TObject* Sender, Graphics::TBitmap* Bitmap
	);

typedef void __fastcall (__closure *TVideoFrameRawEvent)(System::TObject* Sender, int hDib, void * pData
	);

struct TCAPDRIVERCAPS
{
	int wDeviceIndex;
	BOOL fHasOverlay;
	BOOL fHasDlgVideoSource;
	BOOL fHasDlgVideoFormat;
	BOOL fHasDlgVideoDisplay;
	BOOL fCaptureInitialized;
	BOOL fDriverSuppliesPalettes;
	int hVideoIn;
	int hVideoOut;
	int hVideoExtIn;
	int hVideoExtout;
} ;

typedef TCAPDRIVERCAPS *PCAPDRIVERCAPS;

struct TVIDEOHDR
{
	Byte *lpData;
	int dwBufferLength;
	int dwBytesUsed;
	int dwTimeCaptured;
	int dwUser;
	int dwFlags;
	int dwReserved[4];
} ;

typedef TVIDEOHDR *PVIDEOHDR;

struct TCAPTUREPARMS;
typedef TCAPTUREPARMS *PCAPTUREPARMS;

struct TCAPTUREPARMS
{
	int dwRequestMicroSecPerFrame;
	BOOL fMakeUserHitOKToCapture;
	Word wPercentDropForError;
	BOOL fYield;
	int dwIndexSize;
	Word wChunkGranularity;
	BOOL fUsingDOSMemory;
	Word wNumVideoRequested;
	BOOL fCaptureAudio;
	Word wNumAudioRequested;
	Word vKeyAbort;
	BOOL fAbortLeftMouse;
	BOOL fAbortRightMouse;
	BOOL fLimitEnabled;
	Word wTimeLimit;
	BOOL fMCIControl;
	BOOL fStepMCIDevice;
	int dwMCIStartTime;
	int dwMCIStopTime;
	BOOL fStepCaptureAt2x;
	Word wStepCaptureAverageFrames;
	int dwAudioBufferSize;
	BOOL fDisableWriteCache;
	Word AVStreamMaster;
} ;

class DELPHICLASS TImageEnVideoView;
class PASCALIMPLEMENTATION TImageEnVideoView : public Imageenview::TImageEnView 
{
	typedef Imageenview::TImageEnView inherited;
	
private:
	bool fShowVideo;
	bool fFreeze;
	TVCDisplayMode fDisplayMode;
	HWND fWndC;
	Classes::TStringList* fDrivers;
	int fVideoSource;
	TScrollStyle fSScrollBars;
	int fPreviewRate;
	bool fCallBackFrame;
	TVideoFrameEvent fOnVideoFrame;
	TVideoFrameRawEvent fOnVideoFrameRaw;
	int fhBitmapInfo;
	bool fBitmapInfoUp;
	bool fConnected;
	bool fFitFreeze;
	Iedefs::TIEJobEvent fOnJob;
	int fHDrawDib;
	bool fGrabFrame;
	System::AnsiString fRecFileName;
	int fRecFrameRate;
	bool fRecAudio;
	bool fRecMultitask;
	bool fRecording;
	
protected:
	void __fastcall SetShowVideo(bool v);
	void __fastcall SetFreeze(bool v);
	void __fastcall SetDisplayMode(TVCDisplayMode v);
	HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
	void __fastcall DriverConnect(void);
	bool __fastcall DriverConnectNE(void);
	void __fastcall DriverDisconnect(void);
	void __fastcall FillDrivers(void);
	void __fastcall SetVideoSource(int v);
	virtual void __fastcall SetScrollBars(Stdctrls::TScrollStyle v);
	bool __fastcall GetHasDlgVideoSource(void);
	bool __fastcall GetHasDlgVideoFormat(void);
	bool __fastcall GetHasDlgVideoDisplay(void);
	bool __fastcall GetHasOverlay(void);
	void __fastcall GetCaps(TCAPDRIVERCAPS &fDriverCaps);
	void __fastcall SetPreviewRate(int v);
	void __fastcall SetCallBackFrame(bool v);
	void __fastcall SetOnVideoFrame(TVideoFrameEvent v);
	void __fastcall SetOnVideoFrameRaw(TVideoFrameRawEvent v);
	bool __fastcall FillBitmapInfo(void);
	void __fastcall CreateCaptureWindow(void);
	void __fastcall DestroyCaptureWindow(void);
	void __fastcall DoJob(Iedefs::TIEJob job, int per);
	void __fastcall DecompRawFrame(Graphics::TBitmap* OutBitmap, void * pix);
	
public:
	__fastcall virtual TImageEnVideoView(Classes::TComponent* Owner);
	__fastcall virtual ~TImageEnVideoView(void);
	virtual void __fastcall Paint(void);
	virtual void __fastcall Select(int x1, int y1, int x2, int y2);
	bool __fastcall DoConfigureSource(void);
	bool __fastcall DoConfigureFormat(void);
	bool __fastcall DoConfigureDisplay(void);
	bool __fastcall DoConfigureCompression(void);
	void __fastcall Freeze(void);
	void __fastcall UnFreeze(void);
	__property bool Frozen = {read=fFreeze, write=SetFreeze, default=0};
	__property Classes::TStringList* VideoSourceList = {read=fDrivers};
	__property bool HasOverlay = {read=GetHasOverlay, nodefault};
	__property bool HasDlgVideoSource = {read=GetHasDlgVideoSource, nodefault};
	__property bool HasDlgVideoFormat = {read=GetHasDlgVideoFormat, nodefault};
	__property bool HasDlgVideoDisplay = {read=GetHasDlgVideoDisplay, nodefault};
	void __fastcall StartRecord(void);
	void __fastcall StopRecord(void);
	__property System::AnsiString RecFileName = {read=fRecFileName, write=fRecFileName};
	__property int RecFrameRate = {read=fRecFrameRate, write=fRecFrameRate, nodefault};
	__property bool RecAudio = {read=fRecAudio, write=fRecAudio, nodefault};
	__property bool RecMultitask = {read=fRecMultitask, write=fRecMultitask, nodefault};
	__property HWND WndCaptureHandle = {read=fWndC, nodefault};
	Windows::TRect __fastcall GetVideoSize(void);
	
__published:
	__property bool FitFreeze = {read=fFitFreeze, write=fFitFreeze, default=1};
	__property TVCDisplayMode DisplayMode = {read=fDisplayMode, write=SetDisplayMode, default=0};
	__property bool ShowVideo = {read=fShowVideo, write=SetShowVideo, default=0};
	__property int VideoSource = {read=fVideoSource, write=SetVideoSource, default=0};
	__property int PreviewRate = {read=fPreviewRate, write=SetPreviewRate, default=60};
	__property TVideoFrameEvent OnVideoFrame = {read=fOnVideoFrame, write=SetOnVideoFrame};
	__property TVideoFrameRawEvent OnVideoFrameRaw = {read=fOnVideoFrameRaw, write=SetOnVideoFrameRaw};
		
	__property Iedefs::TIEJobEvent OnJob = {read=fOnJob, write=fOnJob};
public:
	/* TWinControl.CreateParented */ __fastcall TImageEnVideoView(HWND ParentWindow) : Imageenview::TImageEnView(
		ParentWindow) { }
	
};

//-- var, const, procedure ---------------------------------------------------

}	/* namespace Videocap */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Videocap;
#endif
//-- end unit ----------------------------------------------------------------
#endif	// VideoCap
