NewLark.mesa
L. Stewart December 27, 1983 4:56 pm
Last Edited by: Pier, April 19, 1984 4:05:27 pm PST
DIRECTORY
Containers USING [Container],
IO USING [STREAM],
Lark USING [CommandEvent, ConnectionSpec, disabled, Hertz, LarkModel, Machine, Milliseconds, SHHH, VoiceBuffer],
LarkRpcControl USING [InterfaceRecord],
LarkSmarts USING [NetAddress, SmartsHandle],
PupDefs USING [PupSocket],
PupTypes USING [PupAddress],
Rope USING [ROPE],
RPC USING [ShortROPE],
TypeScript USING [TS],
ViewerClasses USING [Viewer],
ViewRec USING [RecordViewer],
VoiceStream USING [Handle],
VTables USING [VTable];
NewLark: DEFINITIONS =
BEGIN
BDat: TYPE = RECORD [ h: LarkHandle, on, off: Lark.CommandEvent ← [device: nothing, event: Lark.disabled], value: BOOL ← FALSE, other: REF ANY ← NIL ];
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: BOOLEAN←TRUE,
notify: BOOLEAN ← TRUE
];
DialProc:
TYPE =
PROC [
self: LarkHandle,
number: Rope.ROPE,
on: Lark.Milliseconds ← 60,
off: Lark.Milliseconds ← 60,
waveTable: WaveTable ← dB9,
queueIt: BOOLEAN ← TRUE,
notify: BOOLEAN ← TRUE
];
TuneProc: TYPE = PROC [self: LarkHandle, music: Rope.ROPE, file: BOOLEAN];
PlayFileProc: TYPE = PROC [self: LarkHandle, fileName: Rope.ROPE];
VFS stuff
PlaybackProc: TYPE = PROC [self: LarkHandle, message: INT, queue: BOOL ← TRUE];
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: Lark.Machine];
SocketProc: TYPE = PROC [self: LarkHandle, buffer: Lark.VoiceBuffer ← out1, socket: PupTypes.PupAddress];
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,
SetSocket: SocketProc
];
LarkDataObject:
TYPE =
RECORD [
in: IO.STREAM ← NIL,
out: IO.STREAM ← NIL,
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.STREAM ← NIL,
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: BOOL ← FALSE,
pleaseStop: BOOL ← FALSE,
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
];
LarkHandle: TYPE = REF LarkDataObject;
actual procedures, because it is not all in one module
PlayFile: PROC [fileName: Rope.ROPE, him: PupTypes.PupAddress];
OpenVFS: BProc;
CloseVFS: BProc;
Playback: PlaybackProc;
Record: RecordProc;
END.
Stewart, July 18, 1983 1:00 pm, added SetHost
Stewart, December 27, 1983 4:56 pm, Cedar 5