📄 reccing.cpp
字号:
// Reccing.cpp : implementation file
//
#include "stdafx.h"
#include "bxt.h"
#include "Reccing.h"
#include "bxtdlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Reccing dialog
Reccing::Reccing(CWnd* pParent /*=NULL*/)
: CDialog(Reccing::IDD, pParent)
{
//{{AFX_DATA_INIT(Reccing)
m_Frames =0;
//}}AFX_DATA_INIT
}
void Reccing::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(Reccing)
DDX_Control(pDX, IDC_BUTTON7, m_bt7);
DDX_Control(pDX, IDC_BUTTON6, m_bt6);
DDX_Text(pDX, IDC_EDIT4, m_Frames);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(Reccing, CDialog)
//{{AFX_MSG_MAP(Reccing)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
ON_BN_CLICKED(IDC_BUTTON6, OnButton6)
ON_BN_CLICKED(IDC_BUTTON10, OnButton10)
ON_BN_CLICKED(IDC_BUTTON7, OnButton7)
ON_BN_CLICKED(IDC_BUTTON8, OnButton8)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Reccing message handlers
void Reccing::OnButton2()
{
if (((CBxtDlg*)AfxGetMainWnd())->geninfo->m_isnew) return;
((CBxtDlg*)AfxGetMainWnd())->rec->SendMessage(WX_RECONE, 0, 0);
}
void Reccing::OnButton3()
{
if ( ((CBxtDlg*)AfxGetMainWnd())->rec->CapturedNum>1 )
{
CString picpath;
picpath = ((CBxtDlg *)AfxGetMainWnd())->m_workingpath ;
//picpath += m_id;
picpath += "\\";
((CBxtDlg *)AfxGetMainWnd())->imgpcs->ReFresh(picpath.GetBuffer(picpath.GetLength()));
((CBxtDlg *)AfxGetMainWnd())->m_m.SelectTab(1);
((CBxtDlg *)AfxGetMainWnd())->TabSelChange(IDC_TAB1,0);
}
}
void Reccing::OnButton4()
{
if (((CBxtDlg *)AfxGetMainWnd())->geninfo->m_isnew) return;
UpdateData(TRUE);
if (m_Frames <= 0)
{
m_Frames = 20;
UpdateData(FALSE);
}
m_bt6.SetWindowText( "开始存盘");
((CBxtDlg*)AfxGetMainWnd())->rec->SendMessage(WX_RECONE, m_Frames, 0);
}
void Reccing::OnButton6()
{
// TODO: Add your control notification handler code here
m_bt6.SetWindowText( "请稍后");
((CBxtDlg*)AfxGetMainWnd())->rec->SaveDataToDisk();
::MessageBeep(MB_OK);
m_bt6.SetWindowText( "存盘完成");
}
void Reccing::OnButton7()
{
// TODO: Add your control notification handler code here
bool bForword=RecImage::bForwordCap;
bForword=bForword?0:1;
RecImage::bForwordCap=bForword;
if(bForword)
m_bt7.SetWindowText("停止前向采集");
else
m_bt7.SetWindowText("前向采集");
}
BOOL Reccing::OnInitDialog()
{
CDialog::OnInitDialog();
m_Frames = 20;
UpdateData(false);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
extern "C"{
__declspec (dllimport) int Stop_Flag;
__declspec (dllimport) HWND hWnd;
__declspec (dllimport) char strFileName[256];
__declspec (dllimport) DWORD WINAPI DecodeAndPlay(LPVOID lpVoid);
}
void Reccing::OnButton10()
{
// TODO: Add your control notification handler code here
okStopCapture(((CBxtDlg*)AfxGetMainWnd())->rec->hpcih);
hWnd=((CBxtDlg*)AfxGetMainWnd())->rec->m_hWnd;
((CBxtDlg*)AfxGetMainWnd())->rec->Invalidate(1);
//Stop_Flag=1;
strcpy(strFileName,"D:\\data\\out2.m2v");
CreateThread(0,0,DecodeAndPlay,0,0,0);
}
void Reccing::OnButton8()
{
// TODO: Add your control notification handler code here
okStopCapture(((CBxtDlg*)AfxGetMainWnd())->rec->hpcih);
hWnd=((CBxtDlg*)AfxGetMainWnd())->rec->m_hWnd;
((CBxtDlg*)AfxGetMainWnd())->rec->Invalidate(1);
//Stop_Flag=1;
strcpy(strFileName,"D:\\data\\out1.m2v");
CreateThread(0,0,DecodeAndPlay,0,0,0);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -