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

  1.  
  2. var settingsIsOpen = false;
  3. var playlistIsOpen = false;
  4. var giSettingsPos = 0;
  5. var gsSettingsNames = new Array("SRSSettings", "AudioSettings", "VideoSettings");
  6.  
  7. var openedWidth = 640;
  8. var closedWidth = 422;
  9. var openedHeight = 480;
  10. var closedHeight = 378;
  11.  
  12. function InitCompact()
  13. {
  14.     playlist.setColumnResizeMode( 0, "Stretches" );
  15.     playlist.setColumnResizeMode( 1, "AutoSizeData" );
  16.     InitVisualizations(); // Init the Video and Visualization windows
  17.     InitControls(); // Init mode transports
  18.     InitEQ();
  19.     InitSRS();
  20.     OnModeChange();
  21.  
  22.     // load saved settings
  23.     var s = "";    
  24.  
  25.     s = theme.loadPreference("SettingsTab");
  26.     for (var i = 0; i < gsSettingsNames.length; i++)
  27.     {
  28.         if (s == gsSettingsNames[i])
  29.         {
  30.             giSettingsPos = i;
  31.         }
  32.     }
  33.     ChangeSettingsTab(0); // Init settings tab
  34.     
  35.     s = theme.loadPreference("SettingsDrawer");
  36.     if (s == "True")
  37.         ToggleSettings();
  38.  
  39.     s = theme.loadPreference("PlaylistDrawer");
  40.     if (s == "True")
  41.         TogglePlaylist();
  42. }
  43.  
  44. function CloseCompact()
  45. {
  46.     theme.savePreference("SettingsTab", gsSettingsNames[giSettingsPos]);
  47.     theme.savePreference("SettingsDrawer", settingsIsOpen);
  48.     theme.savePreference("PlaylistDrawer", playlistIsOpen);
  49.     CloseVisualizations();
  50. }
  51.  
  52. function ToggleSettings()
  53. {
  54.     if(settingsIsOpen==true)
  55.     {
  56.         settingsDrawer.moveTo(settingsDrawer.left,236,1000);
  57.         settingsIsOpen=false;
  58.     }
  59.     else
  60.     {
  61.         view.height = openedHeight;
  62.         settingsTab.visible = true;
  63.         settingsDrawer.moveTo(settingsDrawer.left,338,1000);
  64.         settingsIsOpen=true;
  65.         ChangeSettingsTab(0);
  66.     }
  67.  }
  68.  
  69. function TogglePlaylist()
  70. {
  71.     if(playlistIsOpen==true)
  72.     {
  73.         playlist.visible=false;
  74.         playlistDrawer.moveTo(219, playlistDrawer.top,1000);
  75.         playlistIsOpen=false;
  76.     }
  77.     else
  78.     {
  79.         view.width = openedWidth;
  80.         playlistDrawer.moveTo(397, playlistDrawer.top,1000);
  81.         playlistIsOpen=true;
  82.     }
  83.  }
  84.  
  85. function OnModeChange()
  86. {
  87.     shuffle.down = player.settings.GetMode("shuffle");
  88. }
  89.  
  90. function Playlist_OnEndMove()
  91. {
  92.     if(playlistIsOpen==true)
  93.     {
  94.         playlist.visible=true;
  95.     }
  96.     else
  97.     {
  98.         playlist.visible=false;
  99.         view.width = closedWidth;
  100.     }
  101. }
  102.  
  103. function Settings_OnEndMove()
  104. {
  105.     if (!settingsIsOpen)
  106.     {
  107.         SRSSettings.visible = false;
  108.         AudioSettings.visible = false;
  109.         VideoSettings.visible = false;
  110.         settingsTab.visible   = false;
  111.         view.height = closedHeight;
  112.     }
  113. }
  114.  
  115. function ChangeSettingsTab(iWhichDir)
  116. {
  117.     var iPos = giSettingsPos;
  118.     iPos = iPos + iWhichDir;
  119.  
  120.     if (iPos < 0) 
  121.     {
  122.         iPos = gsSettingsNames.length -1;
  123.     } 
  124.     else if (iPos >= gsSettingsNames.length)
  125.     {
  126.         iPos = 0;
  127.     }
  128.     
  129.     if (settingsIsOpen)
  130.     {
  131.         switch (iPos)
  132.         {
  133.             case 0:
  134.                 AudioSettings.visible = false;
  135.                 VideoSettings.visible = false;
  136.                 SRSSettings.visible = true;
  137.                 tabTitle.value = "res://wmploc.dll/RT_STRING/#1827";
  138.                 break;
  139.  
  140.             case 1:
  141.                 SRSSettings.visible = false;
  142.                 VideoSettings.visible = false;
  143.                 AudioSettings.visible = true;
  144.                 tabTitle.value = "res://wmploc.dll/RT_STRING/#1848";
  145.                 break;
  146.  
  147.             case 2:
  148.                 SRSSettings.visible = false;
  149.                 AudioSettings.visible = false;
  150.                 VideoSettings.visible = true;
  151.                 tabTitle.value = "res://wmploc.dll/RT_STRING/#1849";
  152.                 break;
  153.         }
  154.     }
  155.  
  156.     giSettingsPos = iPos;    
  157. }