www.pudn.com > 数字硬盘录像机软件代码.rar > DAYPLAYDLG.CPP


// DayPlayDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "gtmpeg.h" 
#include "DayPlayDlg.h" 
#include "FileSortDlg.h" 
#include "GtMpegWnd.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
///////////////////////////////////////////////////////////////////////////// 
// 
///////////////////////////////////////////////////////////////////////////// 
CDayPlayDlg::CDayPlayDlg(CGtMpegWnd* pParent /*=NULL*/) 
	: CDialog(CDayPlayDlg::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CDayPlayDlg) 
	m_Date = COleDateTime::GetCurrentTime(); 
	//}}AFX_DATA_INIT 
    m_pParentWnd=pParent; 
} 
///////////////////////////////////////////////////////////////////////////// 
// 
///////////////////////////////////////////////////////////////////////////// 
void CDayPlayDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CDayPlayDlg) 
	DDX_Control(pDX, IDC_RECORD_DATE, m_cRecordDate); 
	DDX_Control(pDX, IDC_CHANNEL_BOX, m_cChannelBox); 
	DDX_DateTimeCtrl(pDX, IDC_RECORD_DATE, m_Date); 
	//}}AFX_DATA_MAP 
	DDX_Control(pDX, IDC_TIME_GRID, m_cTimeGrid); 
} 
///////////////////////////////////////////////////////////////////////////// 
// 
///////////////////////////////////////////////////////////////////////////// 
BEGIN_MESSAGE_MAP(CDayPlayDlg, CDialog) 
	//{{AFX_MSG_MAP(CDayPlayDlg) 
	ON_CBN_CLOSEUP(IDC_CHANNEL_BOX, OnCloseupChannelBox) 
	ON_NOTIFY(DTN_CLOSEUP, IDC_RECORD_DATE, OnCloseupRecordDate) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
///////////////////////////////////////////////////////////////////////////// 
// 
///////////////////////////////////////////////////////////////////////////// 
BOOL CDayPlayDlg::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
	for(DWORD i=0;im_arPlayList.SetSize(0); 
	g_pDevice[m_nChannel]->m_arFileName.SetSize(0); 
    for(int i=1;im_arPlayList.GetAt(g_pDevice[m_nChannel]->m_arPlayList.GetSize()-1); 
									int nEndRow=i-1,nEndCol=j-1; 
									if(j==1) 
									{ 
									   nEndRow--; 
									   nEndCol=59;//m_cTimeGrid.m_nCols-1; 
									} 
									pList->m_sEndTime.Format("%02d:%02d",nEndRow,nEndCol-1); 
									bSection=FALSE; 
								  } 
			                      break; 
		      case GVIS_SELECTED: 
                                 if(!bSection) 
								 { 
								   pList=new CPlayList; 
								   g_pDevice[m_nChannel]->m_arPlayList.Add(pList); 
								   pList->m_nChannel=m_nChannel; 
								   pList->m_sPlayDate=sDate; 
								   pList->m_sStartTime.Format("%02d:%02d",i-1,j-1); 
								   bSection=TRUE; 
								 } 
			                     break; 
		   } 
	   } 
	} 
    if(!g_pDevice[m_nChannel]->EnablePlayFile(sDate,GetAppPath()+"Mpeg",g_pDevice[m_nChannel]->m_arFileName)==FALSE) 
	{ 
	} 
	if(!g_pDevice[m_nChannel]->CheckPlayFile()) 
	{ 
	   MessageBox("所选择的时间段没有进行录像,请重新选择!"); 
	   return; 
	} 
#ifdef _DEBUG 
     CFileSortDlg dlg(m_nChannel); 
	 if(dlg.DoModal()==IDCANCEL) 
	    return; 
#endif 
	CDialog::OnOK(); 
} 
///////////////////////////////////////////////////////////////////////////// 
// 
///////////////////////////////////////////////////////////////////////////// 
void CDayPlayDlg::OnCloseupChannelBox()  
{ 
   int nIndex=m_cChannelBox.GetCurSel(); 
   if(nIndex!=m_nChannel) 
   { 
      m_nChannel=nIndex; 
   	  for(int i=1;i