Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

578 lines
15 KiB

  1. /*
  2. ԊǗNXNX
  3. iNP2)@Sachiko Yasukawa
  4. */
  5. #include "stdafx.h"
  6. #include "includes.h"
  7. #include "classlib.h"
  8. void CMPEGBoardState::SetState(LIBSTATE State)
  9. {
  10. m_State = State;
  11. switch(m_State){
  12. case PowerOff:
  13. m_pStateObject = &m_PowerOffState;
  14. DBG_PRINTF(("CLASSLIB: STATE = POWEROFF\n"));
  15. #ifdef TEST
  16. TRACE("STATE = POWEROFF\n");
  17. #endif
  18. break;
  19. case Stop:
  20. m_pStateObject = &m_StopState;
  21. #ifdef TEST
  22. TRACE("STATE = STOP\n");
  23. #endif
  24. DBG_PRINTF(("CLASSLIB: STATE = STOP\n"));
  25. break;
  26. case Pause:
  27. m_pStateObject = &m_PauseState;
  28. #ifdef TEST
  29. TRACE("STATE = PAUSE\n");
  30. #endif
  31. DBG_PRINTF(("CLASSLIB: STATE = PAUSE\n"));
  32. break;
  33. case Play:
  34. m_pStateObject = &m_PlayState;
  35. #ifdef TEST
  36. TRACE("STATE = PLAY\n");
  37. #endif
  38. DBG_PRINTF(("CLASSLIB: STATE = PLAY\n"));
  39. break;
  40. case Slow:
  41. m_pStateObject = &m_SlowState;
  42. #ifdef TEST
  43. TRACE("STATE = SLOW\n");
  44. #endif
  45. DBG_PRINTF(("CLASSLIB: STATE = SLOW\n"));
  46. break;
  47. default:
  48. m_pStateObject = &m_ScanState;
  49. #ifdef TEST
  50. TRACE("STATE = SCAN\n");
  51. #endif
  52. DBG_PRINTF(("CLASSLIB: STATE = SCAN\n"));
  53. break;
  54. }
  55. }
  56. BOOL CPowerOffState::ChangePowerOff(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  57. {
  58. return TRUE;
  59. }
  60. BOOL CPowerOffState::ChangeStop(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL,CBaseStream *pStream)
  61. {
  62. HALRESULT st;
  63. if((st = pCHAL->SetPowerState(POWERSTATE_ON)) != HAL_SUCCESS){
  64. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE POWERON\n");
  65. DBG_PRINTF(("CLASSLIB:CPowerOffState::ChangeStpe:HAL CAN'T CHANGE POWERON\n"));
  66. DBG_BREAK();
  67. return FALSE;
  68. }
  69. if((st = pSHAL->SetPlayStop()) != HAL_SUCCESS){
  70. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE STOP\n");
  71. DBG_PRINTF(("CLASSLIB:CPowerOffState::ChangeState:HAL CAN'T CHANGE STOP\n"));
  72. DBG_BREAK();
  73. return FALSE;
  74. }
  75. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Stop);
  76. return TRUE;
  77. }
  78. BOOL CPowerOffState::ChangePause(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  79. {
  80. _RPTF0(_CRT_WARN, "CAN'T CHANGE FROM POWERSTATE TO PAUSE\n");
  81. DBG_PRINTF(("CLASSLIB:CPowerOffState::ChangeState:CAN'T CHANGE FROM POWERSTATE TO PAUSE\n"));
  82. DBG_BREAK();
  83. return FALSE;
  84. }
  85. BOOL CPowerOffState::ChangePlay(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  86. {
  87. _RPTF0(_CRT_WARN, "CAN'T CHANGE FROM POWERSTATE TO PLAY\n");
  88. DBG_PRINTF(("CLASSLIB:CPowerOffState::ChangePlay:CAN'T CHANGE FROM POWERSTATE TO PLAY\n"));
  89. DBG_BREAK();
  90. return FALSE;
  91. }
  92. BOOL CPowerOffState::ChangePauseViaSingleStep(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  93. {
  94. _RPTF0(_CRT_WARN, "CAN'T CHANGE FROM POWERSTATE TO PAUSEVIASINGLESTEPE\n");
  95. DBG_PRINTF(("CLASSLIB:CPowerOffState::ChangePauseViaSingleStep:CAN'T CHANGE FROM POWERSTATE TO PAUSEVIASINGLESTEPE\n"));
  96. DBG_BREAK();
  97. return FALSE;
  98. }
  99. BOOL CPowerOffState::ChangeSlow(DWORD Speed, IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  100. {
  101. _RPTF0(_CRT_WARN, "CAN'T CHANGE FROM POWERSTATE TO SLOW\n");
  102. DBG_PRINTF(("CLASSLIB:CPowerOffState::ChangeSlow:CAN'T CHANGE FROM POWERSTATE TO SLOW\n"));
  103. DBG_BREAK();
  104. return FALSE;
  105. }
  106. BOOL CPowerOffState::ChangeScan(DWORD Speed, IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  107. {
  108. _RPTF0(_CRT_WARN, "CAN'T CHANGE FROM POWERSTATE TO SCAN\n");
  109. DBG_PRINTF(("CLASSLIB:CPowerOffState::ChangeScan:CAN'T CHANGE FROM POWERSTATE TO SCAN\n"));
  110. DBG_BREAK();
  111. return FALSE;
  112. }
  113. BOOL CStopState::ChangePowerOff(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  114. {
  115. BOOL st;
  116. if((st = pCHAL->SetPowerState(POWERSTATE_OFF)) != HAL_SUCCESS){
  117. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE POWEROFF\n");
  118. DBG_PRINTF(("CLASSLIB:CStopState::ChangePowerOff:HAL CAN'T CHANGE POWEROFF\n"));
  119. DBG_BREAK();
  120. return FALSE;
  121. }
  122. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(PowerOff);
  123. return TRUE;
  124. }
  125. BOOL CStopState::ChangeStop(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL,CBaseStream *pStream)
  126. {
  127. return TRUE;
  128. }
  129. BOOL CStopState::ChangePause(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  130. {
  131. BOOL st;
  132. if((st = pSHAL->SetPlayPause()) != HAL_SUCCESS){
  133. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE PAUSE\n");
  134. DBG_PRINTF(("CLASSLIB:CStopState::ChangePause:HAL CAN'T CHANGE PAUSE\n"));
  135. DBG_BREAK();
  136. return FALSE;
  137. }
  138. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Pause);
  139. return TRUE;
  140. }
  141. BOOL CStopState::ChangePlay(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  142. {
  143. _RPTF0(_CRT_WARN, "CAN'T CHANGE FROM STOP TO PLAY\n");
  144. DBG_PRINTF(("CLASSLIB:CStopState::ChangePlay:CAN'T CHANGE FROM STOP TO PLAY\n"));
  145. DBG_BREAK();
  146. return FALSE;
  147. }
  148. BOOL CStopState::ChangePauseViaSingleStep(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  149. {
  150. _RPTF0(_CRT_WARN, "CAN'T CHANGE FROM STOP TO PAUSEVIASINGLESTEP\n");
  151. DBG_PRINTF(("CLASSLIB:CStopState::ChangePauseViaSingleStep:CAN'T CHANGE FROM STOP TO PAUSEVIASINGLESTEP\n"));
  152. DBG_BREAK();
  153. return FALSE;
  154. }
  155. BOOL CStopState::ChangeSlow(DWORD Speed, IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  156. {
  157. _RPTF0(_CRT_WARN, "CAN'T CHANGE FROM STOP TO SLOW\n");
  158. DBG_PRINTF(("CLASSLIB:CStopState::ChangeSlow:CAN'T CHANGE FROM STOP TO SLOW\n"));
  159. DBG_BREAK();
  160. return FALSE;
  161. }
  162. BOOL CStopState::ChangeScan(DWORD Speed, IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  163. {
  164. _RPTF0(_CRT_WARN, "CAN'T CHANGE FROM POWERSTATE TO SCAN\n");
  165. DBG_PRINTF(("CLASSLIB:CStopState::ChangeScan:CAN'T CHANGE FROM STOP TO SCAN\n"));
  166. DBG_BREAK();
  167. return FALSE;
  168. }
  169. BOOL CPauseState::ChangePowerOff(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  170. {
  171. _RPTF0(_CRT_WARN, "CAN'T CHANGE FROM PAUSE TO POWEROFF\n");
  172. DBG_PRINTF(("CLASSLIB:CPauseState::ChangePowerOff:CAN'T CHANGE FROM PAUSE TO POWEROFF\n"));
  173. DBG_BREAK();
  174. return FALSE;
  175. }
  176. BOOL CPauseState::ChangeStop(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL,CBaseStream *pStream)
  177. {
  178. HALRESULT st;
  179. if((st = pSHAL->SetPlayStop()) != HAL_SUCCESS){
  180. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE STOP\n");
  181. DBG_PRINTF(("CLASSLIB:CPauseState::ChangeStop:HAL CAN'T CHANGE FROM PAUSE TO STOP\n"));
  182. DBG_BREAK();
  183. return FALSE;
  184. }
  185. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Stop);
  186. pStream->FlushTransferBuffer();
  187. return TRUE;
  188. }
  189. BOOL CPauseState::ChangePause(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  190. {
  191. return TRUE;
  192. }
  193. BOOL CPauseState::ChangePlay(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  194. {
  195. HALRESULT st;
  196. if((st = pSHAL->SetPlayNormal()) != HAL_SUCCESS){
  197. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE PLAY\n");
  198. DBG_PRINTF(("CLASSLIB:CPauseState::ChangePlay:HAL CAN'T CHANGE FROM PAUSE TO PLAY\n"));
  199. DBG_BREAK();
  200. return FALSE;
  201. }
  202. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Play);
  203. return TRUE;
  204. }
  205. BOOL CPauseState::ChangePauseViaSingleStep(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  206. {
  207. HALRESULT st;
  208. if((st = pSHAL->SetPlaySingleStep()) != HAL_SUCCESS){
  209. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE PAUSEVIASINGLESTEP\n");
  210. DBG_PRINTF(("CLASSLIB:CPauseState::ChangePauseViaSingleStep:HAL CAN'T CHANGE FROM PAUSE TO SINGLESTEPn"));
  211. DBG_BREAK();
  212. return FALSE;
  213. }
  214. return TRUE;
  215. }
  216. BOOL CPauseState::ChangeSlow(DWORD Speed, IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  217. {
  218. HALRESULT st;
  219. if((st = pSHAL->SetPlaySlow(Speed)) != HAL_SUCCESS){
  220. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE SLOW\n");
  221. DBG_PRINTF(("CLASSLIB:CPauseState::ChangeSlow:CAN'T CHANGE FROM PAUSE TO SLOW\n"));
  222. DBG_BREAK();
  223. return FALSE;
  224. }
  225. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Slow);
  226. return TRUE;
  227. }
  228. BOOL CPauseState::ChangeScan(DWORD Speed, IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  229. {
  230. HALRESULT st;
  231. if((st = pSHAL->SetPlayScan(Speed)) != HAL_SUCCESS){
  232. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE SCAN\n");
  233. DBG_PRINTF(("CLASSLIB:CPauseState::ChangeScan:HAL CAN'T CHANGE FROM PAUSE TO SCAN\n"));
  234. DBG_BREAK();
  235. return FALSE;
  236. }
  237. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Scan);
  238. return TRUE;
  239. }
  240. BOOL CPlayState::ChangePowerOff(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  241. {
  242. _RPTF0(_CRT_WARN, "CAN'T CHANGE FROM PLAY TO POWEROFF\n");
  243. DBG_PRINTF(("CLASSLIB:CPlayState::ChangePowerOff:CAN'T CHANGE FROM PLAY TO POWEROFF\n"));
  244. DBG_BREAK();
  245. return FALSE;
  246. }
  247. BOOL CPlayState::ChangeStop(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL,CBaseStream *pStream)
  248. {
  249. HALRESULT st;
  250. if((st = pSHAL->SetPlayStop()) != HAL_SUCCESS){
  251. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE PLAY\n");
  252. DBG_PRINTF(("CLASSLIB:CPlayState::ChangeStop:HAL CAN'T CHANGE FROM PLAY TO STOP\n"));
  253. DBG_BREAK();
  254. return FALSE;
  255. }
  256. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Stop);
  257. pStream->FlushTransferBuffer();
  258. return TRUE;
  259. }
  260. BOOL CPlayState::ChangePause(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  261. {
  262. HALRESULT st;
  263. if((st = pSHAL->SetPlayPause()) != HAL_SUCCESS){
  264. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE PAUSE\n");
  265. DBG_PRINTF(("CLASSLIB:CPlayState::ChangePause:HAL CAN'T CHANGE FROM PLAY TO PAUSE\n"));
  266. DBG_BREAK();
  267. return FALSE;
  268. }
  269. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Pause);
  270. return TRUE;
  271. }
  272. BOOL CPlayState::ChangePlay(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  273. {
  274. return TRUE;
  275. }
  276. BOOL CPlayState::ChangePauseViaSingleStep(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  277. {
  278. HALRESULT st;
  279. //�{���͑J�ڂł��Ȃ��H
  280. if((st = pSHAL->SetPlaySingleStep()) != HAL_SUCCESS){
  281. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE FROM PAUSE TO \n");
  282. DBG_PRINTF(("CLASSLIB:CPlayState::ChangePowerOff:HAL CAN'T CHANGE FROM PLAY TO POWEROFF\n"));
  283. DBG_BREAK();
  284. return FALSE;
  285. }
  286. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Pause);
  287. return TRUE;
  288. }
  289. BOOL CPlayState::ChangeSlow(DWORD Speed, IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  290. {
  291. HALRESULT st;
  292. if((st = pSHAL->SetPlaySlow(Speed)) != HAL_SUCCESS){
  293. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE SLOW\n");
  294. DBG_PRINTF(("CLASSLIB:CPlayState::ChangeSlow:HAL CAN'T CHANGE FROM PLAY TO SLOW\n"));
  295. DBG_BREAK();
  296. return FALSE;
  297. }
  298. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Slow);
  299. return TRUE;
  300. }
  301. BOOL CPlayState::ChangeScan(DWORD Speed, IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  302. {
  303. HALRESULT st;
  304. if((st = pSHAL->SetPlayScan(Speed)) != HAL_SUCCESS){
  305. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE SCAN\n");
  306. DBG_PRINTF(("CLASSLIB:CPlayState::ChangeScan:HAL CAN'T CHANGE FROM PLAY TO SCAN\n"));
  307. DBG_BREAK();
  308. return FALSE;
  309. }
  310. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Scan);
  311. return TRUE;
  312. }
  313. BOOL CSlowState::ChangePowerOff(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  314. {
  315. _RPTF0(_CRT_WARN, "CAN'T CHANGE FROM SLOW TO POWEROFF\n");
  316. DBG_PRINTF(("CLASSLIB:CSlowState::ChangePowerOff:CAN'T CHANGE FROM STLOW TO POWEROFF\n"));
  317. DBG_BREAK();
  318. return FALSE;
  319. }
  320. BOOL CSlowState::ChangeStop(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL,CBaseStream *pStream)
  321. {
  322. HALRESULT st;
  323. if((st = pSHAL->SetPlayStop()) != HAL_SUCCESS){
  324. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE STOP\n");
  325. DBG_PRINTF(("CLASSLIB:CSlowState::ChangeStop:HAL CAN'T CHANGE FROM STLOW TO STOP\n"));
  326. DBG_BREAK();
  327. return FALSE;
  328. }
  329. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Stop);
  330. pStream->FlushTransferBuffer();
  331. return TRUE;
  332. }
  333. BOOL CSlowState::ChangePause(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  334. {
  335. HALRESULT st;
  336. if((st = pSHAL->SetPlayPause()) != HAL_SUCCESS){
  337. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE PAUSE\n");
  338. DBG_PRINTF(("CLASSLIB:CSlowState::ChangePause:HAL CAN'T CHANGE FROM STLOW TO PAUSE\n"));
  339. DBG_BREAK();
  340. return FALSE;
  341. }
  342. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Pause);
  343. return TRUE;
  344. }
  345. BOOL CSlowState::ChangePlay(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  346. {
  347. HALRESULT st;
  348. if((st = pSHAL->SetPlayNormal()) != HAL_SUCCESS){
  349. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE PLAY\n");
  350. DBG_PRINTF(("CLASSLIB:CSlowState::ChangePlay:HAL CAN'T CHANGE FROM STLOW TO PLAY\n"));
  351. DBG_BREAK();
  352. return FALSE;
  353. }
  354. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Play);
  355. return TRUE;
  356. }
  357. BOOL CSlowState::ChangePauseViaSingleStep(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  358. {
  359. _RPTF0(_CRT_WARN, "CAN'T CHANGE FROM SLOW TO PAUSEVIASINGLESTEP\n");
  360. DBG_PRINTF(("CLASSLIB:CSlowState::ChangePauseViaSingleStep:CAN'T CHANGE FROM STLOW TO SINGLESTEP\n"));
  361. DBG_BREAK();
  362. return FALSE;
  363. }
  364. BOOL CSlowState::ChangeSlow(DWORD Speed, IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  365. {
  366. HALRESULT st;
  367. if((st = pSHAL->SetPlaySlow(Speed)) != HAL_SUCCESS){
  368. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE SLOW\n");
  369. DBG_PRINTF(("CLASSLIB:CSlowState::ChangeSlow:HAL CAN'T CHANGE FROM STLOW TO SLOW\n"));
  370. DBG_BREAK();
  371. return FALSE;
  372. }
  373. return TRUE;
  374. }
  375. BOOL CSlowState::ChangeScan(DWORD Speed, IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  376. {
  377. HALRESULT st;
  378. if((st = pSHAL->SetPlayScan(Speed)) != HAL_SUCCESS){
  379. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE SCAN\n");
  380. DBG_PRINTF(("CLASSLIB:CSlowState::ChangeScan:HAL CAN'T CHANGE FROM STLOW TO SCAN\n"));
  381. DBG_BREAK();
  382. return FALSE;
  383. }
  384. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Scan);
  385. return TRUE;
  386. }
  387. BOOL CScanState::ChangePowerOff(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  388. {
  389. _RPTF0(_CRT_WARN, "CAN'T CHANGE FROM SCAN TO POWEROFF\n");
  390. DBG_PRINTF(("CLASSLIB:CScanState::ChangePowerOff:CAN'T CHANGE FROM SCAN TO POWEROFF\n"));
  391. DBG_BREAK();
  392. return FALSE;
  393. }
  394. BOOL CScanState::ChangeStop(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL,CBaseStream *pStream)
  395. {
  396. HALRESULT st;
  397. if((st = pSHAL->SetPlayStop()) != HAL_SUCCESS){
  398. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE STOP \n");
  399. DBG_PRINTF(("CLASSLIB:CScanState::ChangeStop:HAL CAN'T CHANGE FROM SCAN TO STOP\n"));
  400. DBG_BREAK();
  401. return FALSE;
  402. }
  403. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Stop);
  404. pStream->FlushTransferBuffer();
  405. return TRUE;
  406. }
  407. BOOL CScanState::ChangePause(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  408. {
  409. HALRESULT st;
  410. if((st = pSHAL->SetPlayPause()) != HAL_SUCCESS){
  411. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE PAUSE\n");
  412. DBG_PRINTF(("CLASSLIB:CScanState::ChangePause:HAL CAN'T CHANGE FROM SCAN TO PAUSE\n"));
  413. DBG_BREAK();
  414. return FALSE;
  415. }
  416. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Pause);
  417. return TRUE;
  418. }
  419. BOOL CScanState::ChangePlay(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  420. {
  421. HALRESULT st;
  422. if((st = pSHAL->SetPlayNormal()) != HAL_SUCCESS){
  423. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE PLAY\n");
  424. DBG_PRINTF(("CLASSLIB:CScanState::ChangePlay:HAL CAN'T CHANGE FROM SCAN TO PLAY\n"));
  425. DBG_BREAK();
  426. return FALSE;
  427. }
  428. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Play);
  429. return TRUE;
  430. }
  431. BOOL CScanState::ChangePauseViaSingleStep(IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  432. {
  433. _RPTF0(_CRT_WARN, "CAN'T CHANGE FROM SCAN TO PAUSEVIASINGLESTEP\n");
  434. DBG_PRINTF(("CLASSLIB:CScanState::ChangePauseVidaSingleStep:CAN'T CHANGE FROM SCAN TO SINGLESTEP\n"));
  435. DBG_BREAK();
  436. return FALSE;
  437. }
  438. BOOL CScanState::ChangeSlow(DWORD Speed, IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  439. {
  440. HALRESULT st;
  441. if((st = pSHAL->SetPlayScan(Slow)) != HAL_SUCCESS){
  442. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE SCAN\n");
  443. DBG_PRINTF(("CLASSLIB:CScanState::ChangeSlow:HAL CAN'T CHANGE FROM SCAN TO SLOW\n"));
  444. DBG_BREAK();
  445. return FALSE;
  446. }
  447. ((CMPEGBoardState *)m_pMPEGBoardState)->SetState(Slow);
  448. return TRUE;
  449. }
  450. BOOL CScanState::ChangeScan(DWORD Speed, IClassLibHAL *pCHAL, IHALStreamControl *pSHAL)
  451. {
  452. HALRESULT st;
  453. if((st = pSHAL->SetPlayScan(Speed)) != HAL_SUCCESS){
  454. _RPTF0(_CRT_WARN, "HAL CAN'T CHANGE SCAN\n");
  455. DBG_PRINTF(("CLASSLIB:CScanState::ChangeScan:HAL CAN'T CHANGE FROM SCAN TO SCAN\n"));
  456. DBG_BREAK();
  457. return FALSE;
  458. }
  459. return TRUE;
  460. }