home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2001 July / VPR0107A.BIN / wmploc.DLL / 256 / 136 < prev    next >
Text (UTF-16)  |  2000-08-14  |  7KB  |  157 lines

  1. // Windows Media Player - Copyright 2000 Microsoft Corporation.
  2.  
  3. function InitEQ()
  4. {
  5.     UpdateEQOnOff();
  6. }
  7.  
  8. function UpdateEQOnOff()
  9. {
  10.     if (eq.bypass == true)
  11.     {
  12.         eqOnOffLabel.value="res://wmploc.dll/RT_STRING/#1851";
  13.     }
  14.     else
  15.     {
  16.         eqOnOffLabel.value="res://wmploc.dll/RT_STRING/#1846";
  17.     }
  18. }
  19.  
  20. function InitSRS()
  21. {
  22.     UpdateSRSOnOff();
  23. }
  24.  
  25. function UpdateSRSOnOff()
  26. {
  27.  
  28.     if (eq.enhancedAudio == true)
  29.     {
  30.         srsOnOffLabel.value="res://wmploc.dll/RT_STRING/#1846";
  31.     }
  32.     else
  33.     {
  34.         srsOnOffLabel.value="res://wmploc.dll/RT_STRING/#1851";
  35.     }
  36.  
  37. }
  38.  
  39. function NextSpeakerSize()
  40. {
  41.     var index = eq.speakerSize;
  42.  
  43.     index++;
  44.     if (index > 2)
  45.         index = 0;
  46.  
  47.     eq.speakerSize = index;
  48. }
  49.  
  50. function ResetVideoSettings()
  51. {
  52.     vs.brightness=0;
  53.     vs.contrast=0;
  54.     vs.hue=0;
  55.     vs.saturation=0;
  56. }
  57.  
  58. function InitMetaDataDisplay()
  59. {   
  60.     var MediaInfoURL;
  61.  
  62.     if(player.isOnline)
  63.     {
  64.         if(player.OpenState == osMediaOpen)
  65.         {
  66.             MediaInfoURL = mediacenter.getNamedString("NPMetaDataURL_ONLINE");
  67.             var TOC = player.currentMedia.GetItemInfo("TOC");
  68.             if(TOC)
  69.             {
  70.                 MediaInfoURL = MediaInfoURL + TOC;
  71.             }
  72.         }
  73.         else
  74.         {
  75.             MediaInfoURL = "about:<body bgcolor=black scroll=no>";
  76.         }
  77.     }
  78.     else
  79.     {
  80.         MediaInfoURL = mediacenter.getNamedString("NPMetaDataURL_OFFLINE");
  81.     }
  82.  
  83.     IE1.Navigate(MediaInfoURL,0,0,0,0);
  84. }
  85.  
  86. function CaptionsView_OnOpenStateChangeEvent()
  87. {
  88.     switch (player.OpenState)
  89.     {
  90.         case osMediaChanging:
  91.             ClearSamiDisplay();
  92.             break;
  93.     }
  94. }
  95.  
  96. function MetaDataView_OnOpenStateChangeEvent()
  97. {
  98.     switch (player.OpenState)
  99.     {
  100.         case osMediaOpen:
  101.             InitMetaDataDisplay();
  102.             break;
  103.     }
  104. }
  105.  
  106. function SwitchView(viewID)
  107. {
  108.     mediacenter.settingsView = viewID;  // tell media center about the change
  109.     theme.CurrentViewID = viewID;       // switch to this view
  110. }
  111.  
  112. function InitSamiDisplay()
  113. {
  114.     var URL = "res://wmploc.dll/SamiCaptioning.htm";
  115.     IE1.Navigate(URL,0,0,0,0);
  116.     player.closedCaption.captioningId = "SAMItext";
  117. }
  118.  
  119. function ClearSamiDisplay()
  120. {
  121.     handleScriptCommand("Text", "");
  122. }
  123.  
  124. function handleScriptCommand(scType, Param)
  125. {
  126.     var Document = 0;
  127.     var ElemCollection = 0;
  128.     var Element = 0;
  129.     scType = scType.toUpperCase();
  130.  
  131.     if(scType == "TEXT" ||  scType == "<SYNC" || scType == "CAPTION")
  132.     {
  133.         // get the HTML document
  134.         Document = IE1.Document;
  135.         if(Document)
  136.         {
  137.             // get the element collection
  138.             ElemCollection = Document.all;
  139.             if(ElemCollection)
  140.             {
  141.                 // get the first element with this name
  142.                 Element = ElemCollection.item("SAMItext",0);
  143.             }
  144.             if(Element == 0)
  145.             {
  146.                 // operate on the body
  147.                 Element = Document.body;
  148.             }
  149.             if(Element)
  150.             {
  151.                 // set the element HTML to our
  152.                 Element.innerHTML = Param;
  153.             }
  154.         }   
  155.     }
  156. }
  157.