home *** CD-ROM | disk | FTP | other *** search
/ PC World Plus! (NZ) 2000 October / PCWORLDPLUS_OCTO.BIN / review / wmp7.exe / RCDATA / CABINET / wmploc.DLL / 256 / 4003 < prev   
Text (UTF-16)  |  2000-06-26  |  3KB  |  61 lines

  1. // Windows Media Player - Copyright 2000 Microsoft Corporation.
  2.  
  3. function InitVisualizations()
  4. {
  5.     if (osMediaOpen == player.OpenState)
  6.     {
  7.         AutoSize();
  8.         if (player.currentMedia.ImageSourceWidth > 0)
  9.         {
  10.             myeffect.visible=false;
  11.             video1.visible=true;
  12.         } 
  13.         else 
  14.         { 
  15.             video1.visible=false;
  16.             myeffect.visible=mediacenter.showEffects;
  17.         }
  18.     }
  19.     else 
  20.     { 
  21.         video1.visible=false;
  22.         myeffect.visible=false;
  23.     }
  24. }
  25.  
  26. function OnPlayStateChangeViz()
  27. {
  28.     InitVisualizations();
  29. }
  30.  
  31. function OnOpenStateChangeViz()
  32. {
  33.     InitVisualizations();
  34. }
  35.  
  36. function AutoSize()
  37. {
  38.     if (player.currentMedia.ImageSourceWidth > 0)
  39.     {
  40.         // Resize layout to match the video size
  41.         view.height = player.currentMedia.ImageSourceHeight + svTransport.height;
  42.         
  43.         // clip to the transport controls width
  44.         if ((0 == svTransport.width) || (player.currentMedia.ImageSourceWidth > svLayoutSize.width))
  45.         {
  46.             view.width = player.currentMedia.ImageSourceWidth;
  47.         }
  48.         else
  49.         {
  50.             view.width = svLayoutSize.width;
  51.         }
  52.     }
  53.     else
  54.     {
  55.         // Resize layout to original size
  56.         view.width = svLayoutSize.width;        
  57.         view.height = svLayoutSize.height;
  58.     }
  59. }
  60.  
  61.