home *** CD-ROM | disk | FTP | other *** search
/ Minami 48 / MINAMI48.ISO / Extra / MPSetup.exe / 1033 / RCDATA / CABINET / wmploc.DLL / 256 / 169 < prev    next >
Text File  |  2002-12-14  |  1KB  |  55 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.     if (ps=="") return "";
  30.     
  31.     var ds = "";
  32.     
  33.     if (player.openState==osMediaOpen)
  34.     {
  35.         if (player.currentMedia.duration>0)
  36.         {
  37.            ds = player.currentMedia.durationString; 
  38.         }
  39.     }
  40.  
  41.     var newvalue;
  42.     if (ds != "")
  43.     {
  44.         var args = new Array(ps,ds);
  45.         newvalue = g_kPositionFormatString.sprintf(g_kPositionFormatString,args);
  46.     }
  47.     else
  48.     {
  49.         newvalue = ps;
  50.     }
  51.     return newvalue;
  52. }
  53.  
  54. var g_kPositionFormatString = theme.loadString("res://wmploc/RT_STRING/#2091");
  55.