//---------------------------------------------------------------------------
#include <vcl.h>

#ifndef DirectShowClassH
#define DirectShowClassH

#include "TERASIC_DX.h"
//---------------------------------------------------------------------------
class TDirectShow{
public:
    __fastcall TDirectShow();
    __fastcall ~TDirectShow();
    bool __fastcall New(HWND hWnd);
    void __fastcall Delete(void);
    bool __fastcall OpenFile(char * pFilename, int *pnVideoWidth, int *pnVideoHeight);
    void __fastcall CloseFile(void);
    void __fastcall Pause(void);
    void __fastcall Stop(void);
    bool __fastcall Capture2File(char * pFilename);
    bool __fastcall CanStep(void);
    bool __fastcall Step(int nFrameToStep);
    DWORD __fastcall GetDuration(void);
    DWORD __fastcall GetCurrentPosition(void);
    BOOL __fastcall SeekToPosition(DWORD dwPosition, bool bFlashData = false);
    Graphics::TBitmap* __fastcall CaptureImage(void);
    bool __fastcall SetDisplayRect(TRect rc);
    void __fastcall Repaint(void);
protected:
    HANDLE m_hDLL;
    LPDX_New     m_New;
    LPDX_Delete  m_Delete;
    LPDX_OpenFile   m_OpenFile;
    LPDX_CloseFile   m_CloseFile;
    LPDX_Pause   m_Pause;
    LPDX_Stop    m_Stop;
    LPDX_Capture2File   m_Capture2File;
    LPDX_CaptureImage   m_CaptureImage;
    LPDX_SetDisplayRect m_SetDisplayRect;
    LPDX_Repaint        m_Repaint;

    LPDX_CanStep            m_CanStep;
    LPDX_Step               m_Step;
    LPDX_GetDuration        m_GetDuration;
    LPDX_GetCurrentPosition m_GetCurrentPosition;
    LPDX_SeekToPosition     m_SeekToPosition;
    bool __fastcall DllLoad(void);
    void __fastcall DllFree(void);
};
#endif
 