/* Rev 7.26.90 */ /* RECORD */ x = RemLib("rexxarplib.library") x = RemLib("rexxsupport.library") If addlib("rexxsupport.library",0,-30,0) then Do Say "" Say "Enter name of file to record to:" Pull FileName ARG PicEnv If PicEnv = '' then do Say "Enter directory and name of enviroment to use:" PULL PicEnv end if exists(PicEnv) then do address command "run /Performer2.0" Say "" Say "Loading Elan Performer 2.0 ..." do for 60 while ~show('Ports','PERFORMER') call delay 25 /* 0.5 sec */ end if show('Ports','PERFORMER') then do address PERFORMER LOAD PicEnv call openport "KEYPORT" if show('Ports','KEYPORT') then do PICRELAY KEYPORT Say "" Say 'Exit Recorder by double-clicking the Stop icon.' rec = 0 KeyNum = 0 OldTime = 0 Written = 0 Closed = 1 packet = '0000 0000'x Call Time('R') do while KeyNum ~= 55 do while packet = '0000 0000'x call waitpkt('KEYPORT') KeyTime = time('E')+OldTime packet = getpkt('KEYPORT') end pktstring = getarg(packet) KeyNum = SUBWORD(pktstring,2,1) x = index(KeyNum, "00"x) If x>0 then KeyNum = DELSTR(KeyNum, x) /* Removes Trailing 0's form String 2.0 Only */ if KeyNum = 51 then do /* Record */ CALL TIME('R') If Closed then do x = Open( 'RecFile',FileName,'W') x = Writeln('RecFile','Rx' PRAGMA('Directory')|| '/Play' FileName) x = Writeln('RecFile','QUIT') x = Writeln('RecFile',PicEnv) end Rec=1 Closed = 0 end else if KeyNum = 53 then Do /* Pause */ Rec = 0 OldTime = Time('E')+OldTime end else if KeyNum = 54 | KeyNum = 55 then do /* Stop */ x = Close('RecFile') OldTime =0 Address Command if Written then 'Copy Record.icon' FileName || '.info' else if Exists(FileName) then 'Delete' FileName Closed = 1 Rec = 0 end else if KeyNum = 52 then do /* PlayBack */ if Written & ~ Closed then do x = Close('RecFile') OldTime =0 Address Command 'Copy Record.icon' FileName || '.info' Closed = 1 Rec = 0 end if Written & Closed Then Do If Open('RecFile',FileName,'R') then Do x = Readln('RecFile') x = Readln('RecFile') x = Readln('RecFile') Call Time('R') Address PERFORMER KN = 0 Do While ~ (EOF('RecFile') | KN = 55 | KN = 54) FileRec = Readln('RecFile') KeyNum = SUBWORD(FileRec,1,1) KeyTime = SUBWORD(FileRec,2,1) DO WHILE (TIME('E') < KeyTime) x = (KeyTime-Time('E'))*50-2 If x > 1 & 0 ~= (x // 10) then Call DELAY(x) END If KeyNum ~= "" then KEY KeyNum KN = 0 p=1 do while ~( p = '0000 0000'x | KN = 55 | KN = 54) p = getpkt('KEYPORT') If p ~= '0000 0000'x then KN = SUBWORD(getarg(p),2,1) end end x = Close('RecFile') OldTime =0 end else say "Can't open file:" FileName end end else if rec = 1 & (KeyNum < 51 | KeyNum > 55) then DO /* Record Key */ x = Writeln('RecFile',KeyNum KeyTime) Written = 1 end call reply(packet,0) packet = '0000 0000'x end Call CLOSEPORT("KEYPORT") end else say "Can't open KEYPORT." address Performer Call delay(25) QUIT end else Say "Can't Find Elan Performer 2.0" end else say 'Can''t find Enviroment:' PicEnv end else Say "The ARexx RexxSupport.Library must be installed in Libs directory." x = RemLib("rexxsupport.library") exit(0)