home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Amiga / Workbench / DOpus / MPEGA-GUIplay.lha / MPEGA-Play.dopus5 < prev   
Text File  |  1998-05-06  |  4KB  |  184 lines

  1. /* $VER: MPEGA-Play.dopus5 1.8 (06 May 1998)
  2.    ⌐1998 by mike@kily.ruhr.de (http://kily.home.pages.de)
  3.  
  4.  DOPUS5.5+ AREXX Script for MPEGA-Soundplaying
  5.  with ProgressBar-GUI with timecounter.
  6.  
  7.  needs:
  8.   DOPUS 5.5+
  9.   MPEGA 3.3
  10.  
  11.   RexxMaster (ARexx) running
  12.   mounted PIPE: device > SYS:DEVS/DOSDRIVERS/PIPE
  13.   kill > Task breaker tool by Magnus Holmgren (included)
  14.  
  15.  description:
  16.   A DOPUS GUI for the Great MPEGA player by Stephane TAVENARD.
  17.   displays Name/MPEG-Quality/Time in a DOPUS PROGRESS Window.
  18.   it shows the runtime on a proggressbar and a timecounter.
  19.  
  20.  installation:
  21.   as Button,Menu,...
  22.   NO Parameters, only select: <AREXX> Dopus5:ARexx/MPEGA-Play.dopus5
  23.  
  24.   If you want to use this script from multiply OPUS add the DOPUS Port:
  25.   <AREXX> Dopus5:ARexx/MPEGA-Play.dopus5 {Qp}
  26.  
  27.   For Filetype-startup (dobbleclick start) install it as:
  28.   <AREXX> Dopus5:ARexx/MPEGA-Play.dopus5 {Qp} {Ql} {o}
  29.  
  30.  usage:
  31.   select all .mp files and start MPEG-play.
  32.   if you want to skip a soundfile press the abort button.
  33.   to abort the complete script abort two times in the first 5 secs.
  34.  
  35.  configuration:
  36.   check/change the mpega startup parameters in this script.
  37.   to change the abort time change "stop<5 & secs<5" in this script.
  38.  
  39.  bugs:
  40.   if MPEGA needs too much CPU-Power then the time display is too slow/wrong.
  41.   solution: get a faster CPU.
  42.  
  43.  info:
  44.   if you want the same script/GUI for normal soundfiles
  45.   use my PLAY16-GUIplay.lha  (Aminet or Supportpage)
  46.   This is the same GUI for play16 by Thomas Wenzel.
  47.  
  48.  EmailWare:
  49.   this script ist Email-ware,
  50.   please mail me your favourit Internet-Site !
  51.  
  52. */
  53. OPTIONS RESULTS
  54.  
  55. playmode="-d2 -m -q2 -v120"
  56.  
  57.  
  58.  
  59. PARSE ARG portname' 'handle' 'file
  60.  
  61. IF portname='' THEN portname='DOPUS.1'
  62. ADDRESS VALUE portname
  63.  
  64. IF handle="" THEN DO
  65.  
  66.  LISTER QUERY SOURCE
  67.  handle=result
  68.  IF RC~=0 THEN DO
  69.   DOPUS REQUEST '"no Source-directory selected !?!" OOPS!'
  70.   EXIT
  71.  END
  72.  
  73.  LISTER QUERY Handle selfiles stem files.
  74.  IF files.count=0 THEN DO
  75.   DOPUS REQUEST '"no MPEG sound-files selected !?!" OOPS!'
  76.   EXIT
  77.  END
  78.  
  79. END
  80.  
  81. IF file~="" then DO
  82.  files.0=compress(file,'"')
  83.  files.count=1
  84. END
  85.  
  86. LISTER QUERY Handle path
  87. pfad=result
  88.  
  89. LISTER SET Handle BUSY ON
  90. LISTER SET Handle newprogress name info bar abort
  91.  
  92. DO j = 0 TO files.count-1
  93. IF index(upper(files.j),".MP") >1 then do
  94.  
  95.  LISTER SET Handle NEWPROGRESS NAME "Name: "files.j
  96.  LISTER SET Handle NEWPROGRESS INFO "00:00 / 00:00 / decoding MPEG sound..."
  97.  
  98.  file='"'pfad||files.j'"'
  99.  ADDRESS COMMAND 'RUN >NIL: <NIL: mpega 'playmode' -T 'file' >PIPE:mpegout'
  100.  
  101.  CALL Open('mpegout','PIPE:mpegout','r')
  102.  
  103.  string = ReadLn('mpegout')
  104.  string=Text( string )
  105.  
  106.  parse var string version "[680"CPU "(C)"dummy
  107.  version=version" "CPU
  108.  
  109.  LISTER SET Handle NEWPROGRESS title j+1' / 'files.count' - 'version
  110.  
  111.  DO until dummy=""
  112.   dummy = ReadLn('mpegout')
  113.  END
  114.  
  115.  string = ReadLn('mpegout')
  116.  string=Text( string )
  117.  
  118.  parse var string dummy"MPEG"MTYPE
  119.  MPGMODE="MPEG"MTYPE
  120.  
  121.  string = ReadLn('mpegout')
  122.  string=Text( string )
  123.  parse var string dummy": "pm":"ps
  124.  
  125.  ptotal=pm*60+ps
  126.  secs=0
  127.  LISTER SET Handle NEWPROGRESS bar ptotal 0
  128.  
  129.  DO UNTIL Eof('mpegout')
  130.  
  131.  time=ReadCh('mpegout',29)
  132.   secs=secs+1
  133.  
  134.   if index(time,"err")>0 then dopus request "error"'0a'x||time
  135.  
  136.   time=left(right(time,10),5)
  137.   if time="" then time=" End."
  138.  
  139.   LISTER QUERY Handle abort
  140.   skip=result
  141.  
  142.   IF skip=1 THEN DO
  143.    ADDRESS COMMAND 'kill MPEGA >nil:'
  144.    if stop<5 & secs<5 then do
  145.     LISTER REFRESH Handle
  146.     LISTER SET Handle BUSY OFF
  147.     CALL Close('mpegout')
  148.     EXIT
  149.    end
  150.    stop=secs
  151.    dummy=ReadCh('mpegout',256)
  152.   END
  153.   ELSE DO
  154.    LISTER SET Handle NEWPROGRESS INFO pm":"ps" / "time" / "MPGMODE
  155.    LISTER SET Handle NEWPROGRESS bar ptotal secs
  156.   END
  157.  
  158.  
  159.  END
  160.  LISTER CLEAR Handle abort
  161.  CALL Close('mpegout')
  162.  LISTER SELECT Handle '"'files.j'"' OFF
  163.  LISTER REFRESH Handle
  164. END
  165. END
  166.  
  167. LISTER SET Handle BUSY OFF
  168.  
  169. EXIT
  170.  
  171.  
  172. TEXT:
  173. PROCEDURE
  174.  TEXT=Arg( 1 )
  175.  esc2=1
  176.  do until esc1=0
  177.   esc1=Verify(text,'1b'x,'m')
  178.   if esc1~=0 then text=delstr(text,esc1,1)
  179.   parse var text d1'[1m'd2'[22m'd3
  180.   text=d1||d2||d3
  181.  end
  182.  
  183. RETURN TEXT
  184.