Leaked source code of windows server 2003
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.

394 lines
11 KiB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>ATL 3.0 test page for object MSVidCtl</TITLE>
  4. </HEAD>
  5. <BODY onload="window_onload()">
  6. &nbsp;
  7. <table border="1" width="89%" height="414">
  8. <tr>
  9. <td width="65%" height="383">
  10. <OBJECT ID="MSVidCtl" CLASSID="CLSID:B0EDF163-910A-11D2-B632-00C04F79498E"
  11. height="400" width="500"></OBJECT>
  12. </td><td width="35%" height="383">
  13. <p>Current Title: <INPUT id=CurrentTitle type=text size="4" name="CurrentTitle" value="0">&nbsp;
  14. <p>Current Chapter: <INPUT id=CurrentChap type=text size="4" name="CurrentChap" value="0">&nbsp;</p>
  15. <p>Current Time: <INPUT id=CurrentTime type=text value="00:00:00" size="7"></p>
  16. <p>Current Event: <INPUT id=EventText type=text size="23">
  17. <p>Current Subtitles:<INPUT id=SPLang type=text value="" size="10">
  18. <p>Current Audio: <INPUT id=AudioLang type=text value="" size="10">
  19. </p>
  20. <p>
  21. <INPUT id=Play type=button value="play" onclick="run_onClick()">
  22. <INPUT id=Pause type=button value="pause" onclick="pause_onClick()">
  23. <INPUT id=Stop type=button value="stop" onclick="stop_onClick()">
  24. <INPUT id=RW type=button value="RW" onclick="RW_onClick()">
  25. <INPUT id=FF type=button value="FF" onclick="FF_onClick()">
  26. <INPUT id=PrevChap type=button value="|<" onclick="Prev_onClick()">
  27. <INPUT id=NextChap type=button value=">|" onclick="Next_onClick()">
  28. <p>
  29. <INPUT id=Menu type=button value="menu" onclick="menu_onClick()">
  30. <INPUT id=Resume type=button value="resume" onclick="resume_onClick()">
  31. <INPUT id=Up type=button value="^" onclick="up_onClick()">
  32. <INPUT id=Down type=button value="v" onclick="down_onClick()">
  33. <INPUT id=Left type=button value="<" onclick="left_onClick()">
  34. <INPUT id=Right type=button value=">" onclick="right_onClick()">
  35. <INPUT id=Enter type=button value="enter" onclick="enter_onClick()">
  36. <p>
  37. <INPUT id=SP type=button value="subtitles" onclick="sp_onClick()">
  38. <INPUT id=SPText type=text value="0" size="1">
  39. <INPUT id=Audio type=button value="audio" onclick="audio_onClick()">
  40. <INPUT id=AudioText type=text value="1" size="1">
  41. <INPUT id=Angle type=button value="Angle" onclick="angle_onClick()">
  42. <INPUT id=AngleText type=text value="0" size="1">
  43. <p>
  44. <INPUT id=Level type=button value="Parental Level" onclick="pg_onClick()">
  45. <INPUT id=LevelText type=text value="8" size="1">
  46. <INPUT id=Password type=password size="10">
  47. <p>
  48. <INPUT id=SaveBookmark type=button value="Save Bookmark" onclick="saveBookmark_onClick()">
  49. <INPUT id=RestoreBookmark type=button value="Restore Bookmark" onclick="restoreBookmark_onClick()">
  50. <p>&nbsp;
  51. </td>
  52. </tr>
  53. </table>
  54. <p>
  55. <OBJECT ID="MSVidSegEvent" CLASSID="CLSID:781C7600-A6C3-4f7a-893E-C89B3E7B67E0">
  56. </OBJECT>
  57. <SCRIPT LANGUAGE="JScript" FOR=MSVidSegEvent EVENT="DVDNotify(event, param1, param2)">
  58. OnDVDNotify(event, param1, param2)</SCRIPT>
  59. <SCRIPT LANGUAGE="JScript" FOR=MSVidSegEvent EVENT="PlayForwards(bEnabled)">ProcessPFEvent(bEnabled)</SCRIPT>
  60. <SCRIPT LANGUAGE="JScript" FOR=MSVidSegEvent EVENT="PlayBackwards(bEnabled)">ProcessPBEvent(bEnabled)</SCRIPT>
  61. <SCRIPT LANGUAGE="JScript" FOR=MSVidSegEvent EVENT="ShowMenu(bEnabled)">ProcessShowMenuEvent(bEnabled)</SCRIPT>
  62. <SCRIPT LANGUAGE="JScript" FOR=MSVidSegEvent EVENT="Resume(bEnabled)">ProcessResumeEvent(bEnabled)</SCRIPT>
  63. <SCRIPT LANGUAGE="JScript" FOR=MSVidSegEvent EVENT="ChangeCurrentAudioStream(bEnabled)">ProcessAudEvent(bEnabled)</SCRIPT>
  64. <SCRIPT LANGUAGE="JScript" FOR=MSVidSegEvent EVENT="ChangeCurrentSubpictureStream(bEnabled)">ProcessSPEvent(bEnabled)</SCRIPT>
  65. <SCRIPT LANGUAGE="JScript" FOR=MSVidSegEvent EVENT="ChangeCurrentAngle(bEnabled)">ProcessAngleEvent(bEnabled)</SCRIPT>
  66. <SCRIPT LANGUAGE="JScript" FOR=MSVidSegEvent EVENT="PlayAtTimeInTitle(bEnabled)">ProcessTimePlayEvent(bEnabled)</SCRIPT>
  67. <SCRIPT LANGUAGE="JScript" FOR=MSVidSegEvent EVENT="PlayAtTime(bEnabled)">ProcessTimePlayEvent(bEnabled)</SCRIPT>
  68. <SCRIPT LANGUAGE="JScript" FOR=MSVidSegEvent EVENT="PlayChapterInTitle(bEnabled)">ProcessChapterPlayEvent(bEnabled)</SCRIPT>
  69. <SCRIPT LANGUAGE="JScript" FOR=MSVidSegEvent EVENT="PlayChapter(bEnabled)">ProcessChapterSearchEvent(bEnabled)</SCRIPT>
  70. <SCRIPT language=JSCRIPT>
  71. /*************************************************************/
  72. /* Name: ProcessXXXEvent
  73. /* Description: Process DVD events
  74. /*************************************************************/
  75. function ProcessPFEvent(param1)
  76. {
  77. FF.disabled = !param1;
  78. }
  79. function ProcessPBEvent(param1)
  80. {
  81. RW.disabled = !param1;
  82. }
  83. function ProcessShowMenuEvent(param1)
  84. {
  85. Menu.disabled = !param1;
  86. }
  87. function ProcessResumeEvent(param1)
  88. {
  89. Resume.disabled = !param1;
  90. }
  91. function ProcessAudEvent(param1)
  92. {
  93. Audio.disabled = !param1;
  94. }
  95. function ProcessSPEvent(param1)
  96. {
  97. SP.disabled = !param1;
  98. }
  99. function ProcessAngleEvent(param1)
  100. {
  101. Angle.disabled = !param1;
  102. }
  103. function ProcessChapterSearchEvent(param1)
  104. {
  105. PrevChap.disabled = !param1;
  106. NextChap.disabled = !param1;
  107. }
  108. function ProcessChapterPlayEvent(param1)
  109. {
  110. PrevChap.disabled = !param1;
  111. NextChap.disabled = !param1;
  112. }
  113. function ProcessTimePlayEvent(param1)
  114. {
  115. }
  116. function ProcessTimeSearchEvent(param1)
  117. {
  118. }
  119. // DVD event codes
  120. var EC_DVDBASE = 256;
  121. var EC_DVD_DOMAIN_CHANGE = EC_DVDBASE + 1;
  122. var EC_DVD_TITLE_CHANGE = EC_DVDBASE + 2;
  123. var EC_DVD_CHAPTER_START = EC_DVDBASE + 3;
  124. var EC_DVD_AUDIO_STREAM_CHANGE = EC_DVDBASE + 4;
  125. var EC_DVD_SUBPICTURE_STREAM_CHANGE = EC_DVDBASE + 5;
  126. var EC_DVD_ANGLE_CHANGE = EC_DVDBASE + 6;
  127. var EC_DVD_BUTTON_CHANGE = EC_DVDBASE + 7;
  128. var EC_DVD_VALID_UOPS_CHANGE = EC_DVDBASE + 8;
  129. var EC_DVD_STILL_ON = EC_DVDBASE + 9;
  130. var EC_DVD_STILL_OFF = EC_DVDBASE + 10;
  131. var EC_DVD_CURRENT_TIME = EC_DVDBASE + 11;
  132. var EC_DVD_ERROR = EC_DVDBASE + 12;
  133. var EC_DVD_WARNING = EC_DVDBASE + 13;
  134. var EC_DVD_CHAPTER_AUTOSTOP = EC_DVDBASE + 14;
  135. var EC_DVD_NO_FP_PGC = EC_DVDBASE + 15;
  136. var EC_DVD_PLAYBACK_RATE_CHANGE = EC_DVDBASE + 16;
  137. var EC_DVD_PARENTAL_LEVEL_CHANGE = EC_DVDBASE + 17;
  138. var EC_DVD_PLAYBACK_STOPPED = EC_DVDBASE + 18;
  139. var EC_DVD_ANGLES_AVAILABLE = EC_DVDBASE + 19;
  140. var EC_DVD_PLAYING = EC_DVDBASE + 254;
  141. var EC_DVD_PAUSED = EC_DVDBASE + 255;
  142. var EC_DVD_DISC_EJECTED = EC_DVDBASE + 24;
  143. var EC_DVD_DISC_INSERTED = EC_DVDBASE + 25;
  144. var EC_DVD_CURRENT_HMSF_TIME = EC_DVDBASE + 26;
  145. var EC_PAUSED = 14;
  146. var DVD_ERROR_Unexpected= 1;
  147. var DVD_ERROR_CopyProtectFail= 2;
  148. var DVD_ERROR_InvalidDVD1_0Disc= 3;
  149. var DVD_ERROR_InvalidDiscRegion= 4;
  150. var DVD_ERROR_LowParentalLevel= 5;
  151. var DVD_ERROR_MacrovisionFail= 6;
  152. var DVD_ERROR_IncompatibleSystemAndDecoderRegions=7;
  153. var DVD_ERROR_IncompatibleDiscAndDecoderRegions=8;
  154. var DVD_ERROR_NoSubpictureStream= 99;
  155. function window_onload()
  156. {
  157. MSVidCtl.View("DVD");
  158. MSVidCtl.Build();
  159. MSVidCtl.InputActive.EventHandler = MSVidSegEvent;
  160. MSVidCtl.InputActive.RestorePreferredSettings();
  161. MSVidCtl.Run();
  162. }
  163. function OnDVDNotify(event, param1, param2)
  164. {
  165. lEventCode = event;
  166. if (lEventCode == EC_DVD_STILL_ON) {
  167. text = "STILL_ON";
  168. }
  169. else if (lEventCode == EC_DVD_STILL_OFF) {
  170. text = "STILL_OFF";
  171. }
  172. else if (lEventCode == EC_DVD_BUTTON_CHANGE) {
  173. text = "BUTTON_CHANGE";
  174. }
  175. else if (lEventCode == EC_DVD_DOMAIN_CHANGE) {
  176. text = "DOMAIN_CHANGE";
  177. }
  178. else if (lEventCode == EC_DVD_TITLE_CHANGE) {
  179. text = "TITLE_CHANGE";
  180. CurrentTitle.value = param1;
  181. updateAudio();
  182. updateSP();
  183. }
  184. else if (lEventCode == EC_DVD_CHAPTER_START) {
  185. text = "CHAPTER_START";
  186. CurrentChap.value = param1;
  187. }
  188. else if (lEventCode == EC_DVD_AUDIO_STREAM_CHANGE) {
  189. text = "AUDIO_STREAM_CHANGE";
  190. updateAudio();
  191. }
  192. else if (lEventCode == EC_DVD_SUBPICTURE_STREAM_CHANGE) {
  193. text = "SUBPICTURE_STREAM_CHANGE";
  194. updateSP();
  195. }
  196. else if (lEventCode == EC_DVD_ANGLE_CHANGE) {
  197. text = "ANGLE_CHANGE";
  198. }
  199. else if (lEventCode == EC_DVD_VALID_UOPS_CHANGE) {
  200. text = "VALID_UOPS_CHANGE";
  201. }
  202. else if (lEventCode == EC_DVD_CURRENT_HMSF_TIME) {
  203. text = "CURRENT_HMSF_TIME";
  204. CurrentTime.value = MSVidCtl.InputActive.DVDTimeCode2bstr(param1).substr(0, 8);
  205. }
  206. else if (lEventCode == EC_DVD_CURRENT_TIME) {
  207. text = "CURRENT_TIME";
  208. }
  209. else if (event == EC_DVD_PAUSED ) {
  210. text = "PAUSED";
  211. }
  212. else if (lEventCode == EC_DVD_PLAYING) {
  213. text = "PLAYING";
  214. }
  215. else if (lEventCode == EC_DVD_PLAYBACK_RATE_CHANGE) {
  216. text = "PLAYBACK_RATE_CHANGE";
  217. }
  218. else if (lEventCode == EC_DVD_ERROR) {
  219. text = "ERROR";
  220. }
  221. else if (lEventCode == EC_DVD_PARENTAL_LEVEL_CHANGE) {
  222. text = "PARENTAL_LEVEL_CHANGE";
  223. }
  224. else if (lEventCode == EC_DVD_PLAYBACK_STOPPED) {
  225. text = "PLAYBACK_STOPPED";
  226. }
  227. else if (lEventCode == EC_DVD_ANGLES_AVAILABLE) {
  228. text = "ANGLES_AVAILABLE";
  229. //Angle.disabled = !param1;
  230. }
  231. else if (lEventCode == EC_DVD_DISC_EJECTED) {
  232. text = "DISC_EJECTED";
  233. }
  234. else if (lEventCode == EC_DVD_DISC_INSERTED) {
  235. text = "DISC_INSERTED";
  236. }
  237. EventText.value = text;
  238. }
  239. function saveBookmark_onClick()
  240. {
  241. MSVidCtl.InputActive.SaveBookmark();
  242. }
  243. function restoreBookmark_onClick()
  244. {
  245. MSVidCtl.InputActive.RestoreBookmark();
  246. }
  247. function pg_onClick()
  248. {
  249. MSVidCtl.InputActive.SelectParentalLevel(LevelText.value, "", Password.value);
  250. MSVidCtl.InputActive.DVDAdm.SaveParentalLevel(LevelText.value, "", Password.value);
  251. LevelText.value = MSVidCtl.InputActive.GetPlayerParentalLevel();
  252. }
  253. function sp_onClick()
  254. {
  255. MSVidCtl.InputActive.CurrentSubpictureStream = SPText.value;
  256. updateSP();
  257. }
  258. function audio_onClick()
  259. {
  260. MSVidCtl.InputActive.CurrentAudioStream = AudioText.value;
  261. updateAudio();
  262. }
  263. function angle_onClick()
  264. {
  265. MSVidCtl.InputActive.CurrentAngle = AngleText.value;
  266. }
  267. function menu_onClick()
  268. {
  269. MSVidCtl.InputActive.ShowMenu(3);
  270. }
  271. function resume_onClick()
  272. {
  273. MSVidCtl.InputActive.Resume();
  274. }
  275. function FF_onClick()
  276. {
  277. MSVidCtl.InputActive.PlayForwards(8.0);
  278. }
  279. function RW_onClick()
  280. {
  281. MSVidCtl.InputActive.PlayBackwards(8.0);
  282. }
  283. function Prev_onClick()
  284. {
  285. MSVidCtl.InputActive.PlayPrevChapter();
  286. }
  287. function Next_onClick()
  288. {
  289. MSVidCtl.InputActive.PlayNextChapter();
  290. }
  291. function run_onClick()
  292. {
  293. MSVidCtl.Run();
  294. }
  295. function pause_onClick()
  296. {
  297. MSVidCtl.Pause();
  298. }
  299. function stop_onClick()
  300. {
  301. MSVidCtl.Stop();
  302. }
  303. function up_onClick()
  304. {
  305. MSVidCtl.InputActive.SelectUpperButton();
  306. }
  307. function down_onClick()
  308. {
  309. MSVidCtl.InputActive.SelectLowerButton();
  310. }
  311. function left_onClick()
  312. {
  313. MSVidCtl.InputActive.SelectLeftButton();
  314. }
  315. function right_onClick()
  316. {
  317. MSVidCtl.InputActive.SelectRightButton();
  318. }
  319. function enter_onClick()
  320. {
  321. MSVidCtl.InputActive.ActivateButton();
  322. }
  323. function updateSP()
  324. {
  325. try {
  326. if (MSVidCtl.InputActive.SubpictureOn)
  327. SPLang.value = MSVidCtl.InputActive.GetSubpictureLanguage(MSVidCtl.InputActive.CurrentSubpictureStream);
  328. else
  329. SPLang.value = "";
  330. }
  331. catch(e) {
  332. }
  333. }
  334. function updateAudio()
  335. {
  336. try {
  337. AudioLang.value = MSVidCtl.InputActive.GetAudioLanguage(MSVidCtl.InputActive.CurrentAudioStream);
  338. }
  339. catch(e) {
  340. }
  341. }
  342. </SCRIPT>
  343. </BODY>
  344. </HTML>