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

  1. // Windows Media Player - Copyright 2000 Microsoft Corporation.
  2.  
  3. function InitVisualizations()
  4. {        
  5.     InitMe();
  6. }
  7.  
  8. function CloseVisualizations()
  9. {
  10. }
  11.  
  12. function OnDownloadingMediaViz()
  13. {
  14.     AddBanner.image="WMPImage_AdBanner";
  15.  
  16.     var strToolTip = player.currentmedia.getItemInfo("BannerAbstract");
  17.     AddBanner.upToolTip = strToolTip;
  18. }
  19.  
  20. function OnBannerClick()
  21. {
  22.     var strTargetURL = player.currentmedia.getItemInfo("BannerInfoURL");
  23.     if ( strTargetURL != "")
  24.     {
  25.         player.launchURL(strTargetURL);   
  26.     }
  27. }
  28.  
  29. function OnBannerMouseOver()
  30. {
  31.     if ( player.currentmedia.getItemInfo("BannerInfoURL") != "")
  32.     {
  33.         AddBanner.cursor = "hand";
  34.     }
  35.     else
  36.     {
  37.         AddBanner.cursor = "system";
  38.     }
  39. }
  40.  
  41. function VizPrev()
  42. {
  43.     if (event.shiftKey)
  44.     {
  45.         myeffect.previousEffect();
  46.     }
  47.     else
  48.     {
  49.         myeffect.previous();
  50.     }
  51.     var nPreset = myeffect.currentPreset;
  52.     mediacenter.effectType = myeffect.currentEffectType;
  53.     mediacenter.effectPreset = nPreset;
  54. }
  55.  
  56. function VizNext()
  57. {
  58.     if (event.shiftKey)
  59.     {
  60.         myeffect.nextEffect();
  61.     }
  62.     else
  63.     {
  64.         myeffect.next();
  65.     }
  66.     var nPreset = myeffect.currentPreset;
  67.     mediacenter.effectType = myeffect.currentEffectType;
  68.     mediacenter.effectPreset = nPreset;
  69. }
  70.  
  71. function InitMe()
  72. {
  73.     if (osMediaOpen == player.OpenState)
  74.     {
  75.         if (player.currentmedia.getItemInfo("BannerURL") != "")
  76.         {
  77.             ShowBanner(true);
  78.         }
  79.         else
  80.         {
  81.             ShowBanner(false);
  82.         }
  83.     
  84.         if (player.currentMedia.ImageSourceWidth > 0)
  85.         {
  86.             ShowVisualizations(false);
  87.             video1.visible=true;
  88.         } 
  89.         else 
  90.         { 
  91.             playlistname.value = player.currentmedia.getiteminfo("Author");
  92.             trackname.value = player.currentmedia.name;
  93.             VizTitle.value = myeffect.currentEffectTitle + ": " + myeffect.currentPresetTitle;
  94.             if (": " == VizTitle.value)
  95.                 VizTitle.value = "";
  96.             ShowVisualizations(true);
  97.             video1.visible=false;
  98.         }
  99.     }
  100.     else if (osPlaylistChanging == player.OpenState)
  101.     {
  102.         ShowVisualizations(false);
  103.         video1.visible=false;
  104.         ShowBanner(false);
  105.     }        
  106.     else 
  107.     { 
  108.         ShowVisualizations(false);
  109.         video1.visible=false;
  110.     }
  111. }
  112.  
  113. function ShowVisualizations(state)
  114. {
  115.     if (false == mediacenter.showEffects)
  116.     {
  117.         myeffect.visible=false;
  118.         svEffectsControls.visible=false; 
  119.     }
  120.     else
  121.     {
  122.         myeffect.visible=state;
  123.         svEffectsControls.visible=state; 
  124.     }
  125.  
  126.     Titles.visible=state;
  127. }
  128.  
  129. function myOnVideoStart()
  130. {
  131.     video1.visible=true;
  132.     ShowVisualizations(false);
  133. }
  134.  
  135. function myOnVideoEnd()
  136. {
  137.     video1.visible=false;
  138.     ShowVisualizations(true);
  139. }
  140.  
  141. function OnPlayStateChangeViz()
  142. {
  143.     InitMe();
  144. }
  145.  
  146. function OnOpenStateChangeViz()
  147. {
  148.     InitMe();
  149. }
  150.  
  151. function ShowBanner(state)
  152. {
  153.     if (state != svBanner.visible)
  154.     {
  155.         svBanner.visible = state;
  156.         
  157.         if (state == true)
  158.         {
  159.             svBanner.visible = true;
  160.             svScreen.height -= svBanner.height;
  161.         }
  162.         else
  163.         {
  164.             svBanner.visible = false;
  165.             svScreen.height += svBanner.height;
  166.         }
  167.     }
  168. }
  169.  
  170.