home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Fax / AVMN199D.LHA / avminstall / rexx / playamiga.avm < prev    next >
Encoding:
Text File  |  1995-04-10  |  1.3 KB  |  50 lines

  1. /*
  2. BUGS:  If you try to play to the amiga from more than one Player, you
  3. will probably be in trouble since we use avmtemp:temp.iff
  4. */
  5.  
  6. parse upper arg fileName .
  7. address command
  8.  
  9. if exists(filename || 'i') then do
  10.    avmbusy = getclip('AVMBusy')
  11.         say 'avmbusy=' avmbusy
  12.    if avmbusy = "" then call setclip('AVMBusy', '1')
  13.    else call setclip('AVMBusy', avmbusy + 1)
  14.  
  15.    'avm:dsound/dsound -2' filename || 'i'
  16.         /*
  17.    'avm:agmsplaysound' filename || 'i'
  18.         */
  19.  
  20.    avmbusy = getclip('AVMBusy')
  21.    call setclip('AVMBusy', avmbusy - 1)
  22. end; else do
  23.    lastPlayed = upper(getclip('playAmigaFile'))
  24.    playWhileConverting = upper(getclip('AVMPlayWhileConverting'))
  25.  
  26.    if lastPlayed ~= fileName then do
  27.       say 'Converting'
  28.            if playWhileConverting = 'YES' then
  29.          'avm:voice2iff' fileName 'avmtemp:temp.iff' '-play'
  30.            else
  31.          'avm:voice2iff' fileName 'avmtemp:temp.iff'
  32.            if rc ~= 0 then exit
  33.       call setclip('playAmigaFile', fileName)
  34.    end
  35.  
  36.    avmbusy = getclip('AVMBusy')
  37.    if avmbusy = "" then call setclip('AVMBusy', '1')
  38.    else call setclip('AVMBusy', avmbusy + 1)
  39.  
  40.    'avm:dsound/dsound -2' 'avmtemp:temp.iff'
  41.         /*
  42.    'avm:agmsplaysound' 'avmtemp:temp.iff'
  43.         */
  44.  
  45.    avmbusy = getclip('AVMBusy')
  46.    call setclip('AVMBusy', avmbusy - 1)
  47.  
  48.    say 'Done'
  49. end
  50.