MatPlayBack.cpp 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. // MatPlayBack.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "newclient.h"
  5. #include "MatPlayBack.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CMatPlayBack dialog
  13. #define GETSTATE_TIMER WM_USER+1
  14. CMatPlayBack::CMatPlayBack(CWnd* pParent /*=NULL*/)
  15. : CDialog(CMatPlayBack::IDD, pParent)
  16. {
  17. //{{AFX_DATA_INIT(CMatPlayBack)
  18. m_PlayBackName = _T("");
  19. m_PlayBackIP = _T("");
  20. m_PlayBackPass = _T("");
  21. m_PlayBackChan = 0;
  22. m_PlayBackPort = 0;
  23. m_PlayBackUser = _T("");
  24. m_PlayStatus = _T("");
  25. //}}AFX_DATA_INIT
  26. m_hPlayEnableIcon = AfxGetApp()->LoadIcon(IDI_PLAY_ENABLE);
  27. m_hPlayDisableIcon = AfxGetApp()->LoadIcon(IDI_PLAY_DISABLE);
  28. m_hPauseEnableIcon = AfxGetApp()->LoadIcon(IDI_PAUSE_ENABLE);
  29. m_hPauseDisableIcon = AfxGetApp()->LoadIcon(IDI_PAUSE_DISABLE);
  30. m_hStopEnableIcon = AfxGetApp()->LoadIcon(IDI_STOP_ENABLE);
  31. m_hStopDisableIcon = AfxGetApp()->LoadIcon(IDI_STOP_DISABLE);
  32. m_hSoundStartIcon= AfxGetApp()->LoadIcon(IDI_SOUND_ENABLE);
  33. m_hSoundStopIcon= AfxGetApp()->LoadIcon(IDI_SOUND_DISABLE);
  34. m_hFastDisableIcon = AfxGetApp()->LoadIcon(IDI_FASTFORWARD_DISABLE);
  35. m_hSlowDisableIcon= AfxGetApp()->LoadIcon(IDI_FASTBACKWARD_DISABLE);
  36. m_hFastEnableIcon = AfxGetApp()->LoadIcon(IDI_FASTFORWARD_ENABLE);
  37. m_hSlowEnableIcon = AfxGetApp()->LoadIcon(IDI_FASTBACKWARD_ENABLE);
  38. m_hStepEnableIcon= AfxGetApp()->LoadIcon(IDI_STEP_ENABLE);
  39. m_hStepDisableIcon = AfxGetApp()->LoadIcon(IDI_STEP_DISABLE);
  40. m_bSound = FALSE;
  41. m_bPlay = FALSE;
  42. m_bPause = FALSE;
  43. // memset(&m_struState, 0, sizeof(m_struState));
  44. }
  45. void CMatPlayBack::DoDataExchange(CDataExchange* pDX)
  46. {
  47. CDialog::DoDataExchange(pDX);
  48. //{{AFX_DATA_MAP(CMatPlayBack)
  49. DDX_Control(pDX, IDC_COMBODECCHAN, m_DecChanCombo);
  50. DDX_Control(pDX, IDC_PROGRESS_SLIDER, m_ctlProgress);
  51. DDX_Control(pDX, IDC_DATETIMEPICKER4, m_StopTime);
  52. DDX_Control(pDX, IDC_DATETIMEPICKER3, m_StopDate);
  53. DDX_Control(pDX, IDC_DATETIMEPICKER2, m_StartTime);
  54. DDX_Control(pDX, IDC_DATETIMEPICKER1, m_StartDate);
  55. DDX_Text(pDX, IDC_EDITBACKNAME, m_PlayBackName);
  56. DDX_Text(pDX, IDC_EDITIP, m_PlayBackIP);
  57. DDX_Text(pDX, IDC_EDITPASSWD, m_PlayBackPass);
  58. DDX_Text(pDX, IDC_EDITCHAN, m_PlayBackChan);
  59. DDX_Text(pDX, IDC_EDITPORT, m_PlayBackPort);
  60. DDX_Text(pDX, IDC_EDITUSER, m_PlayBackUser);
  61. DDX_Text(pDX, IDC_PLAYSTATUS, m_PlayStatus);
  62. //}}AFX_DATA_MAP
  63. }
  64. BEGIN_MESSAGE_MAP(CMatPlayBack, CDialog)
  65. //{{AFX_MSG_MAP(CMatPlayBack)
  66. ON_WM_TIMER()
  67. ON_BN_CLICKED(IDC_FAST, OnFast)
  68. ON_BN_CLICKED(IDC_PLAY_FILE, OnPlayFile)
  69. ON_BN_CLICKED(IDC_SLOW, OnSlow)
  70. ON_BN_CLICKED(IDC_SOUND, OnSound)
  71. ON_BN_CLICKED(IDC_STEP, OnStep)
  72. ON_BN_CLICKED(IDC_STOP, OnStop)
  73. ON_WM_HSCROLL()
  74. ON_BN_CLICKED(IDC_RADIONAME, OnRadioname)
  75. ON_BN_CLICKED(IDC_RADIOTIME, OnRadiotime)
  76. ON_BN_CLICKED(IDC_SETUP, OnSetup)
  77. //}}AFX_MSG_MAP
  78. END_MESSAGE_MAP()
  79. /////////////////////////////////////////////////////////////////////////////
  80. // CMatPlayBack message handlers
  81. void CMatPlayBack::F_InitUI()
  82. {
  83. // 初始化按钮
  84. CButton *pButton;
  85. pButton = (CButton *)GetDlgItem(IDC_PLAY_FILE);
  86. pButton->SetIcon(m_hPlayDisableIcon);
  87. pButton->EnableWindow(FALSE);
  88. pButton = (CButton *)GetDlgItem(IDC_STOP);
  89. pButton->SetIcon(m_hStopDisableIcon);
  90. pButton->EnableWindow(FALSE);
  91. pButton = (CButton *)GetDlgItem(IDC_FAST);
  92. pButton->SetIcon(m_hFastDisableIcon);
  93. pButton->EnableWindow(FALSE);
  94. pButton = (CButton *)GetDlgItem(IDC_SLOW);
  95. pButton->SetIcon(m_hSlowDisableIcon);
  96. pButton->EnableWindow(FALSE);
  97. pButton = (CButton *)GetDlgItem(IDC_STEP);
  98. pButton->SetIcon(m_hStepDisableIcon);
  99. pButton->EnableWindow(FALSE);
  100. pButton = (CButton *)GetDlgItem(IDC_SOUND);
  101. pButton->SetIcon(m_hSoundStopIcon);
  102. pButton->EnableWindow(FALSE);
  103. }
  104. void CMatPlayBack::F_SetStopState()
  105. {
  106. CButton *pButton;
  107. m_ctlProgress.SetPos(0);
  108. m_ctlProgress.EnableWindow(FALSE);
  109. pButton = (CButton *)GetDlgItem(IDC_PLAY_FILE);
  110. pButton->SetIcon(m_hPlayEnableIcon);
  111. pButton->EnableWindow(TRUE);
  112. pButton = (CButton *)GetDlgItem(IDC_STOP);
  113. pButton->SetIcon(m_hStopDisableIcon);
  114. pButton->EnableWindow(FALSE);
  115. pButton = (CButton *)GetDlgItem(IDC_FAST);
  116. pButton->SetIcon(m_hFastDisableIcon);
  117. pButton->EnableWindow(FALSE);
  118. pButton = (CButton *)GetDlgItem(IDC_SLOW);
  119. pButton->SetIcon(m_hSlowDisableIcon);
  120. pButton->EnableWindow(FALSE);
  121. pButton = (CButton *)GetDlgItem(IDC_STEP);
  122. pButton->SetIcon(m_hStepDisableIcon);
  123. pButton->EnableWindow(FALSE);
  124. pButton = (CButton *)GetDlgItem(IDC_SOUND);
  125. pButton->SetIcon(m_hSoundStopIcon);
  126. pButton->EnableWindow(FALSE);
  127. }
  128. void CMatPlayBack::F_SetPlayState()
  129. {
  130. m_ctlProgress.EnableWindow(TRUE);
  131. CButton *pButton;
  132. pButton = (CButton *)GetDlgItem(IDC_PLAY_FILE);
  133. pButton->SetIcon(m_hPauseEnableIcon);
  134. pButton->EnableWindow(TRUE);
  135. pButton = (CButton *)GetDlgItem(IDC_STOP);
  136. pButton->SetIcon(m_hStopEnableIcon);
  137. pButton->EnableWindow(TRUE);
  138. pButton = (CButton *)GetDlgItem(IDC_FAST);
  139. pButton->SetIcon(m_hFastEnableIcon);
  140. pButton->EnableWindow(TRUE);
  141. pButton = (CButton *)GetDlgItem(IDC_SLOW);
  142. pButton->SetIcon(m_hSlowEnableIcon);
  143. pButton->EnableWindow(TRUE);
  144. pButton = (CButton *)GetDlgItem(IDC_SOUND);
  145. if(m_bSound)
  146. pButton->SetIcon(m_hSoundStartIcon);
  147. else
  148. pButton->SetIcon(m_hSoundStopIcon);
  149. pButton->EnableWindow(TRUE);
  150. pButton = (CButton *)GetDlgItem(IDC_STEP);
  151. pButton->SetIcon(m_hStepEnableIcon);
  152. pButton->EnableWindow(TRUE);
  153. }
  154. void CMatPlayBack::F_SetPauseState()
  155. {
  156. CButton *pButton;
  157. pButton = (CButton *)GetDlgItem(IDC_PLAY_FILE);
  158. pButton->SetIcon(m_hPlayEnableIcon);
  159. pButton->EnableWindow(TRUE);
  160. }
  161. void CMatPlayBack::EnableControl(BOOL bEnable)
  162. {
  163. GetDlgItem(IDC_EDITBACKNAME)->EnableWindow(bEnable);
  164. GetDlgItem(IDC_DATETIMEPICKER1)->EnableWindow(!bEnable);
  165. GetDlgItem(IDC_DATETIMEPICKER2)->EnableWindow(!bEnable);
  166. GetDlgItem(IDC_DATETIMEPICKER3)->EnableWindow(!bEnable);
  167. GetDlgItem(IDC_DATETIMEPICKER4)->EnableWindow(!bEnable);
  168. }
  169. BOOL CMatPlayBack::OnInitDialog()
  170. {
  171. CDialog::OnInitDialog();
  172. // TODO: Add extra initialization here
  173. F_InitUI();
  174. CString tmp;
  175. for (int i=0; i<m_iChannelNumber; i++)
  176. {
  177. tmp.Format("通道 %d", i+m_lStartChan);
  178. m_DecChanCombo.AddString(tmp);
  179. }
  180. m_DecChanCombo.SetCurSel(0);
  181. m_ctlProgress.SetRange(0, 100);
  182. m_ctlProgress.SetPos(0);
  183. SYSTEMTIME st;
  184. GetSystemTime(&st);
  185. m_StartDate.SetTime(&st);
  186. m_StartTime.SetTime(&st);
  187. m_StopDate.SetTime(&st);
  188. m_StopTime.SetTime(&st);
  189. CheckRadioButton(IDC_RADIONAME, IDC_RADIOTIME, IDC_RADIONAME);
  190. EnableControl(TRUE);
  191. F_SetStopState();
  192. UpdateData(FALSE);
  193. return TRUE; // return TRUE unless you set the focus to a control
  194. // EXCEPTION: OCX Property Pages should return FALSE
  195. }
  196. void CMatPlayBack::OnTimer(UINT nIDEvent)
  197. {
  198. CDialog::OnTimer(nIDEvent);
  199. // NET_DVR_MATRIX_DEC_CHAN_STATUS MDStatus;
  200. CString tmp;
  201. // TODO: Add your message handler code here and/or call default
  202. if (nIDEvent == GETSTATE_TIMER)
  203. {
  204. if (m_bPlay)
  205. {
  206. // //播放时先去获取解码通道状态
  207. // memset(&MDStatus, 0, sizeof(MDStatus));
  208. // if (!NET_DVR_MatrixGetDecChanStatus(m_lServerID, m_DecChanCombo.GetCurSel()+m_lStartChan, &MDStatus))
  209. // {
  210. // tmp.Format("Error: NET_DVR_MatrixGetDecChanStatus = %d", NET_DVR_GetLastError());
  211. // AfxMessageBox(tmp);
  212. // }
  213. // else
  214. // {
  215. // //如果设备尚未连接,则不去获取播放参数
  216. // if (!MDStatus.dwIsLinked)
  217. // {
  218. // AfxMessageBox("设备尚未连接,请稍候!");
  219. // }
  220. // else
  221. // {
  222. // UpdateData(TRUE);
  223. // memset(&m_struState, 0, sizeof(m_struState));
  224. // if (!NET_DVR_MatrixGetRemotePlayStatus(m_lServerID, m_DecChanCombo.GetCurSel()+m_lStartChan, &m_struState))
  225. // {
  226. // tmp.Format("Error: NET_DVR_MatrixGetRemotePlayStatus = %d", NET_DVR_GetLastError());
  227. // AfxMessageBox(tmp);
  228. // }
  229. // else
  230. // {
  231. // m_PlayStatus.Format("位置: %ld/%ld 时间: %ld/%ld 帧数: %ld/%ld 命令: 0x%x 参数: 0x%x",
  232. // m_struState.dwCurMediaFilePosition, m_struState.dwCurMediaFileLen, m_struState.dwCurPlayTime,
  233. // m_struState.dwCurMediaFileDuration, m_struState.dwCurPlayFrame, m_struState.dwCurMediaFIleFrames,
  234. // m_struState.dwCurPlayCmd, m_struState.dwCurPlayCmdParam);
  235. //
  236. // if (m_struState.dwCurMediaFileLen)
  237. // {
  238. // m_ctlProgress.SetPos((m_struState.dwCurMediaFilePosition*100)/m_struState.dwCurMediaFileLen);
  239. // }
  240. // TRACE("\n### m_struState.dwCurMediaFileDuration = %ld, m_struState.dwCurPlayTime = %ld\n",
  241. // m_struState.dwCurMediaFileDuration, m_struState.dwCurPlayTime);
  242. //
  243. // //该结束了
  244. // if (m_struState.dwCurMediaFileDuration == m_struState.dwCurPlayTime)
  245. // {
  246. // m_ctlProgress.SetPos(0);
  247. // m_bPlay = FALSE;
  248. // m_bPause = FALSE;
  249. // F_SetStopState();
  250. // MessageBox("回放结束!");
  251. // }
  252. // }
  253. // UpdateData(FALSE);
  254. // }
  255. // }
  256. }
  257. }
  258. }
  259. void CMatPlayBack::OnFast()
  260. {
  261. // TODO: Add your control notification handler code here
  262. // if (!NET_DVR_MatrixSetRemotePlayControl(m_lServerID, m_DecChanCombo.GetCurSel()+m_lStartChan, NET_DVR_PLAYFAST, 2, NULL))
  263. // {
  264. // CString tmp;
  265. // tmp.Format("Error: NET_DVR_MatrixSetRemotePlayControl = %d", NET_DVR_GetLastError());
  266. // AfxMessageBox(tmp);
  267. // }
  268. }
  269. void CMatPlayBack::OnPlayFile()
  270. {
  271. UpdateData(TRUE);
  272. // TODO: Add your control notification handler code here
  273. // if (m_bPause && m_bPlay)
  274. // {
  275. // if (!NET_DVR_MatrixSetRemotePlayControl(m_lServerID, m_DecChanCombo.GetCurSel()+m_lStartChan, NET_DVR_PLAYRESTART, 0, NULL))
  276. // {
  277. // CString tmp;
  278. // tmp.Format("Error: NET_DVR_MatrixSetRemotePlayControl = %d", NET_DVR_GetLastError());
  279. // AfxMessageBox(tmp);
  280. // return;
  281. // }
  282. // m_bPause = FALSE;
  283. // F_SetPlayState();
  284. // }
  285. // else if (m_bPlay)
  286. // {
  287. // if (!NET_DVR_MatrixSetRemotePlayControl(m_lServerID, m_DecChanCombo.GetCurSel()+m_lStartChan, NET_DVR_PLAYPAUSE, 0, NULL))
  288. // {
  289. // CString tmp;
  290. // tmp.Format("Error: NET_DVR_MatrixSetRemotePlayControl = %d", NET_DVR_GetLastError());
  291. // AfxMessageBox(tmp);
  292. // return;
  293. // }
  294. // m_bPause = TRUE;
  295. // F_SetPauseState();
  296. // }
  297. // else
  298. // {
  299. // if (!NET_DVR_MatrixSetRemotePlayControl(m_lServerID, m_DecChanCombo.GetCurSel()+m_lStartChan, NET_DVR_PLAYSTART, 0, NULL))
  300. // {
  301. // CString tmp;
  302. // tmp.Format("Error: NET_DVR_MatrixSetRemotePlayControl = %d", NET_DVR_GetLastError());
  303. // AfxMessageBox(tmp);
  304. // return;
  305. // }
  306. // m_bPlay = TRUE;
  307. // m_bPause = FALSE;
  308. // F_SetPlayState();
  309. // SetTimer(GETSTATE_TIMER, 1000, NULL);
  310. // }
  311. //
  312. // UpdateData(FALSE);
  313. }
  314. void CMatPlayBack::OnSlow()
  315. {
  316. // TODO: Add your control notification handler code here
  317. // if (!NET_DVR_MatrixSetRemotePlayControl(m_lServerID, m_DecChanCombo.GetCurSel()+m_lStartChan, NET_DVR_PLAYSLOW, 2, NULL))
  318. // {
  319. // CString tmp;
  320. // tmp.Format("Error: NET_DVR_MatrixSetRemotePlayControl = %d", NET_DVR_GetLastError());
  321. // AfxMessageBox(tmp);
  322. // }
  323. }
  324. void CMatPlayBack::OnSound()
  325. {
  326. // TODO: Add your control notification handler code here
  327. // if (m_bSound)
  328. // {
  329. // if (!NET_DVR_MatrixSetRemotePlayControl(m_lServerID, m_DecChanCombo.GetCurSel()+m_lStartChan, NET_DVR_PLAYSTOPAUDIO, 0, NULL))
  330. // {
  331. // CString tmp;
  332. // tmp.Format("Error: NET_DVR_MatrixSetRemotePlayControl = %d", NET_DVR_GetLastError());
  333. // AfxMessageBox(tmp);
  334. // return;
  335. // }
  336. // m_bSound = FALSE;
  337. // }
  338. // else
  339. // {
  340. // if (!NET_DVR_MatrixSetRemotePlayControl(m_lServerID, m_DecChanCombo.GetCurSel()+m_lStartChan, NET_DVR_PLAYSTARTAUDIO, 0, NULL))
  341. // {
  342. // CString tmp;
  343. // tmp.Format("Error: NET_DVR_MatrixSetRemotePlayControl = %d", NET_DVR_GetLastError());
  344. // AfxMessageBox(tmp);
  345. // return;
  346. // }
  347. // m_bSound = TRUE;
  348. // }
  349. }
  350. //在这里做正常播放用
  351. void CMatPlayBack::OnStep()
  352. {
  353. // TODO: Add your control notification handler code here
  354. // if (!NET_DVR_MatrixSetRemotePlayControl(m_lServerID, m_DecChanCombo.GetCurSel()+m_lStartChan, NET_DVR_PLAYNORMAL, 0, NULL))
  355. // {
  356. // CString tmp;
  357. // tmp.Format("Error: NET_DVR_MatrixSetRemotePlayControl = %d", NET_DVR_GetLastError());
  358. // AfxMessageBox(tmp);
  359. // }
  360. }
  361. void CMatPlayBack::OnStop()
  362. {
  363. UpdateData(TRUE);
  364. // TODO: Add your control notification handler code here
  365. // if (!NET_DVR_MatrixSetRemotePlayControl(m_lServerID, m_DecChanCombo.GetCurSel()+m_lStartChan, NET_DVR_PLAYSTOP, 0, NULL))
  366. // {
  367. // CString tmp;
  368. // tmp.Format("Error: NET_DVR_MatrixSetRemotePlayControl = %d", NET_DVR_GetLastError());
  369. // AfxMessageBox(tmp);
  370. // return;
  371. // }
  372. // m_PlayStatus.Empty();
  373. // m_bPlay = FALSE;
  374. // m_bPause = FALSE;
  375. // F_SetStopState();
  376. // KillTimer(GETSTATE_TIMER);
  377. //
  378. // UpdateData(FALSE);
  379. }
  380. void CMatPlayBack::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
  381. {
  382. CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
  383. // TODO: Add your message handler code here and/or call default
  384. if (GetDlgItem(IDC_PROGRESS_SLIDER) == pScrollBar)
  385. {
  386. // if (m_bPlay)
  387. // {
  388. // int pos = m_ctlProgress.GetPos();
  389. // DWORD retVal = 0;
  390. // if (!NET_DVR_MatrixSetRemotePlayControl(m_lServerID, m_DecChanCombo.GetCurSel()+m_lStartChan, NET_DVR_PLAYSETPOS, pos, &retVal))
  391. // {
  392. // CString tmp;
  393. // tmp.Format("Error: NET_DVR_MatrixSetRemotePlayControl = %d", NET_DVR_GetLastError());
  394. // AfxMessageBox(tmp);
  395. // }
  396. // }
  397. }
  398. }
  399. void CMatPlayBack::OnRadioname()
  400. {
  401. // TODO: Add your control notification handler code here
  402. UpdateData(TRUE);
  403. CheckRadioButton(IDC_RADIONAME, IDC_RADIOTIME, IDC_RADIONAME);
  404. EnableControl(TRUE);
  405. UpdateData(FALSE);
  406. }
  407. void CMatPlayBack::OnRadiotime()
  408. {
  409. // TODO: Add your control notification handler code here
  410. UpdateData(TRUE);
  411. CheckRadioButton(IDC_RADIONAME, IDC_RADIOTIME, IDC_RADIOTIME);
  412. EnableControl(FALSE);
  413. UpdateData(FALSE);
  414. }
  415. void CMatPlayBack::OnSetup()
  416. {
  417. // TODO: Add your control notification handler code here
  418. UpdateData(TRUE);
  419. // NET_DVR_MATRIX_DEC_REMOTE_PLAY struPlay;
  420. // memset(&struPlay, 0, sizeof(struPlay));
  421. // struPlay.dwSize = sizeof(struPlay);
  422. //
  423. // sprintf(struPlay.sDVRIP, "%s", m_PlayBackIP);
  424. // struPlay.wDVRPort = m_PlayBackPort;
  425. // struPlay.byChannel = m_PlayBackChan;
  426. // sprintf((char *)struPlay.sUserName, "%s", m_PlayBackUser);
  427. // sprintf((char *)struPlay.sPassword, "%s", m_PlayBackPass);
  428. //
  429. // if (GetCheckedRadioButton(IDC_RADIONAME, IDC_RADIOTIME) == IDC_RADIOTIME)
  430. // {
  431. // SYSTEMTIME st;
  432. // m_StartDate.GetTime(&st);
  433. // struPlay.StartTime.dwYear = st.wYear;
  434. // struPlay.StartTime.dwMonth = st.wMonth;
  435. // struPlay.StartTime.dwDay = st.wDay;
  436. // m_StartTime.GetTime(&st);
  437. // struPlay.StartTime.dwHour = st.wHour;
  438. // struPlay.StartTime.dwMinute = st.wMinute;
  439. // struPlay.StartTime.dwSecond = st.wSecond;
  440. //
  441. // m_StopDate.GetTime(&st);
  442. // struPlay.StopTime.dwYear = st.wYear;
  443. // struPlay.StopTime.dwMonth = st.wMonth;
  444. // struPlay.StopTime.dwDay = st.wDay;
  445. // m_StopTime.GetTime(&st);
  446. // struPlay.StopTime.dwHour = st.wHour;
  447. // struPlay.StopTime.dwMinute = st.wMinute;
  448. // struPlay.StopTime.dwSecond = st.wSecond;
  449. //
  450. // struPlay.dwPlayMode = 1;
  451. // }
  452. // else
  453. // {
  454. // sprintf(struPlay.sFileName, "%s", m_PlayBackName);
  455. // struPlay.dwPlayMode = 0;
  456. // }
  457. //
  458. // if (!NET_DVR_MatrixSetRemotePlay(m_lServerID, m_DecChanCombo.GetCurSel()+m_lStartChan, &struPlay))
  459. // {
  460. // CString tmp;
  461. // tmp.Format("Error: NET_DVR_MatrixSetRemotePlay = %d", NET_DVR_GetLastError());
  462. // AfxMessageBox(tmp);
  463. // return;
  464. // }
  465. // OnPlayFile();
  466. // MessageBox("设置成功!");
  467. }