home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 January / Chip_2004-01_cd1.bin / opsys / wmakeup / download / amped2.wmz / amped.js next >
Encoding:
JavaScript  |  2003-09-10  |  26.4 KB  |  1,338 lines

  1. /*
  2.     http://www.theskinsfactory.com
  3.     info@theskinsfactory.com
  4.     Amped2 WMP 9Series skin (XP)
  5. */
  6.  
  7. function remoteStartUp()
  8. {
  9.     volume.value = player.settings.volume;
  10.     theme.savePreference( 'remoteViewer', "true" );
  11.     htcpStartupRemote();
  12. //    checkPlayerState();
  13.  
  14. }
  15.  
  16. function remoteShutDown()
  17. {
  18.  
  19. }
  20.  
  21. function remoteCall()
  22. {
  23.     if("true"==theme.loadPreference("remoteCallPl"))
  24.     {
  25.         toggleView('plView','plViewer')
  26.         theme.savePreference("remoteCallPl", "false");
  27.     }
  28.     if("true"==theme.loadPreference("remoteCallEq"))
  29.     {
  30.         toggleView('eqView','eqViewer')
  31.         theme.savePreference("remoteCallEq", "false");
  32.     }
  33.     if("true"==theme.loadPreference("remoteCallVis"))
  34.     {
  35.         toggleView('visView','visViewer')
  36.         theme.savePreference("remoteCallVis", "false");
  37.     }
  38.  
  39.     htcpMain();
  40.     theme.savePreference('htcpTimerStatus',"false");
  41. }
  42.  
  43. function mainStartUp()
  44. {
  45.     htcpSetTimerStatus();
  46.     htcpSetTimer();
  47.     htcpSetID();
  48.     loadMainPrefs();
  49.     theme.savePreference("vidViewer", "false");
  50.     checkPlayerState();
  51.     updateMetadata('status');
  52. }
  53.  
  54. function checkPlayerState()
  55. {
  56.     if (player)
  57.     {
  58.         switch (player.playState)
  59.         {
  60.             case 2:
  61.             case 3:     //playing
  62.                 if(("false"==theme.loadPreference("vidViewer"))&&player.currentMedia.ImageSourceWidth>0)
  63.                 {
  64.                     
  65.                     sampleAlpha();
  66.                     theme.openView('videoView');
  67.                     theme.savePreference('htcpTimerStatus', "false" );
  68.                     if("true"==theme.loadPreference("visViewer")){
  69.                         theme.savePreference("visViewer", "false");
  70.                         theme.closeView( "visView" );
  71.                     }
  72.                     break
  73.                 }
  74.                 break;
  75.             }
  76.         }
  77.  
  78.     if(!player.controls.isAvailable("Stop"))
  79.     {
  80.     }
  81.  
  82. }
  83.  
  84. // metadata
  85.  
  86. function updateMetadata(type){
  87.     if("status"==type){
  88.         if(player.openState!=13) return;
  89.  
  90.         var metaAuthor = player.currentMedia.getItemInfo("author");
  91.  
  92.         if (metaAuthor != "") {
  93.             metaAuthor += " - ";
  94.         }
  95.  
  96.         metadata.value = player.status;
  97.  
  98.         if (metadata.value != "") {
  99.             metadata.value += " - ";
  100.         }
  101.  
  102.         metadata.value += metaAuthor;
  103.     }else if("playlist"==type){
  104.         if(player.currentPlaylist.count==0) return;
  105.  
  106.         var metaAuthor = player.currentMedia.getItemInfo("author");
  107.  
  108.         if (metaAuthor != "") {
  109.             metaAuthor += " - ";
  110.         }
  111.  
  112.         if(player.openState!=13){
  113.             metadata.value = metaAuthor;
  114.         }
  115.     }else{
  116.         metadata.value = player.status;
  117.         metadata.scrolling = (metadata.textWidth>metadata.width);
  118.         return;
  119.     }
  120.  
  121.     metadata.value += player.currentmedia.name;
  122.     metadata.scrolling = (metadata.textWidth>metadata.width);
  123.  
  124. }
  125.  
  126.  
  127.  
  128. // open file
  129. function openFile()
  130. {
  131.     var media = theme.openDialog('FILE_OPEN','FILES_ALLMEDIA');
  132.     if(media)
  133.     {
  134.         player.URL = media;
  135.         player.controls.play();
  136.     }
  137. }
  138.  
  139. function viewHotKeys()
  140. {
  141.     switch(event.keycode)
  142.     {
  143.         case 122:
  144.         case 90:
  145.             player.controls.previous();
  146.             break;
  147.         case 120:
  148.         case 88:
  149.             player.controls.play();
  150.             break;
  151.         case 99:
  152.         case 67:
  153.             player.controls.pause();
  154.             break;
  155.         case 118:
  156.         case 86:
  157.             player.controls.stop();
  158.             break;
  159.         case 98:
  160.         case 66:
  161.             player.controls.next();
  162.             break;
  163.         case 108:
  164.         case 76:
  165.             openFile();
  166.             break;
  167.     }
  168. }
  169.  
  170. function viewResizer(event)
  171. {
  172.     switch(event.keycode)
  173.     {
  174.         case 37:
  175.             view.width-=20;
  176.             break;
  177.         case 38:
  178.             view.height-=20
  179.             break;
  180.         case 39:
  181.             view.width+=20;
  182.             break;
  183.         case 40:
  184.             view.height+=20;
  185.             break;
  186.     }
  187. }
  188.  
  189. function updateToolTip(id,button,tip)
  190. {
  191.     if("true"==theme.loadPreference( id ))
  192.     {
  193.         eval( button +".upToolTip = locHide" + tip + ".toolTip" );
  194.     }
  195.     else
  196.     {
  197.         eval( button +".upToolTip = locShow" + tip + ".toolTip" );
  198.     }
  199. }
  200.  
  201. function updateSeekToolTip()
  202. {
  203.     if(player.openState!=13) return;
  204.  
  205.     var seekHours = Math.floor((seek.value / 3600));
  206.     if (seekHours < 10) seekHours = "0" + seekHours;
  207.  
  208.     var seekMinutes = Math.floor((seek.value - (seekHours*3600))/60);
  209.     if (seekMinutes < 10) seekMinutes = "0" + seekMinutes;
  210.  
  211.     var seekSeconds = Math.floor((seek.value - (seekMinutes*60) - (seekHours*3600)));
  212.     if (seekSeconds < 10) seekSeconds = "0" + seekSeconds;
  213.  
  214.     var seekString;
  215.  
  216.     if (seekHours==00)
  217.     {
  218.         seekString = "";
  219.     }
  220.     else
  221.     {
  222.         seekString = seekHours + ":";
  223.     }
  224.  
  225.     seekString += seekMinutes + ":" + seekSeconds;
  226.  
  227.     seek.toolTip = seekString;
  228.     seek.toolTip += " / ";
  229.     seek.toolTip += player.currentMedia.DurationString;
  230.  
  231. }
  232.  
  233. function updateVolToolTip(id)
  234. {
  235.     vol = "";
  236.     vol += player.settings.volume;
  237.     eval(id + ".toolTip = vol" );
  238. }
  239.  
  240. function updateShuffRep()
  241. {
  242.     if(player.settings.getMode('shuffle'))
  243.     {
  244.         shuffleButton.down = true;
  245.     }else{
  246.         shuffleButton.down = false;
  247.     }
  248.  
  249.     if(player.settings.getMode('loop'))
  250.     {
  251.         repeatButton.down = true;
  252.     }else{
  253.         repeatButton.down = false;
  254.     }
  255. }
  256.  
  257. //
  258.  
  259. function volKey(event)
  260. {
  261.     switch(event.keycode)
  262.     {
  263.         case 39:
  264.         case 38:
  265.             if(player.settings.volume < 95)
  266.             {
  267.                 player.settings.volume+=5;
  268.             }else{
  269.                 player.settings.volume = 100;
  270.             }
  271.             break;
  272.         case 37:
  273.         case 40:
  274.             if(player.settings.volume > 5)
  275.             {
  276.                 player.settings.volume-=5;
  277.             }else{
  278.                 player.settings.volume = 0;
  279.             }
  280.             break;
  281.     }
  282.     player.settings.mute = false;
  283. }
  284.  
  285. function seekKey(event)
  286. {
  287.     switch(event.keycode)
  288.     {
  289.         case 37:
  290.         case 40:
  291.             if(player.controls.currentPosition > 10)
  292.             {
  293.                 player.controls.currentPosition-=10;
  294.             }else{
  295.                 player.controls.currentPosition = 0;
  296.             }
  297.             break;
  298.         case 39:
  299.         case 38:
  300.             if(player.controls.currentPosition < player.currentMedia.duration)
  301.             {
  302.                 player.controls.currentPosition+=10;
  303.             }else{
  304.                 player.controls.currentPosition = player.currentMedia.duration;
  305.             }
  306.             break;
  307.     }
  308. }
  309.  
  310. // view toggle 
  311.  
  312. function toggleView(name,id)
  313. {
  314.     if("true"==theme.loadPreference(id))
  315.     {
  316.         theme.savePreference(id, "false");
  317.         theme.closeView( name );
  318.     }else{
  319.         sampleAlpha();
  320.         theme.openView( name );
  321.     }
  322. }
  323.  
  324. function closeView(id)
  325. {
  326.     theme.savePreference(id, "false");
  327.     if( id=="vidViewer" )
  328.     {
  329.         player.controls.stop();
  330.         //theme.savePreference("vidCheck", "false");
  331.         theme.savePreference("vidViewer", "false");
  332.     }
  333.     view.close();
  334. }
  335.  
  336. function autoSizeView(width,height)
  337. {
  338.     var viewSize = theme.loadPreference( width );
  339.  
  340.     if( "--" != viewSize )
  341.     {
  342.         view.width = viewSize;
  343.     }else{
  344.         view.width = view.minWidth;
  345.     }
  346.  
  347.     viewSize = theme.loadpreference( height );
  348.  
  349.     if( "--" != viewSize )
  350.     {
  351.         view.height = viewSize;
  352.     }else{
  353.         view.height = view.minHeight;
  354.     }
  355. }
  356.  
  357. function saveViewSize(width,height)
  358. {
  359.     theme.savepreference( width , view.width );
  360.     theme.savepreference( height , view.height );
  361. }
  362.  
  363. // preferences
  364.  
  365. function loadMainPrefs(){
  366.  
  367.     htcpStartup();
  368.     sampleAlpha();
  369.  
  370.     if ("true"==theme.loadPreference("plViewer"))
  371.     {
  372.         theme.openView( 'plView' );
  373.     }
  374.  
  375.     if ("true"==theme.loadPreference("eqViewer"))
  376.     {
  377.         theme.openView( 'eqView' );
  378.     }
  379.  
  380.     if ("true"==theme.loadPreference("visViewer"))
  381.     {
  382.         theme.openView( 'visView' );
  383.     }
  384.  
  385.     if ("true"==theme.loadPreference("remoteViewer"))
  386.     {
  387.         theme.openView( 'remoteView' );
  388.     }
  389.  
  390. }
  391.  
  392. function saveMainPrefs()
  393. {
  394.  
  395. }
  396.  
  397. function mainShutDown()
  398. {
  399.     saveMainPrefs();
  400. }
  401.  
  402. // // //
  403. /*
  404.     Hyper-Transient Color PhasingÖ (HTCP)
  405.     Hyper-Transient Color Phasing is a trademark of The Skins Factory, Inc. Patent Pending. All scripts related to Hyper-Transient Color Phasing are Copyright ⌐ 2003. The Skins Factory, Inc. All Rights Reserved.
  406.     Private use only. Sale, duplication, or other transfer of this material is strictly prohibited. 
  407. */
  408.  
  409. function blendFrameFast(win, num, blend)
  410. {
  411.     for(x=1; x<9; x++)
  412.     {
  413.         eval( win + x + "_" + num + ".alphaBlend = '" + blend + "';" );
  414.     }
  415. }
  416.  
  417. function blendFrameSlow(win, num, blend, speed)
  418. {
  419.     for(x=1; x<9; x++)
  420.     {
  421.         eval( win + x + "_" + num + ".alphaBlendTo(" + blend + "," + speed + ");" );
  422.     }
  423. }
  424.  
  425. function htcpSetMsg()
  426. {
  427.     var val = theme.loadPreference('htcpMsg');
  428.     if(val=='--')
  429.     {
  430.         theme.savePreference('htcpMsg','true');
  431.     }
  432. }
  433.  
  434. function htcpMsgToggle()
  435. {
  436.     if("true"==theme.loadPreference("htcpMsg")){
  437.         theme.savePreference('htcpMsg', "false" );
  438.         msgButton.down = true;
  439.     }
  440.     else
  441.     {
  442.         theme.savePreference('htcpMsg', "true" );
  443.         msgButton.down = false;
  444.     }
  445. }
  446.  
  447. function htcpSetTimerStatus()
  448. {
  449.     var val = theme.loadPreference('htcpTimerStatus');
  450.     if(val=='--')
  451.     {
  452.         theme.savePreference('htcpTimerStatus',"false");
  453.     }
  454. }
  455.  
  456. function htcpSetTimer()
  457. {
  458.     var val = theme.loadPreference('htcpTimer');
  459.     if(val=='--')
  460.     {
  461.         theme.savePreference('htcpTimer',1000);
  462.     }
  463. }
  464.  
  465. function htcpSetID()
  466. {
  467.     var val = theme.loadPreference('htcpID');
  468.     if(val=='--')
  469.     {
  470.         theme.savePreference('htcpID','5');
  471.     }
  472. }
  473.  
  474. function htcpTimerPause()
  475. {
  476.     if("true"==theme.loadPreference("htcpTimerStatus")){
  477.         theme.savePreference('htcpTimerStatus', "false" );
  478.         htcpValue.value = htcpPause.toolTip;
  479.         htcpAdjust.toolTip = htcp2.toolTip;
  480.         htcpAdjust.enabled = false;
  481.     }
  482.     else
  483.     {
  484.         theme.savePreference('htcpTimerStatus', "true" );
  485.         htcpAdjust.enabled = true;
  486.         htcpSliderUpdate();
  487.         htcpAdjust.toolTip = htcp1.toolTip;
  488.     }
  489. }
  490.  
  491. var mainStatus = 1;
  492. var htcpStatus = 0;
  493.  
  494.  
  495. function htcpStartup()
  496. {
  497.     var mainColor = theme.loadPreference('htcpID');
  498.  
  499.     if(mainColor==1)
  500.     {
  501.         mainBack2.alphaBlend = 255;
  502.         mainStatus = 1;
  503.         htcpStatus = 0;
  504.         time.foregroundColor = "#a2d626";
  505.     }
  506.     else if(mainColor==2)
  507.     {
  508.         mainBack3.alphaBlend = 255;
  509.         mainStatus = 2;
  510.         htcpStatus = 1;
  511.         time.foregroundColor = "#2885d8";
  512.     }
  513.     else if(mainColor==3)
  514.     {
  515.         mainBack3.alphaBlend = 255;
  516.         mainBack4.alphaBlend = 255;
  517.         mainStatus = 3;
  518.         htcpStatus = 2;
  519.         time.foregroundColor = "#ff1203";
  520.     }
  521.     else if(mainColor==4)
  522.     {
  523.         mainBack5.alphaBlend = 255;
  524.         mainStatus = 4;
  525.         htcpStatus = 3;
  526.         time.foregroundColor = "#ff7f04";
  527.     }
  528.     else if(mainColor==5)
  529.     {
  530.         mainBack5.alphaBlend = 0;
  531.         mainStatus = 5;
  532.         htcpStatus = 4;
  533.         time.foregroundColor = "#d1d9e3";
  534.     }
  535.  
  536.     htcpMain();
  537.     theme.savePreference('htcpTimerStatus', 'true' );
  538. }
  539.  
  540. function htcpMain()
  541. {
  542.     var mainTimer = theme.loadPreference('htcpTimer');
  543.  
  544.     if("true"==theme.loadPreference('htcpTimerStatus'))
  545.     {
  546.     
  547.         if(mainStatus==1&&htcpStatus==0)
  548.         {
  549.             mainBack2.alphaBlendTo(255,mainTimer);
  550.             mainStatus++
  551.             theme.savePreference('htcpID','1');
  552.             time.foregroundColor = "#a2d626";
  553.         }
  554.         else if(mainStatus==2&&htcpStatus==1)
  555.         {
  556.             mainBack3.alphaBlendTo(255,mainTimer);
  557.             mainStatus++
  558.             theme.savePreference('htcpID','2');
  559.             time.foregroundColor = "#2885d8";
  560.         }
  561.         else if(mainStatus==3&&htcpStatus==2)
  562.         {
  563.             mainBack4.alphaBlendTo(255,mainTimer);
  564.             mainStatus++
  565.             theme.savePreference('htcpID','3');
  566.             time.foregroundColor = "#ff1203";
  567.         }
  568.         else if(mainStatus==4&&htcpStatus==3)
  569.         {
  570.             mainBack5.alphaBlendTo(255,mainTimer);
  571.             mainStatus++
  572.             theme.savePreference('htcpID','4');
  573.             time.foregroundColor = "#ff7f04";
  574.         }
  575.         else if(mainStatus==5&&htcpStatus==4)
  576.         {
  577.             mainBack5.alphaBlendTo(0,mainTimer);
  578.             mainStatus = 1;
  579.             theme.savePreference('htcpID','5');
  580.             time.foregroundColor = "#d1d9e3";
  581.  
  582.             mainBack2.alphaBlend = 0;
  583.             mainBack3.alphaBlend = 0;
  584.             mainBack4.alphaBlend = 0;
  585.         }
  586.         
  587. //        var viewTimer = theme.loadPreference('htcpViewTimer');
  588. //        view.timerInterval = (Math.round(viewTimer)) + (Math.round(mainTimer));
  589.  
  590.     }
  591. }
  592.  
  593. function htcpCheck()
  594. {
  595.     htcpStatus++
  596.  
  597.     if(htcpStatus==5)
  598.     {
  599.         htcpStatus = 0;
  600.     }
  601.  
  602. }
  603.  
  604. function sampleAlpha()
  605. {
  606.     var htcpAlpha = theme.loadPreference('htcpID');
  607.  
  608.     if(htcpAlpha==1)
  609.     {
  610.         htcpOpac = mainBack2.alphaBlend;
  611.         theme.savePreference('winAlpha',htcpOpac);
  612.     }
  613.     else if(htcpAlpha==2)
  614.     {
  615.         htcpOpac = mainBack3.alphaBlend;
  616.         theme.savePreference('winAlpha',htcpOpac);
  617.     }
  618.     else if(htcpAlpha==3)
  619.     {
  620.         htcpOpac = mainBack4.alphaBlend;
  621.         theme.savePreference('winAlpha',htcpOpac);
  622.     }
  623.     else if(htcpAlpha==4)
  624.     {
  625.         htcpOpac = mainBack5.alphaBlend;
  626.         theme.savePreference('winAlpha',htcpOpac);
  627.     }
  628.     else if(htcpAlpha==5)
  629.     {
  630.         htcpOpac = mainBack5.alphaBlend;
  631.         theme.savePreference('winAlpha',htcpOpac);
  632.     }
  633.  
  634.  
  635. }
  636.  
  637. var remoteStatus = 1;
  638.  
  639. function htcpStartupRemote()
  640. {
  641.     var htcpAlpha = theme.loadPreference('htcpID');
  642.     var winColor = theme.loadPreference('winAlpha');
  643.  
  644.     if(htcpAlpha==1)
  645.     {
  646.         remoteBack2.alphaBlend = winColor;
  647.         remoteStatus = 0;
  648.     }
  649.     else if(htcpAlpha==2)
  650.     {
  651.         remoteBack2.alphaBlend = 255;
  652.         remoteBack3.alphaBlend = winColor;
  653.         remoteStatus = 1;
  654.     }
  655.     else if(htcpAlpha==3)
  656.     {
  657.         remoteBack3.alphaBlend = 255;
  658.         remoteBack4.alphaBlend = winColor;
  659.         remoteStatus = 2;
  660.     }
  661.     else if(htcpAlpha==4)
  662.     {
  663.         remoteBack4.alphaBlend = 255;
  664.         remoteBack5.alphaBlend = winColor;
  665.         remoteStatus = 3;
  666.     }
  667.     else if(htcpAlpha==5)
  668.     {
  669.         remoteBack5.alphaBlend = winColor;
  670.         remoteStatus = 4;
  671.     }
  672.  
  673.  
  674.     htcpRemote();
  675. }
  676.  
  677. function htcpRemote()
  678. {
  679.  
  680.     var winTimer = theme.loadPreference('htcpTimer');
  681.     var htcpAlpha = theme.loadPreference('htcpID');
  682.  
  683.     if(htcpAlpha==1&&remoteStatus==0)
  684.     {
  685.         remoteBack2.alphaBlendTo(255,winTimer);
  686.         remoteStatus++;
  687.     }
  688.     else if(htcpAlpha==2&&remoteStatus==1)
  689.     {
  690.         remoteBack3.alphaBlendTo(255,winTimer);
  691.         remoteStatus++;
  692.     }
  693.     else if(htcpAlpha==3&&remoteStatus==2)
  694.     {
  695.         remoteBack4.alphaBlendTo(255,winTimer);
  696.         remoteStatus++;
  697.     }
  698.     else if(htcpAlpha==4&&remoteStatus==3)
  699.     {
  700.         remoteBack5.alphaBlendTo(255,winTimer);
  701.         remoteStatus++;
  702.     }
  703.     else if(htcpAlpha==5&&remoteStatus==4)
  704.     {
  705.  
  706.         remoteBack5.alphaBlendTo(0,winTimer);
  707.         remoteStatus = 0;
  708.         
  709.         remoteBack2.alphaBlend = 0;
  710.         remoteBack3.alphaBlend = 0;
  711.         remoteBack4.alphaBlend = 0;
  712.     }
  713.  
  714. }
  715.  
  716. var plStatus = 1;
  717.  
  718. function htcpStartupPl()
  719. {
  720.     var htcpAlpha = theme.loadPreference('htcpID');
  721.     var winColor = theme.loadPreference('winAlpha');
  722.  
  723.     if(htcpAlpha==1)
  724.     {
  725.         blendFrameFast('pl',2,winColor);
  726.         plStatus = 0;
  727.         playlist1.itemPlayingBackgroundColor = "#a2d626";
  728.         playlist1.itemPlayingColor = "#000000";
  729.     }
  730.     else if(htcpAlpha==2)
  731.     {
  732.         blendFrameFast('pl',2,255);
  733.         blendFrameFast('pl',3,winColor);
  734.         plStatus = 1;
  735.         playlist1.itemPlayingBackgroundColor = "#2885d8";
  736.         playlist1.itemPlayingColor = "#ffffff";
  737.     }
  738.     else if(htcpAlpha==3)
  739.     {
  740.         blendFrameFast('pl',2,255);
  741.         blendFrameFast('pl',3,255);
  742.         blendFrameFast('pl',4,winColor);
  743.         plStatus = 2;
  744.         playlist1.itemPlayingBackgroundColor = "#ff1203";
  745.         playlist1.itemPlayingColor = "#ffffff";
  746.     }
  747.     else if(htcpAlpha==4)
  748.     {
  749.         blendFrameFast('pl',3,255);
  750.         blendFrameFast('pl',4,255);
  751.         blendFrameFast('pl',5,winColor);
  752.         plStatus = 3;
  753.         playlist1.itemPlayingBackgroundColor = "#ff7f04";
  754.         playlist1.itemPlayingColor = "#ffffff";
  755.     }
  756.     else if(htcpAlpha==5)
  757.     {
  758.  
  759.         blendFrameFast('pl',5,winColor);
  760.         plStatus = 4;
  761.         playlist1.itemPlayingBackgroundColor = "#d1d9e3";
  762.         playlist1.itemPlayingColor = "#000000";
  763.     }
  764.  
  765.  
  766.     htcpPl();
  767. }
  768.  
  769. function htcpPl()
  770. {
  771.  
  772.     var winTimer = theme.loadPreference('htcpTimer');
  773.     var htcpAlpha = theme.loadPreference('htcpID');
  774.  
  775.     if(htcpAlpha==1&&plStatus==0)
  776.     {
  777.         blendFrameSlow('pl',2,255,winTimer);
  778.         plStatus++;
  779.         playlist1.itemPlayingBackgroundColor = "#a2d626";
  780.         playlist1.itemPlayingColor = "#000000";
  781.     }
  782.     else if(htcpAlpha==2&&plStatus==1)
  783.     {
  784.         blendFrameFast('pl',2,255);
  785.         blendFrameSlow('pl',3,255,winTimer);
  786.         plStatus++;
  787.         playlist1.itemPlayingBackgroundColor = "#2885d8";
  788.         playlist1.itemPlayingColor = "#ffffff";
  789.     }
  790.     else if(htcpAlpha==3&&plStatus==2)
  791.     {
  792.         blendFrameFast('pl',3,255);
  793.         blendFrameSlow('pl',4,255,winTimer);
  794.         plStatus++;
  795.         playlist1.itemPlayingBackgroundColor = "#ff1203";
  796.         playlist1.itemPlayingColor = "#ffffff";
  797.     }
  798.     else if(htcpAlpha==4&&plStatus==3)
  799.     {
  800.         blendFrameFast('pl',4,255);
  801.         blendFrameSlow('pl',5,255,winTimer);
  802.         plStatus++;
  803.         playlist1.itemPlayingBackgroundColor = "#ff7f04";
  804.         playlist1.itemPlayingColor = "#ffffff";
  805.     }
  806.     else if(htcpAlpha==5&&plStatus==4)
  807.     {
  808.  
  809.         blendFrameSlow('pl',5,0,winTimer);
  810.         plStatus = 0;
  811.         playlist1.itemPlayingBackgroundColor = "#d1d9e3";
  812.         playlist1.itemPlayingColor = "#000000";
  813.         
  814.         blendFrameFast('pl',2,0);
  815.         blendFrameFast('pl',3,0);
  816.         blendFrameFast('pl',4,0);
  817.     }
  818.  
  819. }
  820.  
  821. var eqStatus = 1;
  822.  
  823. function htcpStartupEq()
  824. {
  825.     var htcpAlpha = theme.loadPreference('htcpID');
  826.     var winColor = theme.loadPreference('winAlpha');
  827.  
  828.     if(htcpAlpha==1)
  829.     {
  830.         blendFrameFast('eq',2,winColor);
  831.         eqStatus = 0;
  832.     }
  833.     else if(htcpAlpha==2)
  834.     {
  835.         blendFrameFast('eq',2,255);
  836.         blendFrameFast('eq',3,winColor);
  837.         eqStatus = 1;
  838.     }
  839.     else if(htcpAlpha==3)
  840.     {
  841.         blendFrameFast('eq',3,255);
  842.         blendFrameFast('eq',4,winColor);
  843.         eqStatus = 2;
  844.     }
  845.     else if(htcpAlpha==4)
  846.     {
  847.         blendFrameFast('eq',4,255);
  848.         blendFrameFast('eq',5,winColor);
  849.         eqStatus = 3;
  850.     }
  851.     else if(htcpAlpha==5)
  852.     {
  853.  
  854.         blendFrameFast('eq',5,winColor);
  855.         eqStatus = 4;
  856.     }
  857.  
  858.  
  859.     htcpEq();
  860. }
  861.  
  862. function htcpEq()
  863. {
  864.  
  865.     var winTimer = theme.loadPreference('htcpTimer');
  866.     var htcpAlpha = theme.loadPreference('htcpID');
  867.  
  868.     if(htcpAlpha==1&&eqStatus==0)
  869.     {
  870.         blendFrameSlow('eq',2,255,winTimer);
  871.         eqStatus++;
  872.         toggleSliderColor('2');
  873.     }
  874.     else if(htcpAlpha==2&&eqStatus==1)
  875.     {
  876.         blendFrameSlow('eq',3,255,winTimer);
  877.         eqStatus++;
  878.         toggleSliderColor('3');
  879.     }
  880.     else if(htcpAlpha==3&&eqStatus==2)
  881.     {
  882.         blendFrameSlow('eq',4,255,winTimer);
  883.         eqStatus++;
  884.         toggleSliderColor('4');
  885.     }
  886.     else if(htcpAlpha==4&&eqStatus==3)
  887.     {
  888.         blendFrameSlow('eq',5,255,winTimer);
  889.         eqStatus++;
  890.         toggleSliderColor('5');
  891.     }
  892.     else if(htcpAlpha==5&&eqStatus==4)
  893.     {
  894.         blendFrameSlow('eq',5,0,winTimer);
  895.         eqStatus = 0;
  896.         toggleSliderColor('1');
  897.  
  898.         blendFrameFast('eq',2,0);
  899.         blendFrameFast('eq',3,0);
  900.         blendFrameFast('eq',4,0);
  901.     }
  902.     
  903.  
  904. }
  905.  
  906. var visStatus = 1;
  907.  
  908. function htcpStartupVis()
  909. {
  910.     var htcpAlpha = theme.loadPreference('htcpID');
  911.     var winColor = theme.loadPreference('winAlpha');
  912.  
  913.     if(htcpAlpha==1)
  914.     {
  915.         blendFrameFast('vis',2,winColor);
  916.         visStatus = 0;
  917.     }
  918.     else if(htcpAlpha==2)
  919.     {
  920.         blendFrameFast('vis',2,255);
  921.         blendFrameFast('vis',3,winColor);
  922.         visStatus = 1;
  923.     }
  924.     else if(htcpAlpha==3)
  925.     {
  926.         blendFrameFast('vis',3,255);
  927.         blendFrameFast('vis',4,winColor);
  928.         visStatus = 2;
  929.     }
  930.     else if(htcpAlpha==4)
  931.     {
  932.         blendFrameFast('vis',4,255);
  933.         blendFrameFast('vis',5,winColor);
  934.         visStatus = 3;
  935.     }
  936.     else if(htcpAlpha==5)
  937.     {
  938.  
  939.         blendFrameFast('vis',5,winColor);
  940.         visStatus = 4;
  941.     }
  942.  
  943.  
  944.     htcpVis();
  945. }
  946.  
  947. function htcpVis()
  948. {
  949.  
  950.     var winTimer = theme.loadPreference('htcpTimer');
  951.     var htcpAlpha = theme.loadPreference('htcpID');
  952.  
  953.     if(htcpAlpha==1&&visStatus==0)
  954.     {
  955.         blendFrameSlow('vis',2,255,winTimer);
  956.         visStatus++;
  957.     }
  958.     else if(htcpAlpha==2&&visStatus==1)
  959.     {
  960.         blendFrameSlow('vis',3,255,winTimer);
  961.         visStatus++;
  962.     }
  963.     else if(htcpAlpha==3&&visStatus==2)
  964.     {
  965.         blendFrameSlow('vis',4,255,winTimer);
  966.         visStatus++;
  967.     }
  968.     else if(htcpAlpha==4&&visStatus==3)
  969.     {
  970.         blendFrameSlow('vis',5,255,winTimer);
  971.         visStatus++;
  972.     }
  973.     else if(htcpAlpha==5&&visStatus==4)
  974.     {
  975.         blendFrameSlow('vis',5,0,winTimer);
  976.         visStatus = 0;
  977.  
  978.         blendFrameFast('vis',2,0);
  979.         blendFrameFast('vis',3,0);
  980.         blendFrameFast('vis',4,0);
  981.     }
  982.  
  983. }
  984.  
  985. var vidStatus = 1;
  986.  
  987. function htcpStartupVid()
  988. {
  989.     var htcpAlpha = theme.loadPreference('htcpID');
  990.     var winColor = theme.loadPreference('winAlpha');
  991.  
  992.     if(htcpAlpha==1)
  993.     {
  994.         blendFrameFast('vid',2,winColor);
  995.         vidDrawer2.alphaBlend = winColor;
  996.         vidStatus = 0;
  997.     }
  998.     else if(htcpAlpha==2)
  999.     {
  1000.         blendFrameFast('vid',2,255);
  1001.         blendFrameFast('vid',3,winColor);
  1002.         vidDrawer2.alphaBlend = 255;
  1003.         vidDrawer3.alphaBlend = winColor;
  1004.         vidStatus = 1;
  1005.     }
  1006.     else if(htcpAlpha==3)
  1007.     {
  1008.         blendFrameFast('vid',2,255);
  1009.         blendFrameFast('vid',3,255);
  1010.         blendFrameFast('vid',4,winColor);
  1011.         vidDrawer2.alphaBlend = 255;
  1012.         vidDrawer3.alphaBlend = 255;
  1013.         vidDrawer4.alphaBlend = winColor;
  1014.         vidStatus = 2;
  1015.     }
  1016.     else if(htcpAlpha==4)
  1017.     {
  1018.         blendFrameFast('vid',3,255);
  1019.         blendFrameFast('vid',4,255);
  1020.         blendFrameFast('vid',5,winColor);
  1021.         vidDrawer3.alphaBlend = 255;
  1022.         vidDrawer4.alphaBlend = 255;
  1023.         vidDrawer5.alphaBlend = winColor;
  1024.         vidStatus = 3;
  1025.     }
  1026.     else if(htcpAlpha==5)
  1027.     {
  1028.  
  1029.         blendFrameFast('vid',5,winColor);
  1030.         vidDrawer5.alphaBlend = winColor;
  1031.         vidStatus = 4;
  1032.     }
  1033.  
  1034.  
  1035.     htcpVid();
  1036. }
  1037.  
  1038. function htcpVid()
  1039. {
  1040.  
  1041.     var winTimer = theme.loadPreference('htcpTimer');
  1042.     var htcpAlpha = theme.loadPreference('htcpID');
  1043.  
  1044.     if(htcpAlpha==1&&vidStatus==0)
  1045.     {
  1046.         blendFrameSlow('vid',2,255,winTimer);
  1047.         vidDrawer2.alphaBlendTo(255,winTimer);
  1048.         vidStatus++;
  1049.     }
  1050.     else if(htcpAlpha==2&&vidStatus==1)
  1051.     {
  1052.         blendFrameFast('vid',2,255);
  1053.         blendFrameSlow('vid',3,255,winTimer);
  1054.         vidDrawer3.alphaBlendTo(255,winTimer);
  1055.         vidStatus++;
  1056.     }
  1057.     else if(htcpAlpha==3&&vidStatus==2)
  1058.     {
  1059.         blendFrameFast('vid',3,255);
  1060.         blendFrameSlow('vid',4,255,winTimer);
  1061.         vidDrawer4.alphaBlendTo(255,winTimer);
  1062.         vidStatus++;
  1063.     }
  1064.     else if(htcpAlpha==4&&vidStatus==3)
  1065.     {
  1066.         blendFrameFast('vid',4,255);
  1067.         blendFrameSlow('vid',5,255,winTimer);
  1068.         vidDrawer5.alphaBlendTo(255,winTimer);
  1069.         vidStatus++;
  1070.     }
  1071.     else if(htcpAlpha==5&&vidStatus==4)
  1072.     {
  1073.         blendFrameSlow('vid',5,0,winTimer);
  1074.         vidDrawer5.alphaBlendTo(0,winTimer);
  1075.         vidStatus = 0;
  1076.  
  1077.         blendFrameFast('vid',2,0);
  1078.         blendFrameFast('vid',3,0);
  1079.         blendFrameFast('vid',4,0);
  1080.  
  1081.         vidDrawer2.alphaBlend = 0;
  1082.         vidDrawer3.alphaBlend = 0;
  1083.         vidDrawer4.alphaBlend = 0;
  1084.  
  1085.     }
  1086.  
  1087. }
  1088.  
  1089.  
  1090. // // // 
  1091. // playlist
  1092. function loadPlPrefs()
  1093. {
  1094.     theme.savePreference( 'plViewer', "true" );
  1095.  
  1096.     autoSizeView('plWidth','plHeight');
  1097.  
  1098.     var index = 0;
  1099.  
  1100.     playlist1.setColumnResizeMode( index++, "AutosizeData" );
  1101.     playlist1.setColumnResizeMode( index++, "Stretches" );
  1102.     playlist1.setColumnResizeMode( index++, "AutosizeHeader" );
  1103.     playlist1.setColumnResizeMode( index++, "AutosizeHeader" );
  1104.     playlist1.setColumnResizeMode( index++, "AutosizeHeader" );
  1105.     playlist1.setColumnResizeMode( index++, "AutosizeHeader" );
  1106.  
  1107.     htcpStartupPl();
  1108. }
  1109.  
  1110. function savePlPrefs(){
  1111.     saveViewSize('plWidth','plHeight');
  1112. }
  1113.  
  1114. // eq settings
  1115. function loadEQPrefs(){
  1116.     theme.savePreference( 'eqViewer', "true" );
  1117.     view.width = view.minWidth;
  1118.     view.height = view.minHeight;
  1119.  
  1120.     htcpStartupEq();
  1121. }
  1122.  
  1123. function updateBalToolTip(){
  1124.     balance.toolTip = "";
  1125.     balance.toolTip += player.settings.balance;
  1126. }
  1127.  
  1128. function toggleSpeaker(){
  1129.     if(eq.speakerSize==2){
  1130.         eq.speakerSize = -1;
  1131.     }
  1132.     eq.speakerSize++
  1133.  
  1134. }
  1135.  
  1136. function toggleSliderColor(id)
  1137. {
  1138.     for(x=1; x<=10 ; x++)
  1139.     {
  1140.         eval("eq" + x + ".foregroundImage='eq_slider_" + id + ".png'");
  1141.     }
  1142.     eval("truBass.foregroundImage='srs_slider_" + id + ".png'");
  1143.     eval("wowEffect.foregroundImage='srs_slider_" + id + ".png'");
  1144.     eval("balance.thumbImage='eq_thumb_" + id + ".png'");
  1145. }
  1146.  
  1147. // visualizations
  1148. function loadVisPrefs(){
  1149.     theme.savePreference( 'visViewer', "true" );
  1150.     visEffects.currentEffectType = mediacenter.effectType;
  1151.     visEffects.currentPreset = mediacenter.effectPreset;
  1152.  
  1153.     autoSizeView('visWidth','visHeight');
  1154.  
  1155.     htcpStartupVis();
  1156.     checkVisualsPlayerState();
  1157. }
  1158.  
  1159. function saveVisPrefs(){
  1160.     mediacenter.effectType = visEffects.currentEffectType;
  1161.     mediacenter.effectPreset = visEffects.currentPreset;
  1162.     saveViewSize('visWidth','visHeight');
  1163. }
  1164.  
  1165. function checkVisualsPlayerState(){
  1166.  
  1167.     if (player){
  1168.         switch (player.playState){
  1169.             case 3:     //playing
  1170.                 //visMask.visible = true;
  1171.                 break;
  1172.  
  1173.             }
  1174.         }
  1175.  
  1176.     if (!player.controls.isAvailable("Stop")) {
  1177.         //visMask.visible = false;
  1178.     }
  1179. }
  1180.  
  1181.  
  1182. // video settings
  1183.  
  1184. function loadVidPrefs(){
  1185.     theme.savePreference( 'vidViewer', "true" );
  1186.  
  1187.     var _drawerStatus = theme.loadPreference('drawerStatus');
  1188.  
  1189.     if (_drawerStatus != '--') {
  1190.         drawerStatus = (_drawerStatus.toLowerCase() == 'true') ? false : true;
  1191.     } else {
  1192.         drawerStatus = true;
  1193.     }
  1194.  
  1195.     checkSnapStatus();
  1196.     checkVideoPlayerState();
  1197.     htcpStartupVid();
  1198.     updateZoomToolTip();
  1199.     toggleVidDrawer();
  1200. }
  1201.  
  1202. function saveVidPrefs(){
  1203.     theme.savePreference('drawerStatus',drawerStatus);
  1204. }
  1205.  
  1206. function loadVidSize(){
  1207.     var vidSizer = theme.loadPreference( "videoWidth" );
  1208.  
  1209.     if( "--" != vidSizer )
  1210.     {
  1211.         view.width = vidSizer;
  1212.     }
  1213.     vidSizer = theme.loadpreference( "videoHeight" );
  1214.  
  1215.     if( "--" != vidSizer )
  1216.     {
  1217.         view.height = vidSizer;
  1218.     }
  1219. }
  1220.  
  1221. function saveVidSize(){
  1222.     theme.savepreference( "videoWidth", view.width );
  1223.     theme.savepreference( "videoHeight", view.height );
  1224.     theme.savePreference("vidSnapper" , "false");
  1225.     vidZoom.upToolTip = vidSetTip.toolTip;
  1226.     mediacenter.videoZoom = 50;
  1227. }
  1228.  
  1229. function videoZoom(){
  1230.     if("false"==theme.loadPreference("vidSnapper")){
  1231.         mediacenter.videoZoom = 50;
  1232.     }
  1233.     if(mediacenter.videoZoom < 76){
  1234.         mediacenter.videoZoom = 100;
  1235.     }else if(mediacenter.videoZoom <101){
  1236.         mediacenter.videoZoom = 150;
  1237.     }else if(mediacenter.videoZoom < 156){
  1238.         mediacenter.videoZoom = 200;
  1239.     }else{
  1240.         mediacenter.videoZoom = 75;
  1241.     }
  1242.     SnapToVideo();
  1243.     updateZoomToolTip();
  1244. }
  1245.  
  1246. function updateZoomToolTip(){
  1247.  
  1248.     vidZoom.upToolTip = vidZoomIn.toolTip + mediacenter.videoZoom + vidZoomMid.toolTip;
  1249.  
  1250.     if(mediacenter.videoZoom < 76){
  1251.         nextZoom = 100;
  1252.     }else if(mediacenter.videoZoom <101){
  1253.         nextZoom = 150;
  1254.     }else if(mediacenter.videoZoom < 156){
  1255.         nextZoom = 200;
  1256.     }else{
  1257.         nextZoom = 75;
  1258.     }
  1259.  
  1260.     vidZoom.upToolTip += nextZoom + vidZoomOut.toolTip;
  1261.     
  1262.     if("false"==theme.loadPreference("vidSnapper")){
  1263.         vidZoom.upToolTip = vidSetTip.toolTip;
  1264.     }
  1265. }
  1266.  
  1267. function SnapToVideo(){
  1268.  
  1269.     theme.savePreference("vidSnapper" , "true");
  1270.  
  1271.     var zoom = mediacenter.videoZoom;
  1272.     var viewWidth = (player.currentMedia.imageSourceWidth * (zoom/100.00));
  1273.     var viewHeight = (player.currentMedia.imageSourceHeight * (zoom/100.00));
  1274.  
  1275.     view.width = viewWidth + 42;
  1276.     view.height = viewHeight + 129;
  1277. }
  1278.  
  1279. function checkSnapStatus(){
  1280.     if(player.openState!=13) return;
  1281.     if("false"==theme.loadPreference("vidSnapper")){
  1282.         loadVidSize();
  1283.     }else{
  1284.         SnapToVideo();
  1285.     }
  1286. }
  1287.  
  1288. function checkVideoPlayerState(){
  1289.     if (player){
  1290.         switch (player.playState){
  1291.             
  1292.             case 3:     //playing
  1293.                 if(!player.currentMedia.ImageSourceWidth>0){
  1294.                     theme.savePreference('vidViewer', "false");
  1295.                     view.close();
  1296.                     break;
  1297.                 }
  1298.                 vidBack.visible = false;
  1299.                 videoFrame.visible = true;
  1300.                 if(!player.fullScreen){
  1301.                     checkSnapStatus();
  1302.                 }
  1303.                 break;
  1304.             case 8:
  1305.                 return;
  1306.                 break;
  1307.             }
  1308.             vidResize.enabled = true;
  1309.             vidZoom.enabled = true;
  1310.         }
  1311.  
  1312.     if (!player.controls.isAvailable("Stop")) {
  1313.         videoFrame.visible = false;
  1314.         vidResize.enabled = false;
  1315.         vidZoom.enabled = false;
  1316.         vidBack.visible = true;
  1317.         view.width = 317;
  1318.         view.height = 261;
  1319.     }
  1320. }
  1321.  
  1322. function toggleVidDrawer(){
  1323.     if(!drawerStatus){
  1324.         vidDrawer.moveTo(0,view.height-93,500);
  1325.         vidDrawerFrame.visible = true;
  1326.         vidDrawerButton.down = true;
  1327.         drawerStatus = !drawerStatus;
  1328.     }else{
  1329.         vidDrawer.moveTo(0,view.height-180,500);
  1330.         drawerStatus = !drawerStatus;
  1331.     }
  1332. }
  1333.  
  1334. function checkVidDrawer(){
  1335.     drawerStatus = drawerStatus;
  1336.     vidDrawerFrame.visible = drawerStatus;
  1337. }
  1338.