home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / oct93 / misc / dasmodplay.lha / DASModPlay / Goodies / playsingle.drx < prev    next >
Text File  |  1993-08-19  |  2KB  |  75 lines

  1. /*
  2.     Arexx demoscript for DasModplayer by Erno Tuomainen
  3.  
  4.     Play Single module from CLI. This Script will HIDE DASModPlayer!
  5.  
  6.     Call with following parameters:
  7.  
  8.     RX PlaySingle.DRX ModulePathName
  9.  
  10.     example:    RX PlaySingle.DRX DH0:Data/Modules/Mystery.LHA
  11.          or:    RX PlaySingle.DRX DH0:Data/Modules/Mystery.MOD
  12.          or:    RX PlaySingle.DRX DH0:Data/Modules/MOD.Mystery
  13.          or:    PlaySingle.DRX mod.funkyduck
  14.  
  15.     If path for the module is not specified then DAS will check
  16.     out the CURRENT dir.
  17.  
  18.     If ONLY PATH is specified as modulename then das will ADD ALL
  19.     MODULES in this directory and start playing them.
  20.     
  21. */
  22. PlayerPath = 'Work:miscutils/DASModPlayer'    /* Defined by you!             */
  23.                         /* Where is the player located */
  24.  
  25. OPTIONS Results
  26.  
  27. PARSE arg modname
  28.  
  29. if modname = '' then DO
  30.     say 'This might take a long time!'
  31.     say ''
  32.     call writech(stdout, 'Are you sure you want to add all modules (y/N)?')
  33.     answer = readln(stdin)
  34.     answer = upper(answer)
  35.     if answer='Y' then signal yepp 
  36.     say ''
  37.     say 'Okay'
  38.     EXIT
  39. END
  40. yepp:
  41.  
  42. /* I need the following 4 lines if we are going to play something from CURRENT DIR */
  43.  
  44. ADDRESS COMMAND 'c:cd >T:lockfile'
  45. call open(file1,'t:lockfile','r')
  46. currpath=readln(file1)
  47. call close(file1)
  48.  
  49. /* Check if DASModPlayer is already loaded. If it isn't then LOAD IT */
  50.  
  51. result = SHOW('Ports','DASMP_Rexx')
  52. if result=0 then DO
  53.     say 'DasModPlayer AREXX-port not found! Loading DasModplayer'
  54.     ADDRESS COMMAND(Playerpath)
  55.     END
  56.  
  57. /* we need the following 3 lines to test when AREXX-script has loaded   */
  58. /* DASModPlayer into the backround.                                     */
  59. Checkloop1:
  60.     result = SHOW('Ports','DASMP_Rexx')
  61.     if result=0 then signal Checkloop1
  62.  
  63. ADDRESS 'DASMP_Rexx'
  64. SETMODULEDIR currpath
  65.  
  66. HIDE
  67. say ''
  68. CLEAR            /* If there's mods in the list -> IS NO MORE */
  69. call writech(stdout, 'Loading module 'modname'....')
  70. ADDMODULE modname
  71. PLAY
  72. say 'and Playing It'
  73. say ''
  74. EXIT
  75.