⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 seek.cpp

📁 播放H.264压缩算法文件(C++源程序)
💻 CPP
字号:
// Seek.cpp : implementation file
//

#include "stdafx.h"
#include "player.h"
#include "Seek.h"
#include"hikplaympeg4.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

extern UINT PORT;
/////////////////////////////////////////////////////////////////////////////
// CSeek dialog


CSeek::CSeek(CWnd* pParent /*=NULL*/)
	: CDialog(CSeek::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSeek)
	m_nSeekType = 0;
	m_nValue = 0;
	//}}AFX_DATA_INIT
	m_pParent=pParent;
}


void CSeek::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSeek)
	DDX_Radio(pDX, IDC_BYFRAME, m_nSeekType);
	DDX_Text(pDX, IDC_VALUE, m_nValue);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSeek, CDialog)
	//{{AFX_MSG_MAP(CSeek)
	ON_BN_CLICKED(IDC_SEEK, OnSeek)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSeek message handlers

void CSeek::OnSeek() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	
	if(m_nSeekType==0)
	{
		if(m_nValue>m_nMaxFrameNum)
		{
			MessageBox("Input frame number is over!");
			return ;
		}
		Hik_PlayM4_SetCurrentFrameNum(PORT,m_nValue);
	}
	else if(m_nSeekType==1)
	{
		if(m_nValue>m_nMaxTime)
		{
			MessageBox("Input time is over!");
			return ;
		}
		Hik_PlayM4_SetPlayedTimeEx(PORT,m_nValue*1000);
	}
		
}

BOOL CSeek::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_nMaxTime=Hik_PlayM4_GetFileTime(PORT);
	m_nMaxFrameNum=	Hik_PlayM4_GetFileTotalFrames(PORT);
	CString csRange;
	csRange.Format("Frame number range:%d~%d\r\nTime range(Seconds):%d~%d\r\n",0,m_nMaxFrameNum,0,m_nMaxTime);
	GetDlgItem(IDC_RANGE)->SetWindowText(csRange);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CSeek::OnOK() 
{
	// TODO: Add extra validation here
	if(m_pParent)
		m_pParent->PostMessage(WM_SEEKOK,0,0);
	else
		CDialog::OnOK();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -