LarkTest.mesa
Copyright © 1984 by Xerox Corporation. All rights reserved.
L. Stewart December 27, 1983 4:56 pm
Last Edited by: Pier, April 19, 1984 4:05:27 pm PST
Last Edited by: Swinehart, November 21, 1985 2:23:21 pm PST
Last Edited by: PolleZ, May 7, 1985 2:22:36 pm PDT
DIRECTORY
Containers USING [Container],
IO USING [STREAM],
Lark USING [CommandEvent, ConnectionSpec, disabled, Event, Hertz, LarkModel, Machine, Milliseconds, SHHH, VoiceBuffer],
LarkRpcControl USING [InterfaceRecord],
LarkSmarts USING [NetAddress, SmartsHandle],
PupDefs USING [PupSocket],
PupTypes USING [PupAddress, PupHostID],
Rope USING [ROPE],
RPC USING [ShortROPE],
TypeScript USING [TS],
ViewerClasses USING [Viewer],
ViewRec USING [RecordViewer],
VoiceStream USING [Handle],
VTables USING [VTable];
LarkTest: CEDAR DEFINITIONS =
BEGIN
ROPE: TYPE = Rope.ROPE;
BDat: TYPE = RECORD [ h: LarkHandle, on, off: Lark.CommandEvent ← [device: nothing, event: Lark.disabled], value: BOOLFALSE, other: REF ANYNIL ];
InputGain: TYPE = {dB0, dB5, dB10, dB15, dB20} ← dB0;
OutputGain: TYPE = {dB0, dB3, dB6} ← dB0;
WaveTable: TYPE = {dB0, dB3, dB6, dB9, dB12} ← dB9;
ToneProc: TYPE = PROC [
self: LarkHandle,
f1: Lark.Hertz ← 440,
f2: Lark.Hertz ← 480,
modulation: Lark.Hertz ← 0,
on: Lark.Milliseconds ← 500,
off: Lark.Milliseconds ← 500,
repetitions: CARDINAL ← 1,
waveTable: WaveTable ← dB9,
queueIt: BOOLEANTRUE,
notify: BOOLEANTRUE
];
DialProc: TYPE = PROC [
self: LarkHandle,
number: ROPE,
on: Lark.Milliseconds ← 60,
off: Lark.Milliseconds ← 60,
waveTable: WaveTable ← dB9,
queueIt: BOOLEANTRUE,
notify: BOOLEANTRUE
];
TuneProc: TYPE = PROC [self: LarkHandle, music1: ROPE, music2: ROPE, tune2Delay: NAT𡤀, tune2Divisor: NAT𡤁, volumeIncrement: NAT𡤀, file: BOOLEANFALSE] RETURNS [ok: BOOLEAN];
PlayFileProc: TYPE = PROC [self: LarkHandle, fileName: ROPE];
PlayStringProc: TYPE = PROC [self: LarkHandle, string: ROPE];
SpeechProc: TYPE = PROC [self: LarkHandle, text: ROPE, queueIt: BOOLTRUE];
MulticastOnProc: TYPE = PROC [self: LarkHandle, listeningTo: PupTypes.PupHostID];
MulticastOffProc: TYPE = PROC [self: LarkHandle];
VFS stuff
PlaybackProc: TYPE = PROC [self: LarkHandle, message: INT, queue: BOOLTRUE];
RecordProc: TYPE = PROC [self: LarkHandle, seconds: INT] RETURNS [message: INT];
EchoProc: TYPE = PROC [self: LarkHandle, buffer: Lark.VoiceBuffer, controlIn1: BOOL, controlIn2: BOOL, decayTime: CARDINAL, g0: CARDINAL, g1: CARDINAL, g2: CARDINAL, g3: CARDINAL, g4: CARDINAL];
SetHostProc: TYPE = PROC [self: LarkHandle, host: PupTypes.PupHostID];
SocketProcIn1: TYPE = PROC [
self: LarkHandle, buffer: Lark.VoiceBuffer ← in1,
socket: PupTypes.PupAddress←[[173B],[0],[0,0]]
];
SocketProcIn2: TYPE = PROC [
self: LarkHandle, buffer: Lark.VoiceBuffer ← in2,
socket: PupTypes.PupAddress←[[173B],[0],[0,0]]
];
SocketProcOut1: TYPE = PROC [
self: LarkHandle, buffer: Lark.VoiceBuffer ← out1,
socket: PupTypes.PupAddress←[[173B],[0],[0,0]]
];
SocketProcOut2: TYPE = PROC [
self: LarkHandle, buffer: Lark.VoiceBuffer ← out2,
socket: PupTypes.PupAddress←[[173B],[0],[0,0]]
];
SocketProcOut3: TYPE = PROC [
self: LarkHandle, buffer: Lark.VoiceBuffer ← out3,
socket: PupTypes.PupAddress←[[173B],[0],[0,0]]
];
BProc: TYPE = PROC [self: LarkHandle];
ControlRecord: TYPE = RECORD [
InGain1: InputGain,
InGain2: InputGain,
OutGain: OutputGain,
PlayFile: PlayFileProc,
Dial: DialProc,
Tones: ToneProc,
Tunes: TuneProc,
Reset: BProc,
Status: BProc,
ConnStatus: BProc,
Register: BProc,
ToneStatus: BProc,
Quit: BProc,
SendAllXBar: BProc,
OpenVFS: BProc,
CloseVFS: BProc,
Playback: PlaybackProc,
Record: RecordProc,
Echo: EchoProc,
SetHost: SetHostProc,
SetSocketIn1: SocketProcIn1,
SetSocketIn2: SocketProcIn2,
SetSocketOut1: SocketProcOut1,
SetSocketOut2: SocketProcOut2,
SetSocketOut3: SocketProcOut3,
PlayString: PlayStringProc,
Speech: SpeechProc,
MulticastOn: MulticastOnProc,
MulticastOff: MulticastOffProc
];
LarkDataObject: TYPE = RECORD [
in: IO.STREAMNIL,
out: IO.STREAMNIL,
container: Containers.Container,
ts: TypeScript.TS,
recordViewer: ViewerClasses.Viewer,
vr: ViewRec.RecordViewer ← NIL,
xbv: VTables.VTable ← NIL,
cr: REF ControlRecord ← NIL,
tsA, tsB: TypeScript.TS,
procA, procB: PROCESS,
inA, outA, inB, outB: IO.STREAM,
msg: IO.STREAMNIL,
shhh: Lark.SHHH,
rName: RPC.ShortROPE ← NIL,
instance: RPC.ShortROPE ← NIL,
address: LarkSmarts.NetAddress,
serverRname: RPC.ShortROPE ← NIL,
clientRname: RPC.ShortROPE ← NIL,
clientInstance: RPC.ShortROPE ← NIL,
handle: LarkSmarts.SmartsHandle ← 0,
model: Lark.LarkModel,
registered: BOOLFALSE,
pleaseStop: BOOLFALSE,
process: PROCESS,
tx1, tx2, tx3, rx1, rx2, rx3: Lark.ConnectionSpec,
lark: LarkRpcControl.InterfaceRecord,
VFS info
socket: PupDefs.PupSocket ← NIL,
stream: VoiceStream.Handle ← NIL,
housekeeping
buttons: LIST OF REF BDat,
cmds: LIST OF REF ANY,
multicastState: MulticastState ← $off
];
LarkHandle: TYPE = REF LarkDataObject;
MulticastState: TYPE = { on, off};
actual procedures, because it is not all in one module
PlayFile: PROC [fileName: ROPE, him: PupTypes.PupAddress];
OpenVFS: BProc;
CloseVFS: BProc;
Playback: PlaybackProc;
Record: RecordProc;
MyToneProc: ToneProc;
MyTuneProc: TuneProc;
MySpeechProc: SpeechProc;
MyPlayStringProc: PlayStringProc;
HandleProseOutput: PROC [c: CHAR];
Ping: PROC [e: Lark.Event];
CleanupForNewRegistration: BProc;
CleanupProc: BProc;
END.
Stewart, July 18, 1983 1:00 pm, added SetHost
Stewart, April 24, 1985 6:10:27 pm PST, Cedar 5, Stewart
Edited on April 24, 1985 6:08:49 pm PST, by PolleZ
Adding Prose definitions
added: SpeechSpec, ProseControlChar, reset, resetLen, commenceSpeech, commandLeader, indexMarkerEnd, speechDone, speechDoneLen, maxTextPktLen, maxPkts