home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
opus
/
v5
/
cdda_mpeg_op5
/
arexx
/
playhifi_dt.dopus5
< prev
next >
Wrap
Text File
|
1977-12-31
|
5KB
|
165 lines
/* Programm: PlayHifi_DT.dopus5
** $VER: PlayHifi_DT.dopus5 1.3 (27-Dec-95)
**
**
** Needed: Directory Opus V5.xx (© by Jonathan Potter & GPSoftware)
** mpega (© 1995 by Stephane Tavenard) or/and
** PeggyPlus MPEG-Card (© Ingenierbuero Helfrich)
** PeggyPlus:MPEGPlayer >= V4.7
** Play16 (© 1995 by Thomas Wenzel)
** PlayADPCM (Autor Christian Buchner)
**
** Copyright © 1995 Eckhard Ludwig (Eckhard@top.east.de)
** PlayHifi_DT.dopus5 is freeware. It may be distributed freely.
**
** Play compressed sound (MPEG Layer 1&2) from DOpus5. Only for DOpus5-filetypes,
** New: Play AIFF, WAVE, 8SVX, VOC, ADPCM3 (set filetypes doubleclick).
**
** Localecatalog for german & more: used catalog "PlayHifi.dopus5" !
**
**
** Call as:
** --------------------------------------------------------------------------
** (Doubleklick) ARexx DOpus5:ARexx/PlayHifi_DT.dopus5 {f} {Qp} {Ql}
** --------------------------------------------------------------------------
** Set Attribut: "Output to window" (Ausgabe in Fenster).
** Set Attribut: "Run asynchron" (Asynchroner Start)
**
*/
/*--------S E T T I N G S : -------------------------------------------*/
/* If the file ENV:PlayHifi.PREFS exists, that one will override the */
/* settings here ... */
/*- Path to Player command --------------------------------------------*/
Play16 = "C:Play16"
PL16_OPTIONS=" Paula14 FILTER=OFF"
PlayADPCM = "C:PlayADPCM"
/*- Path to MPEGPlayer command ----------------------------------------*/
PlayMPEG = "C:mpega" /* Softwareplayer */
MPEGA_OPTIONS=" -p -f0 -d2 -q2 "
parse arg '"' Titel '"' portname handle
if portname='' then
portname='DOPUS.1'
address value portname
options results
options failat 21
lf='0a'x
Index = 'T:PlayDOpus5Index.temp' /*Name entspricht PlayHifi.dopus5 !*/
if open(1,'env:PlayHifi.prefs','R') then do
do i=1 to 6
prefs.i = readln(1)
end
if prefs.2 ~="" then PLAY16=prefs.2
if prefs.3 ~="" then PlayADPCM=prefs.3
if prefs.4 ~="" then PlayMPEG=prefs.4
if prefs.5 ~="" then PL16_OPTIONS=prefs.5
if prefs.6 ~="" then MPEGA_OPTIONS=prefs.6
drop prefs.
call close(1)
end
if ~show('l','rexxsupport.library') then
call addlib('rexxsupport.library',0,-30,0)
/* init locale */
if ~show(l,'locale.library') then
call addlib('locale.library',0,-30)
if show(l,'locale.library') then
catalog=opencatalog('PlayHifi.catalog','english',0)
if exists(Index) then do
if ~delete(Index) then do
dopus front
dopus request '"'getcatstr(14,'Songs added to playlist ?')'"' 'OK|'getcatstr(1,'Abort')
if RC=0 then exit
Index=Index||'1'
if exists(Index) then call open('output',Index,'A')
else do
if open('output',Index,'w') ~=1 then do
dopus request '"'getcatstr(3,'Error:'lf'Load script in to editor and set path to Index !')'"' getcatstr(1,'Quit')
exit
end
end
APOS=lastpos("/",Titel)
if APOS=0 then APOS=lastpos(":",Titel)
songname=substr(Titel,APOS+1)
lister query handle entry '"'songname'"' stem fileinfo.
call writeln('output',Titel' @SIZE='fileinfo.size' @COMMENT='fileinfo.comment)
call close('output')
exit
end
end
dopus getfiletype '"'Titel'"' id
DT=result
if DT="MP2" then do
if showlist("A","PEGGYPLUS")=1 then do
if ~show('P','Peggy') then do
call pragma('STACK',8192)
address command
'run >NIL: <NIL: PEGGYPLUS:MPEGPlayer'
'waitforport Peggy'
address value portname
dopus front
end
end
if show('P','Peggy') then do
address 'Peggy'
open '"'Titel'"'
setwindow XOFF 0 YOFF 0 WIDTH 1 HEIGHT 1 XPIC 0 YPIC 0
Play async
end
else do
if ~exists(PlayMPEG) then do
dopus front
dopus request '"'getcatstr(9,'Error:'lf'MPEG-Player not found !'lf'path to command: '"'%s'"'',PlayMPEG)'"' getcatstr(1,'Quit')
exit
end
address command PlayMPEG" "MPEGA_OPTIONS" " '"'Titel'"'
end
exit
end
if DT="ADPCM3" then do
if ~exists(PlayADPCM) then do
dopus front
dopus request '"'getcatstr(10,'Error:'lf'ADPCM-Player not found !'lf'path to command: '"'%s'"'',PlayADPCM)'"' getcatstr(1,'Quit')
end
else address command PlayADPCM '"'Titel'"' " NOFILTER"
exit
end
if ~exists(Play16) then do
dopus front
dopus request '"'getcatstr(11,'Error:'lf'Play16 not found !'lf'path to command: '"'%s'"'',Play16)'"' getcatstr(1,'Quit')
exit
end
select
when DT="CDR" then address command Play16 '"'Titel'"' " RAW FREQ=44100 TRACKS=2 BITS=16 INTEL VERBOSITY=1 "PL16_OPTIONS
when DT="WAVE" then address command Play16 '"'Titel'"' " "PL16_OPTIONS" VERBOSITY=1"
when DT="AIFF" then address command Play16 '"'Titel'"' " "PL16_OPTIONS" VERBOSITY=1"
otherwise address command Play16 '"'Titel'"' " "PL16_OPTIONS" VERBOSITY=1"
end
exit
/*--------------------------------------------------------------------------------*/
getcatstr:
parse arg msgno,msgstring,insert.1,insert.2
if catalog~=0 then msgstring=getcatalogstr(catalog,msgno,msgstring)
j=0
do while pos('%s',msgstring)>0
parse var msgstring fore '%s' aft
j=j+1
msgstring=fore||insert.j||aft
end
return msgstring