home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 February / PCWorld_2001-02_cd.bin / Software / Topware / winmedpl / mpbonus_full.exe / wmpskin.cab / Bluesky.wmz / bs.js < prev    next >
Encoding:
Text File  |  2000-11-11  |  7.2 KB  |  284 lines

  1. var vidIsRunning = false;
  2. var list=false;
  3. var eqt=false;
  4. var resihi=0;
  5. var resiwide=0;
  6. var rswtch=0;
  7. var make_me_small=false;
  8.  
  9.  
  10. function start()
  11. {    
  12.        visEffects.currentEffectType = mediacenter.effectType;
  13.        visEffects.currentPreset = mediacenter.effectPreset;   
  14.        OnOpenStateChange();
  15.        plChange();
  16.        
  17.     
  18.          
  19.  
  20.          if (((theme.loadPreference('e'))==163)||((theme.loadPreference('e'))==413))
  21.                {  if ((theme.loadPreference('e'))==163)
  22.                     {base.height=theme.loadPreference('finaly')-18;         
  23.                      eqmove();}
  24.                        else
  25.                          {base.height=theme.loadPreference('finaly');}
  26.                   if ((theme.loadPreference('p'))==413)
  27.                     {base.width=theme.loadPreference('finalx')-160;         
  28.                      playlist();}
  29.              else
  30.                          {base.width=theme.loadPreference('finalx');}                                      
  31.                 }
  32.       else
  33.             {base.width=theme.loadPreference('finalx');
  34.              base.height=theme.loadPreference('finaly');}
  35.     
  36. }
  37. function OnClose()
  38. {    
  39.       mediacenter.effectType= visEffects.currentEffectType;
  40.       mediacenter.effectPreset=visEffects.currentPreset;
  41.       theme.savePreference('finalx',base.width);
  42.       theme.savePreference('finaly',base.height);
  43.       theme.savePreference('e',base.minheight);
  44.     theme.savePreference('p',base.minwidth);
  45.  
  46.  
  47. }
  48.  
  49. function jive()
  50. {    
  51.             if (player.currentMedia.ImageSourceWidth > 0)
  52.                 {
  53.                  
  54.                 }   
  55.             else
  56.                 { 
  57.                  resiwide=view.width;
  58.                  resihi=view.height;
  59.          
  60.                  }
  61. }
  62. function OnOpenStateChange()
  63. {
  64.   
  65.     if (player.OpenState == osMediaOpen)
  66.     {
  67.         vidIsRunning = (player.currentMedia) && (player.currentMedia.ImageSourceWidth > 0);
  68.         vidIsRunning ? OnOpenVid() : OnCloseVid();
  69.     }
  70. }
  71.  
  72.  
  73. function plChange()
  74. {  OnOpenStateChange();
  75.    meta.tooltip=player.currentmedia.getiteminfo("author");
  76.  
  77.  switch(player.PlayState)
  78.     {
  79.     case psStopped:
  80.         visEffects.visible=false;  
  81.         break;
  82.     case psPaused:
  83.        visEffects.visible=false;  
  84.         break;
  85.     case psPlaying:
  86.        visEffects.visible=!vidIsRunning;
  87.        sk.enabled=!vidIsRunning;    
  88.     if(sk.enabled==true)
  89.           {sk.uptooltip="Next Visualization";
  90.         sk.cursor="hand";}
  91.         else
  92.           {sk.uptooltip="";
  93.        sk.cursor="";    } 
  94.        if((vidIsRunning==false)&&(resihi!=0))
  95.            {
  96.                if(make_me_small==false)
  97.                    { rswtch=resiwide;
  98.                     view.height=resihi;
  99.                     view.width=rswtch;
  100.                    }
  101.                   else
  102.                     {small();
  103.                      make_me_small=false;
  104.                     }
  105.            } 
  106.     }
  107.  
  108. }
  109.  
  110. function playlist()
  111. {
  112.    if(plst.visible==false)
  113.          {divider.visible=true;
  114.           plst.visible=true;
  115.           PlaylistVisibleChange();       
  116.           view.width=view.width+163; 
  117.           vsb.width=view.width-194;
  118.           metasub.width=view.width-194; 
  119.           view.minwidth=413;
  120.           list=true;
  121.          if(eqm.visible==true)
  122.              {plst.height=view.height-92;
  123.               divider.height=view.height-92;}
  124.           
  125.           }
  126.    else
  127.      {  divider.visible=false;
  128.         view.minwidth=250;
  129.         view.width=view.width-163;
  130.         vsb.width=view.width-31;  
  131.         metasub.width=view.width-31 
  132.           plst.visible=false;
  133.         list=false;
  134.            eqm.width=vsb.width+5;
  135.      }
  136. }
  137.  
  138.  
  139.  
  140. function PlaylistVisibleChange()
  141. {
  142.     if (plstr.visible)
  143.     {
  144.         plstr.setColumnResizeMode(0, "Stretches");
  145.         plstr.setColumnResizeMode(1, "AutoSizeData");
  146.     }
  147. }
  148.  
  149.  
  150.  
  151. // Video  functions
  152.  
  153. function OnOpenVid()
  154. {   visEffects.visible=false;
  155.     vid.visible=true;
  156.     player.currentPlaylist.setItemInfo("vidOpened", "true");
  157.     
  158.     if (player.currentMedia)
  159.     {
  160.         if(vsb.width>player.currentMedia.ImageSourceWidth)
  161.            {
  162.              view.width=view.width-(vsb.width-player.currentMedia.ImageSourceWidth)+10
  163.            }
  164.            else{
  165.                view.width=view.width+(player.currentMedia.ImageSourceWidth-vsb.width)+10}
  166.    
  167.          if(vsb.height>player.currentMedia.ImageSourceheight)
  168.            {
  169.              view.height=view.height-(vsb.height-player.currentMedia.ImageSourceheight)+10
  170.            }
  171.            else{
  172.                view.height=view.height+(player.currentMedia.ImageSourceheight-vsb.height)+10}
  173.          
  174.         if(player.currentMedia.ImageSourceWidth+10<250) 
  175.                {vsb.width=view.width-(8+wide);}
  176.            else
  177.              { vsb.width=player.currentMedia.ImageSourceWidth+10;}
  178.          vsb.height=player.currentMedia.ImageSourceheight+10;
  179.     }
  180.  
  181.    if (minimo.visible==true)
  182.       {
  183.        make_me_small=true;
  184.        big();}
  185. }
  186.  
  187. function OnCloseVid()
  188. {   
  189.     visEffects.visible=true;     
  190.     
  191. }
  192.  
  193. function vidend()
  194. {   
  195.     vid.visible=false;    
  196.     player.currentPlaylist.setItemInfo("closeVid", "false");
  197.     player.currentPlaylist.setItemInfo("vidOpened", "false");
  198.     vidIsRunning=false;          
  199. }
  200.  
  201. function small()
  202.   lu.visible=false;
  203.   tlu.visible=false;
  204.   pb.visible=false;
  205.   tla.visible=false;
  206.   tld.visible=false;
  207.   tldr.visible=false;
  208.   metasub.visible=false;
  209.   vsb.visible=false;
  210.   vid.visible=false;
  211.   eqm.visible=false;
  212.   divider.visible=false;
  213.   plst.visible=false;
  214.   blt.visible=false;
  215.   ru.visible=false;
  216.   rd.visible=false;          
  217.   minimo.visible=true;
  218.   tr.visible=true;
  219.   tr.enabled=true;
  220. }
  221.  
  222.  
  223.  
  224.  
  225. function big()
  226. {
  227.   lu.visible=true;
  228.   tlu.visible=true;
  229.   pb.visible=true;
  230.   tla.visible=true;
  231.   tld.visible=true;
  232.   tldr.visible=true;
  233.   metasub.visible=true;
  234.   vsb.visible=true;
  235.   vid.visible=vidIsRunning;
  236.   eqm.visible=eqt;
  237.   divider.visible=list;
  238.   plst.visible=list;
  239.   blt.visible=true;
  240.   ru.visible=true;
  241.   rd.visible=true;         
  242.   minimo.visible=false;
  243.   tr.visible=false;
  244.   tr.enabled=false;
  245.  
  246. }
  247.  
  248. function eqmove()
  249. {    if(eqm.visible==false)
  250.        {  eqm.visible=true;    
  251.          vsb.height=(view.height-102);    
  252.          view.height=view.height+18;
  253.           view.minheight=163;
  254.          if(plst.visible==true)
  255.              {plst.height=view.height-92;
  256.               divider.height=view.height-92;}
  257.          eqt=true;
  258.        }
  259.        else
  260.          {    view.minheight=145;
  261.              eqm.visible=false;
  262.              vsb.height=view.height-88;
  263.              view.height=view.height-18;
  264.             plst.height=view.height-76
  265.             divider.height=view.height-76;
  266.             eqt=false;
  267.             } 
  268.  
  269. }
  270. function AdjustAudio()
  271. {
  272.     eq.gainLevel2 = (8*bass.value +   treble.value)/9;
  273.     eq.gainLevel3 = (7*bass.value + 2*treble.value)/9;
  274.     eq.gainLevel4 = (6*bass.value + 3*treble.value)/9;
  275.     eq.gainLevel5 = (5*bass.value + 4*treble.value)/9;
  276.     eq.gainLevel6 = (4*bass.value + 5*treble.value)/9;
  277.     eq.gainLevel7 = (3*bass.value + 6*treble.value)/9;
  278.     eq.gainLevel8 = (2*bass.value + 7*treble.value)/9;
  279.     eq.gainLevel9 = (  bass.value + 8*treble.value)/9;
  280. }
  281.  
  282.  
  283.