home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 19
/
AACD19.BIN
/
AACD
/
Utilities
/
Compact
/
ARexx
/
Middle-Preview.compact
next >
Wrap
Text File
|
1999-11-14
|
3KB
|
87 lines
/* PREVIEW-Extension, which starts playing in the middle of a track,
and it plays as long as set in the PREVIEW-gadget. It starts playing
at the actual playing track (or at track 1, when the player is
currently stopped). When the user presses STOP while this script is
running, the script will stop too.
TO-DO: - When a program or a snap is active, the JUMP-command has
no function, because COMPACT only reacts on it, when no
program or snap is active.
- As soon as COMPACT knows a command to switch off PREVIEW in
ARexx, it should be executed by the script before the main
routine is handled. The settings of RANDOM and REPEAT (and
eventually PROGRAM and SNAP) should be noticed by the script.
Copyright 1998-1999 by Ralph Weisel, V1.1
------------------------------------------------------------------------*/
ADDRESS 'COMPACT'
OPTIONS RESULTS
OPTIONS FAILAT 11
GETPREVIEW 0 /* Prüfen, ob PREVIEW aktiviert ist */
prevon=result
IF prevon=1 THEN EXIT
GETPREVIEW 1 /* Anzahl der PREVIEW-Sekunden ermitteln */
prevtime=result
NUMTRACKS 0 /* Anzahl der Titel der CD ermitteln */
tracks=result
ACTTRACK 0 /* Aktuell spielenden Track ermitteln */
trnr=result
IF trnr=0 THEN trnr=1
DO track=trnr TO tracks
TRACKSTART track /* Startposition eines Titels ermitteln */
startmin=WORD(result,1)
startsek=WORD(result,2)
startseks=startmin*60+startsek
TRACKTIME 3 track /* Spielzeit eines Titels ermitteln */
min=WORD(result,1)
sek=WORD(result,2)
seks=min*60+sek
mitte=TRUNC(seks/2)
IF (mitte+prevtime)>seks THEN /* mitte und prevtime ggf. korr. */
DO
IF prevtime>seks THEN
DO
prevtime=seks
mitte=0
END
ELSE
mitte=seks-prevtime
END
beginnseks=startseks+mitte /* PLAY-Startpos. errechnen */
beginnmin=TRUNC(beginnseks/60)
beginnsek=beginnseks-(beginnmin*60)
endeseks=startseks+mitte+prevtime /* STOP-Startpos. errechnen */
endemin=TRUNC(endeseks/60)
endesek=endeseks-(endemin*60)
IF beginnmin<10 THEN /* ZU SPIELEN ANFANGEN */
JUMP '0'||beginnmin||':'||beginnsek
ELSE
JUMP beginnmin||':'||beginnsek
address command 'WAIT '||prevtime /* Benötigt Befehl WAIT in C: !! */
ACTTRACK 0
IF result=0 THEN LEAVE track /* Wenn STOP, dann Skript-Ende */
/*-------- First WAIT-version, which needs many CPU-time: ----------
DO zeit=time('R') WHILE zeit<prevtime /* Auf nächsten Titel warten */
zeit=time('E')
ACTTRACK 0
IF result=0 THEN LEAVE track /* Wenn STOP, dann Skript-Ende */
END
---------------------------------------------------------------------------*/
END
STOP /* CD-Player stoppen */
EXIT