using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace CSharpPlayerDemo
{
    public partial class CLS_PlaySDK
    {
        public bool m_MyPostMessage(IntPtr _hWnd, Int32 _msg, Int32 _wParam, Int32 _lParam)
        {
            return PostMessage(_hWnd, _msg, _wParam, _lParam);
        }

        public Int32 m_CreateSystem(IntPtr _hWnd)
        {
            return TC_CreateSystem(_hWnd);
        }
        public Int32 m_DeleteSystem()
        {
            return TC_DeleteSystem();
        }

        public Int32 m_CreatePlayerFromFile(IntPtr _hWnd, String _pcFileName, Int32 _iDownloadBufSz,
            Int32 _iFileTrueSz, ref Int32 _piNowSz, Int32 _iLastFrmNo, ref Int32 _piCompleteFlag)
        {
            return TC_CreatePlayerFromFile(_hWnd, _pcFileName, _iDownloadBufSz, _iFileTrueSz, ref _piNowSz, _iLastFrmNo, ref _piCompleteFlag);
        }

        public Int32 m_CreatePlayerFromFile(IntPtr _hWnd, String _pcFileName, Int32 _iDownloadBufSz)
        {
            Int32 iNowSz = 0;
            Int32 iCompleteTag = 0;
            return TC_CreatePlayerFromFile(_hWnd, _pcFileName, _iDownloadBufSz, 0, ref iNowSz, 0, ref iCompleteTag);
        }

        public Int32 m_DeletePlayer(Int32 _iID)
        {
            return TC_DeletePlayer(_iID);
        }

        //需回调，需声明委托
        public Int32 m_RegisterNotifyPlayToEnd(delegatePlayEndFun _PlayEndFun)
        {
            return TC_RegisterNotifyPlayToEnd(_PlayEndFun);
        }

        public void m_TC_RegisterEventMsg(IntPtr _hEventWnd, UInt32 _uiEventMsg)
        {
            TC_RegisterEventMsg(_hEventWnd, _uiEventMsg);
        }

        public Int32 m_Play(Int32 _iID)
        {
            return TC_Play(_iID);
        }

        public Int32 m_Pause(Int32 _iID)
        {
            return TC_Pause(_iID);
        }

        public Int32 m_Stop(Int32 _iID)
        {
            return TC_Stop(_iID);
        }

        public Int32 m_FastForward(Int32 _iID, Int32 _iSpeed)
        {
            return TC_FastForward(_iID, _iSpeed);
        }

        public Int32 m_FastBackward(Int32 _iID)
        {
            return TC_FastBackward(_iID);
        }

        public Int32 m_GoBegin(Int32 _iID)
        {
            return TC_GoBegin(_iID);
        }

        public Int32 m_GoEnd(Int32 _iID)
        {
            return TC_GoEnd(_iID);
        }

        public Int32 m_PlayAudio(Int32 _iID)
        {
            return TC_PlayAudio(_iID);
        }

        public Int32 m_StopAudio(Int32 _iID)
        {
            return TC_StopAudio(_iID);
        }

        public Int32 m_Seek(Int32 _iID, Int32 _iFrameNO)
        {
            return TC_Seek(_iID, _iFrameNO);
        }

        public Int32 m_SeekEx(Int32 _iID, Int32 _iFrameNo)//按帧精确定位，速度比TC_Seek快
        {
            return TC_SeekEx(_iID, _iFrameNo);
        }

        public Int32 m_SetAudioVolumn(UInt16 _ustVolumn)
        {
            return TC_SetAudioVolumn(_ustVolumn);
        }

        public Int32 m_SetPlayRect(Int32 _iID, ref RECT _pDrawRect)
        {
            return TC_SetPlayRect(_iID, ref _pDrawRect);
        }

        public Int32 m_SetPlayRectEx(Int32 _iID, ref RECT _pDrawRect, Int32 _dwMask)
        {
            return TC_SetPlayRectEx(_iID, ref _pDrawRect, _dwMask);//有可能会有问题ref的时候
        }

        public Int32 m_SlowForward(Int32 _iID, Int32 _iSpeed)
        {
            return TC_SlowForward(_iID, _iSpeed);
        }

        public Int32 m_StepBackward(Int32 _iID)
        {
            return TC_StepBackward(_iID);
        }

        public Int32 m_StepForward(Int32 _iID)
        {
            return TC_StepForward(_iID);
        }

        public Int32 m_GetBeginEnd(Int32 _iID, ref Int32 _piBegin, ref Int32 _piEnd)
        {
            return TC_GetBeginEnd(_iID, ref _piBegin, ref _piEnd);
        }

        public Int32 m_GetFrameCount(Int32 _iID)
        {
            return TC_GetFrameCount(_iID);
        }

        public Int32 m_GetFrameRate(Int32 _iID)
        {
            return TC_GetFrameRate(_iID);
        }

        public Int32 m_GetPlayingFrameNum(Int32 _iID)
        {
            return TC_GetPlayingFrameNum(_iID);
        }

        public Int32 m_GetPlayTime(Int32 _iID)
        {
            return TC_GetPlayTime(_iID);
        }

        public Int32 m_GetVideoParam(Int32 _iID, ref Int32 _pWidth, ref Int32 _pHeight, ref Int32 _pFrameRate)
        {
            return TC_GetVideoParam(_iID, ref _pWidth, ref _pHeight, ref _pFrameRate);
        }

        public Int32 m_CaptureBmpPic(Int32 _iID, String _pcSaveFile)
        {
            return TC_CaptureBmpPic(_iID, _pcSaveFile);
        }

        public Int32 m_CapturePic(Int32 _iID, [In, Out]Byte[] _ppucYUV)
        {
            return TC_CapturePic(_iID, _ppucYUV);
        }

        public Int32 m_PutStreamToPlayer(Int32 _iID, Byte[] _pucStreamData, Int32 _iSize)
        {
            return TC_PutStreamToPlayer(_iID, _pucStreamData, _iSize);
        }

        public Int32 m_CreatePlayerFromStreamEx(IntPtr _hWnd, Byte[] _pucVideoHeadBuf, Int32 _iHeadSize, Int32 _iStreamBufferSize)
        {
            return TC_CreatePlayerFromStreamEx(_hWnd, _pucVideoHeadBuf, _iHeadSize, _iStreamBufferSize);
        }

        public Int32 m_CreatePlayerFromStream(IntPtr _hWnd, Byte[] _pucVideoHeadBuf, Int32 _iHeadSize)
        {
            return TC_CreatePlayerFromStream(_hWnd, _pucVideoHeadBuf, _iHeadSize);
        }

        public Int32 m_CleanStreamBuffer(Int32 _iID)
        {
            return TC_CleanStreamBuffer(_iID);
        }

        public Int32 m_SetEZoom(Int32 _iID, Int32 _iZoomID,  RECT _pRectInVideo)
        {
            return TC_SetEZoom(_iID, _iZoomID, _pRectInVideo);
        }

        public Int32 m_ResetEZoom(Int32 _iID, Int32 _iZoomID)
        {
            return TC_ResetEZoom(_iID, _iZoomID);
        }

        public Int32 m_RemoveEZoom(Int32 _iID, Int32 _iZoomID)
        {
            return TC_RemoveEZoom(_iID, _iZoomID);
        }

        public Int32 m_StartMonitorCPU()
        {
            return TC_StartMonitorCPU();
        }

        public Int32 m_StopMonitorCPU()
        {
            return TC_StopMonitorCPU();
        }

        public Int32 m_VECleanup()
        {
            return TC_VECleanup();
        }

        public Int32 m_VEAbort()
        {
            return TC_VEAbort();
        }

        public Int32 m_SegmentToFile(String _pcSaveFile, String _pcSourceFile, Int32 _iBeginFrmNo, Int32 _iEndFrmNo)
        {
            return TC_SegmentToFile(_pcSaveFile, _pcSourceFile, _iBeginFrmNo, _iEndFrmNo);
        }

        public Int32 m_RemoveAudio(String _pcSaveFile, String _pcSourceFile, Int32 _iBeginFrmNo, Int32 _iEndFrmNo)
        {
            return TC_RemoveAudio(_pcSaveFile, _pcSourceFile, _iBeginFrmNo, _iEndFrmNo);
        }

        public Int32 m_RegisterVECallBack(IntPtr _VECallBack)
        {
            return TC_RegisterVECallBack(_VECallBack);
        }

        public Int32 m_Locate(Int32 _iID, ref Int32 _piFrameNo)
        {
            return TC_Locate(_iID, ref _piFrameNo);
        }

        public Int32 m_GetVEState(ref Int32 _piState, ref Int32 _piProgress)
        {
            return TC_GetVEState(ref _piState, ref _piProgress);
        }

        public Int32 m_Combine(String _pcSaveFile, String _pcSource1,
            Int32 _iBeginFrmNo1, Int32 _iEndFrmNo1, String _pcSource2, Int32 _iBeginFrmNo2, Int32 _iEndFrmNo2)
        {
            return TC_Combine(_pcSaveFile, _pcSource1, _iBeginFrmNo1, _iEndFrmNo1, _pcSource2, _iBeginFrmNo2, _iEndFrmNo2);
        }

        public Int32 m_GetVersion(ref SDK_VERSION _pVer)
        {
            return TC_GetVersion(ref _pVer);
        }

        public Int32 m_CreatePlayerFromVoD(IntPtr _hWnd, Byte[] _pucVideoHeadBuf, Int32 _iHeadSize)
        {
            return TC_CreatePlayerFromVoD(_hWnd, _pucVideoHeadBuf, _iHeadSize);
        }

        public Int32 m_SetVoDPlayerOver(Int32 _iID)
        {
            return TC_SetVoDPlayerOver(_iID);
        }

        public Int32 m_SetCleanVoDBuffer(Int32 _iID)
        {
            return TC_SetCleanVoDBuffer(_iID);
        }

        public Int32 m_AddEZoom(Int32 _iID, IntPtr _hWnd, ref RECT _rcZoom, Int32 _iCount)
        {
            return TC_AddEZoom(_iID, _hWnd, ref _rcZoom, _iCount);
        }

        public Int32 m_DrawRect(Int32 _iID, ref RECT _rcDraw, Int32 _iCount)
        {
            return TC_DrawRect(_iID, ref _rcDraw, _iCount);
        }
    }
}
