home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga Shareware Floppies / ma16.dms / ma16.adf / DASModPlayer / Rexx / playsingle.drx < prev    next >
Text File  |  1993-12-08  |  2KB  |  85 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 = 'dh0:asm/test/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')
  52. if result=0 then DO
  53.     say 'DasModPlayer AREXX-port not found! Loading DasModplayer'
  54.     ADDRESS COMMAND(Playerpath)
  55.  
  56.     END
  57.  
  58. /* we need the following 3 lines to test when AREXX-script has loaded   */
  59. /* DASModPlayer into the backround.                                     */
  60.  
  61. Checkloop1:
  62.     result = SHOW('Ports','DASMP')
  63.     if result=0 then signal Checkloop1
  64.  
  65. ADDRESS 'DASMP'
  66. SETMODULEDIR currpath
  67.  
  68. say ''
  69. PLAYMODE ALLREPEAT
  70. call writech(stdout, 'Loading module 'modname'....')
  71. MOVELIST LAST
  72. ADDMODULE modname
  73. MODCOUNT
  74. if result>1 then do
  75.     NEXT
  76.     MOVELIST FIRST
  77.     DELETE
  78.     END
  79. else do
  80.     PLAY
  81.     END
  82. say 'and Playing It'
  83. say ''
  84. EXIT
  85.