DOpus (59/96)

From:Javier de las Rivas
Date:12 May 2001 at 18:58:48
Subject:[D5] CDDAdopus.script

This is what i've until now, have 2 problems:

- How to wait until i double click on an entry to launch CDDA executable

- How to know when the track is finished to remove the progress indicator

Yes it's in spanish, but when i finish it i'll translate it to english
(catalog support->too much for my first DO-ARexx script)

/*
$VER: CDDAdopus.script 0.7 (12.05.01) Javier de las Rivas
SetEnv cdda_device blizzppc.device
SetEnv cdda_unit 2
*/

options results

CDDAcmd="DH2:MUSICA/cdda PLAN=a" /* Ver cdda.readme */
TOCcmd ="DH2:MUSICA/ShowTOC D=blizzppc.device U=2" /* Ver ShowTOC.readme*/
lf='0a'x

ADDRESS "DOPUS.1"

/* Miramos si ya est� escuchando una canci�n y avisamos */
IF OPEN('procfile', 'T:CDDAproc', 'R') THEN DO
DOPUS REQUEST '"Ya est� reproduciendo una pista." Aceptar'
CLOSE('procfile')
END
ELSE DO
LISTER NEW
handle=RESULT
LISTER SET handle TITLE "CDDA.dopus"
LISTER SET handle HEADER "Pistas en el CD"
LISTER SET handle FIELD off
LISTER SET handle FIELD 0 "Pista" 4 "Duraci�n"
LISTER SET handle FIELD on
LISTER SET handle DISPLAY name' 'comment
ADDRESS COMMAND TOCcmd' FMT=%n%d NOHEADER NOTAIL >T:CDDAlista'
OPEN('listfile', 'T:CDDAlista', 'R')
CANCION=READLN('listfile')
DO UNTIL EOF('listfile')
PARSE VAR CANCION numero' 'tiempo
entrada.name = numero
entrada.comment = tiempo
LISTER ADDSTEM handle entrada
CANCION=READLN('listfile')
END
CLOSE('listfile')
LISTER REFRESH handle FULL
LISTER QUERY handle SELENTRIES VAR pista

IF pista~='' THEN DO

/* Reproducimos la pista elegida */
LISTER SET handle BUSY ON
LISTER SET handle NEWPROGRESS INFO ABORT
LISTER SET handle NEWPROGRESS TITLE 'CDDA'
LISTER SET handle NEWPROGRESS INFO "Reproduciendo pista "pista'...'
ADDRESS COMMAND 'Run >T:CDDAproc <NIL: 'CDDAcmd' TRACK='pista

/* Para saber a que proceso mandar el Ctrl+C */
OPEN('procfile', 'T:CDDAproc', 'R')
PROCESS=READLN('procfile')
PARSE VAR PROCESS '[CLI 'proceso']'
CLOSE('procfile')

/* Esperamos a que el usuario aborte */
DO FOREVER
LISTER QUERY handle ABORT
IF RESULT=1 THEN DO
ADDRESS COMMAND 'Break '||proceso
DELETE('T:CDDAproc')
LISTER SET handle BUSY OFF
EXIT
END
END
END
END
DELETE('T:CDDAlista')
EXIT 0

suggestions, bugs, enhancements are welcome :-)



http://personal.redestb.es/javierdlr
A1200T/WB3.9/KS3.1/040-PPC200/BVision/66Mb/HD2Gb/CDR/CD/ZIP/ScanJet5p :-P



Email majordomo@lss.com.au with 'help' in the body for help.
Members posting binaries to the mailing list will be removed!