DIRECTORY Commander USING [ CommandProc, Register ], IO, LarkSynthesizer USING [ AddText, SynthFlush ], RefID USING [ ID, nullID ], LarkSmartsMonitorImpl, Rope USING [ ROPE ], RPC USING [ EncryptionKey, ExportFailed ], Synthesizer USING [ ActionID, SynthSpec, SynthSpecBody ], SynthesizerServer, SynthesizerServerRpcControl USING [ ExportInterface ], ThParty USING [ RegisterServiceInterface, ReportAction ], Thrush USING [ ActionType, Credentials, InterfaceSpec, NB, noAddress, SHHH, PartyID, SmartsID ], ThSmartsPrivate USING [ ConvDesc, GetConv, GetSmartsInfo, LarkInfo, RegisterServiceProvider, SmartsInfo ], VoiceUtils USING [ CmdOrToken, CurrentPasskey, MakeRName, Problem, ReportFR ] ; LarkSmartsSynthImpl: CEDAR MONITOR LOCKS root IMPORTS Commander, IO, LarkSynthesizer, root: LarkSmartsMonitorImpl, RPC, SynthesizerServerRpcControl, ThParty, ThSmartsPrivate, VoiceUtils EXPORTS LarkSynthesizer, SynthesizerServer SHARES LarkSmartsMonitorImpl= { OPEN IO; LarkInfo: TYPE = ThSmartsPrivate.LarkInfo; RequestClientData: TYPE = REF RequestClientDataBody; RequestClientDataBody: TYPE = RECORD [ cDesc: ThSmartsPrivate.ConvDesc, requestingParty: Thrush.PartyID ]; synthesizerServerSpec: Thrush.InterfaceSpec _ [interfaceName: [type: "SynthesizerServer"], serviceID: RefID.nullID]; synthesizerServerUser: Rope.ROPE; synthesizerServerPassword: RPC.EncryptionKey; TextToSpeech: PUBLIC ENTRY PROC -- TAKES -- [ shhh: Thrush.SHHH, credentials: Thrush.Credentials, -- authenticates caller serviceID: RefID.ID, -- identifies particular service textToSpeak: Rope.ROPE, actionID: Synthesizer.ActionID, filter: BOOL, queueIt: BOOL ] RETURNS [nb: Thrush.NB] = { ENABLE UNWIND => NULL; larkInfo: LarkInfo; cDesc: ThSmartsPrivate.ConvDesc; synthSpec: Synthesizer.SynthSpec; [nb, larkInfo, cDesc] _ SynthVerify[credentials, serviceID]; IF nb # $success THEN RETURN; synthSpec _ NEW[Synthesizer.SynthSpecBody _ [ textToSpeak: textToSpeak, actionID: actionID, clientData: NEW[RequestClientDataBody _ [cDesc, credentials.partyID]] ]]; LarkSynthesizer.AddText[ info: larkInfo, synthSpec: synthSpec, filter: filter, queueIt: queueIt ]; SynthReport[synthSpec, $scheduled]; }; StopSpeech: PUBLIC ENTRY PROC -- TAKES -- [ shhh: Thrush.SHHH, credentials: Thrush.Credentials, serviceID: RefID.ID, reset: BOOL ] RETURNS [nb: Thrush.NB] = { ENABLE UNWIND => NULL; larkInfo: LarkInfo; [nb, larkInfo] _ SynthVerify[credentials, serviceID]; IF nb=$success THEN LarkSynthesizer.SynthFlush[larkInfo]; }; GetSynthesizerSpecifications: PUBLIC PROC -- TAKES -- [ shhh: Thrush.SHHH, serviceID: RefID.ID ] RETURNS [ nb: Thrush.NB, synthesizerModel: ATOM, synthesizerVersion: ATOM ] = { RETURN[$success, $DecTalk, $unspecified] }; LarkSynthesizerInit: Commander.CommandProc = { synthesizerServerSpec.interfaceName.instance _ NIL; synthesizerServerSpec.hostHint _ Thrush.noAddress; synthesizerServerUser _ VoiceUtils.MakeRName[style: rName, name: VoiceUtils.CmdOrToken[cmd: cmd, key: "ThrushServerInstance", default: "Strowger.Lark"]]; synthesizerServerPassword _ VoiceUtils.CurrentPasskey[VoiceUtils.CmdOrToken[ cmd: cmd, key: "ThrushServerPassword", default: "MFLFLX"]]; ThSmartsPrivate.RegisterServiceProvider[LarkSynthesizerRegister]; VoiceUtils.ReportFR["Initialize[SynthesizerServer.Lark, %s]", $System, NIL, rope[synthesizerServerUser]]; }; LarkSynthesizerRegister: PROC[ credentials: Thrush.Credentials, smartsInfo: ThSmartsPrivate.SmartsInfo] = { ENABLE { RPC.ExportFailed => { VoiceUtils.Problem["LarkSynthesizer export failed", $System]; GOTO CantExportSynthesizerServer; }; }; exportRequired: BOOL _ synthesizerServerSpec.interfaceName.instance = NIL; nb: Thrush.NB; IF ~smartsInfo.larkInfo.textToSpeech THEN RETURN; synthesizerServerSpec.serviceID _ credentials.smartsID; -- identify self. [nb, synthesizerServerSpec] _ ThParty.RegisterServiceInterface[credentials: credentials, interfaceSpecPattern: synthesizerServerSpec]; SELECT nb FROM $success, $stateMismatch => NULL; ENDCASE => GOTO CantExportSynthesizerServer; IF exportRequired THEN SynthesizerServerRpcControl.ExportInterface[ synthesizerServerSpec.interfaceName, synthesizerServerUser, synthesizerServerPassword! RPC.ExportFailed => GOTO CantExportSynthesizerServer]; EXITS CantExportSynthesizerServer => { VoiceUtils.Problem["Couldn't export SynthesizerServer"]; RETURN; }; }; LarkSynthReport: PUBLIC ENTRY PROC [sS: Synthesizer.SynthSpec, actionType: Thrush.ActionType] = { ENABLE UNWIND => NULL; SynthReport[sS, actionType] }; SynthReport: INTERNAL PROC [sS: Synthesizer.SynthSpec, actionType: Thrush.ActionType] = { requestClientData: RequestClientData = NARROW[sS.clientData]; cDesc: ThSmartsPrivate.ConvDesc _ requestClientData.cDesc; nb: Thrush.NB _ ThParty.ReportAction[ report: [ self: cDesc.situation.self, -- placeholder other: cDesc.situation.self, requestingParty: requestClientData.requestingParty, actionID: sS.actionID, actionClass: $synthesizer, actionType: actionType ], reportToAll: FALSE ].nb; IF nb#$success THEN NULL; -- Complain? }; SynthVerify: INTERNAL PROC[credentials: Thrush.Credentials, serviceID: Thrush.SmartsID] RETURNS[ nb: Thrush.NB_$success, larkInfo: LarkInfo_NIL, cDesc: ThSmartsPrivate.ConvDesc_NIL ] = { smartsInfo: ThSmartsPrivate.SmartsInfo _ ThSmartsPrivate.GetSmartsInfo[serviceID]; IF smartsInfo=NIL THEN RETURN[nb: $noSuchSmarts]; larkInfo _ smartsInfo.larkInfo; cDesc _ ThSmartsPrivate.GetConv[smartsInfo, credentials.convID, FALSE]; IF cDesc=NIL THEN RETURN[nb: $noSuchConv]; }; Commander.Register["LarkSynthesizer", LarkSynthesizerInit, "LarkSynthesizer \nInitialize and Export Lark Synthesizer Implementation."]; }. ΚLarkSmartsSynthImpl.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Last modified by D. Swinehart, November 3, 1986 7:45:48 am PST Types and Values New request from service to Lark: The kinds of things one needs to get from the client-supplied values. Not much authentication is done here; that would require access to ThParty.Verify. Swinehart, October 23, 1986 6:50:48 am PDT Loosely derived from Thrush 6 Synthesizer code. Κ+˜šœ™Icodešœ Οmœ1™™>J˜—šΟk ˜ Jšœ žœ˜*Jšžœ˜Jšœžœ˜.Jšœžœžœ ˜J˜Jšœžœžœ˜Jšžœžœ!˜*Jšœ žœ(˜9J˜Jšœžœ˜6Jšœžœžœ˜9Jšœžœ+žœ žœ˜`JšœžœU˜jJšœ žœ=˜MJ˜J˜—šœž œžœ˜-Jšžœ žœ0žœD˜ŒJšžœ#˜*Jšžœ˜Jšžœžœ˜J˜—™J™Jšœ žœ˜*J˜Jšœžœžœ˜4šœžœžœ˜&J˜ J˜J˜J˜—Jšœt˜tJšœžœ˜!Jšœžœ˜-J˜J˜—™!J™šΟn œžœžœž˜šΟcΠck œ˜ Jšœ žœ˜Jšœ! ˜8Jšœžœ  ˜5Jšœžœ˜Jšœ˜Jšœžœ˜ Jšœ ž˜ Jšœ˜—Jšžœ žœ˜Jšžœžœžœ˜J˜J˜ J˜!J˜Jšžœžœžœ˜J˜J˜J˜—šŸ œžœž˜Jšœ’8œ˜>Jšœ'žœ˜=Jšœ:˜:šœ žœ˜%˜ Jšœ ˜*Jšœ˜Jšœ"’œ˜3Jšœ ’ œ˜J˜Jšœ ’ ˜J˜—Jšœ ž˜J˜—Jš žœ žœžœΠct  £˜(J˜J˜—šŸ œžœžœ=˜Wšžœ˜Jšœ žœ ˜Jšœžœ˜Jšœ ž˜#Jšœ˜—JšœG’œR’™›J˜RJšžœ žœžœžœ˜1J˜Jšœ@žœ˜GJšžœžœžœžœ˜*J˜J˜—šœ·˜·J˜—˜J˜——˜J˜—™*Kšœ/™/—K™K™—…—*