home *** CD-ROM | disk | FTP | other *** search
/ XMANGA 27 / XMANGA27.ISO / Extra / mp10setup.exe / wmploc.DLL / 256 / 169 < prev    next >
Encoding:
Text File  |  2004-08-11  |  2.3 KB  |  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. String.prototype.sprintf = sprintf;
  24. function WMPStringsFunction_GetPositionText()
  25. {
  26.     var ps = player.controls.currentPositionString;
  27.     if (ps=="") return "";
  28.     
  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.     var newvalue;
  39.     if (ds != "")
  40.     {
  41.         var args = new Array(ps,ds);
  42.         newvalue = g_kPositionFormatString.sprintf(g_kPositionFormatString,args);
  43.     }
  44.     else
  45.     {
  46.         newvalue = ps;
  47.     }
  48.     return newvalue;
  49. }
  50. var g_kPositionFormatString = theme.loadString("res://wmploc/RT_STRING/#2091");