home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 November / Chip_2002-11_cd1.bin / servis / wm9 / mpsetupXP.exe / RCDATA / CABINET / wmploc.DLL / 256 / 169 < prev    next >
Text File  |  2002-09-18  |  1KB  |  53 lines

  1. //<script language="jscript">
  2. function sprintf(str,s)
  3. {
  4.     if (typeof(s)=="string")
  5.     {
  6.         var re;
  7.         re = /%s/i;
  8.         str = str.replace(re, s);
  9.     }
  10.     else
  11.     {
  12.         var index =1;
  13.         for (var replaceStrings in s)
  14.         {
  15.             var re;
  16.             re = eval("/%" + index + "/i");
  17.             str = str.replace(re, s[replaceStrings]);
  18.             index++;            
  19.         }
  20.     }
  21.     return str;
  22. }
  23.  
  24. String.prototype.sprintf = sprintf;
  25.  
  26. function WMPStringsFunction_GetPositionText()
  27. {
  28.     var ps = player.controls.currentPositionString;
  29.     var ds = "";
  30.     
  31.     if (player.openState==osMediaOpen)
  32.     {
  33.         if (player.currentMedia.duration>0)
  34.         {
  35.            ds = player.currentMedia.durationString; 
  36.         }
  37.     }
  38.  
  39.     var newvalue;
  40.     if (ds != "")
  41.     {
  42.         var args = new Array(ps,ds);
  43.         newvalue = g_kPositionFormatString.sprintf(g_kPositionFormatString,args);
  44.     }
  45.     else
  46.     {
  47.         newvalue = ps;
  48.     }
  49.     return newvalue;
  50. }
  51.  
  52. var g_kPositionFormatString = theme.loadString("res://wmploc/RT_STRING/#2091");
  53.