home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / software / temacd / winamp / winamp508e_full.exe / $0 / scripts / pltime.m < prev    next >
Text File  |  2004-12-20  |  1KB  |  58 lines

  1. #include <lib/std.mi>
  2. #include "attribs.m"
  3.  
  4. Global Layer TimeBG,TimeDisplay;
  5. Global Text PLTime;
  6. Global Group frameGroup;
  7. Global Text SongTicker;
  8. Global Timer callback;
  9.  
  10. function setSongtickerScrolling();
  11.  
  12. System.onScriptLoaded() {
  13.     initAttribs();
  14.     frameGroup = getScriptGroup();
  15.     TimeBG = frameGroup.findobject("player.pl.time.left");
  16.     TimeDisplay = frameGroup.findobject("player.pl.time.display.left");
  17.     PLTime = frameGroup.findobject("PLTime");
  18.     callback = new Timer; callback.setDelay(1); callback.start();
  19. }
  20.  
  21. callback.onTimer() {
  22.     Container c = getContainer("pledit");
  23.     if (c) {
  24.         Layout l = c.getLayout("shade");
  25.         if (l) {
  26.             SongTicker = l.findObject("PESongticker");
  27.         }
  28.     }
  29.     setSongtickerScrolling();
  30. }
  31.  
  32. frameGroup.onResize(int x, int y, int w, int h) {
  33.     if (w>394) {
  34.         TimeBG.show();
  35.         TimeDisplay.show();
  36.         PLTime.setXMLParam("x","-215");
  37.         PLTime.setXMLParam("w","90");
  38.     } else {
  39.         TimeBG.hide();
  40.         TimeDisplay.hide();
  41.         PLTime.setXMLParam("x","-180");
  42.         PLTime.setXMLParam("w","55");
  43.     }
  44. }
  45.  
  46. songticker_scrolling_enabled_attrib.onDataChanged() {
  47.     setSongtickerScrolling();
  48. }
  49.  
  50. setSongtickerScrolling() {
  51.     if (!SongTicker) return;
  52.     if (songticker_scrolling_enabled_attrib.getData()=="1") {
  53.         SongTicker.setXMLParam("ticker","1");
  54.     } else {
  55.         SongTicker.setXMLParam("ticker","0");
  56.     }
  57. }
  58.