home *** CD-ROM | disk | FTP | other *** search
- /*
- Arexx demoscript for DasModplayer by Erno Tuomainen
-
- Play Single module from CLI. This Script will HIDE DASModPlayer!
-
- Call with following parameters:
-
- RX PlaySingle.DRX ModulePathName
-
- example: RX PlaySingle.DRX DH0:Data/Modules/Mystery.LHA
- or: RX PlaySingle.DRX DH0:Data/Modules/Mystery.MOD
- or: RX PlaySingle.DRX DH0:Data/Modules/MOD.Mystery
- or: PlaySingle.DRX mod.funkyduck
-
- If path for the module is not specified then DAS will check
- out the CURRENT dir.
-
- If ONLY PATH is specified as modulename then das will ADD ALL
- MODULES in this directory and start playing them.
-
- */
- PlayerPath = 'dh0:asm/test/DASModPlayer' /* Defined by you! */
- /* Where is the player located */
-
- OPTIONS Results
-
- PARSE arg modname
-
- if modname = '' then DO
- say 'This might take a long time!'
- say ''
- call writech(stdout, 'Are you sure you want to add all modules (y/N)?')
- answer = readln(stdin)
- answer = upper(answer)
- if answer='Y' then signal yepp
- say ''
- say 'Okay'
- EXIT
- END
- yepp:
-
- /* I need the following 4 lines if we are going to play something from CURRENT DIR */
-
- ADDRESS COMMAND 'c:cd >T:lockfile'
- call open(file1,'t:lockfile','r')
- currpath=readln(file1)
- call close(file1)
-
- /* Check if DASModPlayer is already loaded. If it isn't then LOAD IT */
-
- result = SHOW('Ports','DASMP')
- if result=0 then DO
- say 'DasModPlayer AREXX-port not found! Loading DasModplayer'
- ADDRESS COMMAND(Playerpath)
-
- END
-
- /* we need the following 3 lines to test when AREXX-script has loaded */
- /* DASModPlayer into the backround. */
-
- Checkloop1:
- result = SHOW('Ports','DASMP')
- if result=0 then signal Checkloop1
-
- ADDRESS 'DASMP'
- SETMODULEDIR currpath
-
- say ''
- PLAYMODE ALLREPEAT
- call writech(stdout, 'Loading module 'modname'....')
- MOVELIST LAST
- ADDMODULE modname
- MODCOUNT
- if result>1 then do
- NEXT
- MOVELIST FIRST
- DELETE
- END
- else do
- PLAY
- END
- say 'and Playing It'
- say ''
- EXIT
-