home *** CD-ROM | disk | FTP | other *** search
/ Minami 79 / MINAMI79.iso / Extra / MPSetup.exe / 1033 / RCDATA / CABINET / wmploc.DLL / 256 / CROSSFADE.JS < prev    next >
Text File  |  2002-12-14  |  2KB  |  114 lines

  1. // Windows Media Player - Copyright 2002 Microsoft Corporation.
  2. //<script>
  3.  
  4. //
  5. // Initialization
  6. //
  7.  
  8. function InitCrossFade()
  9. {
  10.     if (PlayingDVD())
  11.     {
  12.         normalizationOnOff.enabled=false;
  13.         crossFadeOnOff.enabled=false;
  14.     }
  15.     else
  16.     {
  17.         normalizationOnOff.enabled=true;
  18.         crossFadeOnOff.enabled=true;
  19.     }
  20.  
  21.     UpdateNormalizationOnOff();
  22.     UpdateCrossFadeOnOff();
  23.     UpdateCrossFadeWindow();
  24. }
  25.  
  26. function OnMediaChange(Item)
  27. {
  28.     if( Item == player.currentMedia )
  29.     {
  30.         InitCrossFade();
  31.     }
  32. }
  33.  
  34. //
  35. // Updating
  36. //
  37.  
  38. function UpdateCrossFadeOnOff()
  39. {
  40.     if (eq.crossFade)
  41.     {
  42.         crossFadeOnOff.value="res://wmploc.dll/RT_STRING/#1916";
  43.     }
  44.     else
  45.     {
  46.         crossFadeOnOff.value="res://wmploc.dll/RT_STRING/#1915";
  47.     }
  48.  
  49.     if (crossFadeOnOff.enabled)
  50.     {
  51.         SetDisabledUI(!eq.crossFade);
  52.     }
  53.     else
  54.     {
  55.         SetDisabledUI(true);
  56.     }
  57. }
  58.  
  59. function UpdateCrossFadeWindow()
  60. {
  61.     var format = theme.loadString("res://wmploc/RT_STRING/#1918");
  62.  
  63.     var num = eq.crossFadeWindow / 100;
  64.  
  65.     format = format.replace(/%1/i, Math.floor(num / 10));
  66.     format = format.replace(/%2/i, Math.floor(num % 10));
  67.  
  68.     overlap.value = format;
  69. }
  70.  
  71. function UpdateNormalizationOnOff()
  72. {
  73.     if (eq.normalization)
  74.     {
  75.         normalizationOnOff.value="res://wmploc.dll/RT_STRING/#1912";
  76.     }
  77.     else
  78.     {
  79.         normalizationOnOff.value="res://wmploc.dll/RT_STRING/#1911";
  80.     }
  81.  
  82.     var status = "";
  83.  
  84.     if (osMediaOpen == player.openState)
  85.     {
  86.         if ((0.0 == eq.normalizationPeak) && (0.0 == eq.normalizationAverage))
  87.         {
  88.             status = theme.loadString("res://wmploc/RT_STRING/#1913");
  89.         }
  90.         else
  91.         {
  92.             status = theme.loadString("res://wmploc/RT_STRING/#1914");
  93.         }
  94.     }
  95.  
  96.     if ((normalizationOnOff.enabled) && (eq.normalization)) 
  97.     {
  98.         normalizationStatus.value = status;
  99.     }
  100.     else
  101.     {
  102.         normalizationStatus.value = "";
  103.     }
  104. }
  105.  
  106. function ToggleNormalization()
  107. {
  108.     eq.normalization=!eq.normalization;
  109. }
  110.  
  111. function ToggleCrossfade()
  112. {
  113.     eq.crossFade=!eq.crossFade;
  114. }