home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser 2002 January / STC_CD_01_2002.iso / APP / ANIPL218 / SCRIPTS / CONVERT.SIC < prev    next >
Encoding:
Text File  |  2001-05-30  |  1.2 KB  |  55 lines

  1. if(address("aniplay"))
  2. {
  3.     choice=dialog.note("File conversion",
  4.                        "[1] MPG in MOV",
  5.                        "[2] MPG in AVI",
  6.                        "[3] MP3 in WAV or WAV in MP3",
  7.                        "-b3","-b2","-b1");
  8.     if(choice != "3")
  9.         {
  10.         title="MPG source file";
  11.         select="*.MPG";
  12.         if(choice == "1")
  13.             target="mov";
  14.         else
  15.             target="avi";
  16.     }
  17.     else
  18.     {
  19.         choice=dialog.note("Sound conversion",
  20.                            "[1] MP3 in WAV",
  21.                            "[2] WAV in MP3",
  22.                            "-b2","-b1");
  23.         if(choice == "1")
  24.             {                           
  25.             title="MP3 source file";
  26.             select="*.MP3";
  27.             target="wav";
  28.         }
  29.         else
  30.             {                           
  31.             title="WAV source file";
  32.             select="*.WAV";
  33.             target="mp3";
  34.         }        
  35.     }
  36.     if(fsel(file, title, select))
  37.     {
  38.         if(!stricmp(suffix(file),suffix(select)))
  39.         {
  40.             space=0;
  41.             for(i=0;i<strlen(file);i++)
  42.             {
  43.                  if(file[i] == ' ')
  44.                      space=1;
  45.             }
  46.             if(space)
  47.                 quote="\047";
  48.             else
  49.                 quote="";
  50.             target = substr(file,0,strlen(file)-3) + target;
  51.             cmdline = "+o " + quote + target + quote + " " + quote + file + quote;
  52.             Open(cmdline);
  53.         }
  54.     }
  55. }