📄 info.cpp
字号:
// Info.cpp : implementation file
//
#include "stdafx.h"
#include "player.h"
#include "Info.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include"hikplaympeg4.h"
extern UINT PORT;
/////////////////////////////////////////////////////////////////////////////
// CInfo dialog
CInfo::CInfo(CWnd* pParent /*=NULL*/)
: CDialog(CInfo::IDD, pParent)
{
//{{AFX_DATA_INIT(CInfo)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CInfo::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CInfo)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CInfo, CDialog)
//{{AFX_MSG_MAP(CInfo)
ON_BN_CLICKED(IDC_REFRESH, OnRefresh)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CInfo message handlers
void CInfo::OnRefresh()
{
// TODO: Add your control notification handler code here
CString csTemp;
m_csInfo="";
#if (WINVER > 0x0400)
//If only one adapter ,the return value is 0;
DWORD nVal=Hik_PlayM4_GetDDrawDeviceTotalNums();
if(nVal>=1)
{
csTemp.Format("Video adaper numbers:%d\r\n",nVal);
m_csInfo+=csTemp;
for(DWORD nCount=1;nCount<=nVal;nCount++)
{
DWORD nNameLen=50;
LPSTR pDriverDesp=new CHAR [nNameLen];
LPSTR pDriverName=new CHAR[nNameLen];
HMONITOR hMonitor;
Hik_PlayM4_GetDDrawDeviceInfo(nCount,pDriverDesp,nNameLen,pDriverName,nNameLen,&hMonitor);
csTemp.Format(" <%d:Adatper:%s;Driver:%s\r\n",pDriverDesp,pDriverName);
m_csInfo+=csTemp;
}
}
else
m_csInfo+="Only one video adapter!\r\n";
#endif
//invalid after play()
BOOL bOverlay=Hik_PlayM4_GetOverlayMode(PORT);
m_csInfo+="Is OVERLAY Surface:";
if(bOverlay)
{
csTemp.Format("yes;\r\nThe color key:0x%X;\r\n",Hik_PlayM4_GetColorKey(PORT));
m_csInfo+=csTemp;
}
else
m_csInfo+="No;\r\n";
//
csTemp.Format("Max display buffers(frame)%d\r\n",Hik_PlayM4_GetDisplayBuf(PORT));
m_csInfo+=csTemp;
csTemp.Format("Volume:0x%X;\r\n",Hik_PlayM4_GetVolume(PORT));
m_csInfo+=csTemp;
m_csInfo+="Image qulity:";
BOOL bHiQuality=FALSE;
Hik_PlayM4_GetPictureQuality(PORT,&bHiQuality);
if(bHiQuality)
csTemp="High;\r\n";
else
csTemp="Low;\r\n";
m_csInfo+=csTemp;
m_csInfo+="TIMER:";
DWORD nTimer;
Hik_PlayM4_GetTimerType(PORT,&nTimer,NULL);
if(nTimer==TIMER_1)
csTemp="TIMER_1;\r\n";
else
csTemp="TIMER_2;\r\n";
m_csInfo+=csTemp;
DWORD nVideoRender =Hik_PlayM4_GetBufferValue(PORT,BUF_VIDEO_RENDER);
DWORD nAudioRender =Hik_PlayM4_GetBufferValue(PORT,BUF_AUDIO_RENDER);
DWORD nVideoSource =Hik_PlayM4_GetBufferValue(PORT,BUF_VIDEO_SRC);
DWORD nAudioSource =Hik_PlayM4_GetBufferValue(PORT,BUF_AUDIO_SRC);
csTemp.Format("Video render frames:%d;\r\n",nVideoRender);
m_csInfo+=csTemp;
csTemp.Format("Audio render frames:%d;\r\n",nAudioRender);
m_csInfo+=csTemp;
csTemp.Format("Video Source size:%d;\r\n",nVideoSource);
m_csInfo+=csTemp;
csTemp.Format("Audio Source size:%d;\r\n",nAudioSource);
m_csInfo+=csTemp;
GetDlgItem(IDC_INFOTEXT)->SetWindowText(m_csInfo);
}
BOOL CInfo::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
OnRefresh();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -