DIRECTORY IO, RefID USING [ ID ], Rope USING [ROPE], RuntimeError USING [ UNCAUGHT ], SRPCCalls USING [ Conversation, Error, GetSHandle, NewRPCConversation, ReleaseConversation, ReportProc, SHandle, TimeoutEnable], SunRPC, Thrush, ThrushSunRPC, ThrushSunRPCConvert, SynthesizerServer, SynthesizerServerRpcControl, SynthesizerServerSunImport, SynthesizerServerSunRPC, SynthesizerServerSunRPCClient, VoiceUtils ; SynthesizerServerToSynthesizerServerSunRPC: CEDAR PROGRAM IMPORTS IO, RuntimeError, SRPCCalls, SynthesizerServerSunRPCClient, ThrushSunRPCConvert, VoiceUtils EXPORTS SynthesizerServerSunImport = { OPEN IO, ThrushSunRPCConvert; sunSHHH: CARD32 = 0; SHandle: TYPE ~ SRPCCalls.SHandle; InterfaceRecord: TYPE ~ SynthesizerServerRpcControl.InterfaceRecord; TextToSpeech: PROC [ interface: InterfaceRecord, shhh: Thrush.SHHH¬Thrush.none, credentials: Thrush.Credentials, -- authenticates caller serviceID: RefID.ID, -- identifies particular service textToSpeak: Rope.ROPE, actionID: Thrush.ActionID, filter: BOOL¬TRUE, queueIt: BOOL¬TRUE ] RETURNS [nb: Thrush.NB] = { ENABLE { SRPCCalls.Error => { nb ¬ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ¬ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srNB ¬ SynthesizerServerSunRPCClient.TextToSpeech[h: GetHandle[shhh], shhh: sunSHHH, credentials: CredentialsToSr[credentials], serviceID: serviceID, textToSpeak: ROPEToSr[textToSpeak], actionID: actionID, filter: filter, queueIt: queueIt]; nb ¬ SrToATOM[srNB]; }; StopSpeech: PROC [ interface: InterfaceRecord, shhh: Thrush.SHHH¬Thrush.none, credentials: Thrush.Credentials, serviceID: RefID.ID, reset: BOOL ¬ FALSE ] RETURNS [nb: Thrush.NB] = { ENABLE { SRPCCalls.Error => { nb ¬ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ¬ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srNB ¬ SynthesizerServerSunRPCClient.StopSpeech[h: GetHandle[shhh], shhh: sunSHHH, credentials: CredentialsToSr[credentials], serviceID: serviceID, reset: reset]; nb ¬ SrToATOM[srNB]; }; GetSynthesizerSpecifications: PROC [ interface: InterfaceRecord, shhh: Thrush.SHHH¬Thrush.none, serviceID: RefID.ID ] RETURNS [ nb: Thrush.NB, synthesizerModel: ATOM, synthesizerVersion: ATOM ] = { ENABLE { SRPCCalls.Error => { nb ¬ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ¬ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srSm, srSv: Rope.ROPE; [srNB, srSm, srSv] ¬ SynthesizerServerSunRPCClient.GetSynthesizerSpecifications[h: GetHandle[shhh], shhh: sunSHHH, serviceID: serviceID]; nb ¬ SrToATOM[srNB]; synthesizerModel ¬ SrToATOM[srSm]; synthesizerVersion ¬ SrToATOM[srSv]; }; GetHandle: PROC[shhh: Thrush.SHHH] RETURNS [h: SunRPC.Handle] ~ { sHandle: SHandle; IF shhh = NIL THEN SRPCCalls.Error[$noConversationSupplied]; sHandle ¬ SRPCCalls.GetSHandle[shhh]; IF sHandle=NIL THEN SRPCCalls.Error[$invalidConversationSupplied]; h ¬ sHandle.handle; }; sunPgm: CARD ¬ 390911; -- decimal program number for VoiceRopeServer sunPgmVersion: CARD ¬ 1; sunCallTimeout: INT ¬ 3000; sunCallRetries: INT ¬ 3; sunCallTimeoutEnable: SRPCCalls.TimeoutEnable ¬ always; ImportInterface: PUBLIC PROC [instance: Rope.ROPE] RETURNS [interface: InterfaceRecord, shhh: Thrush.SHHH] ~ { shhh ¬ SRPCCalls.NewRPCConversation[serverName: instance, rpcProgram: sunPgm, rpcVersion: sunPgmVersion, timeoutEnable: sunCallTimeoutEnable, timeoutInMs: sunCallTimeout, retries: sunCallRetries, reportProc: ForwardReports]; SRPCCalls.GetSHandle[shhh].enabled ¬ TRUE; interface ¬ NEW[SynthesizerServerRpcControl.InterfaceRecordObject]; interface­ ¬ [ clientStubTextToSpeech: TextToSpeech, clientStubStopSpeech: StopSpeech, clientStubGetSynthesizerSpecifications: GetSynthesizerSpecifications ]; }; UnImportInterface: PUBLIC PROC [shhh: Thrush.SHHH] ~ { SRPCCalls.ReleaseConversation[shhh]; }; ReportError: PROC[shhh: Thrush.SHHH, errCode: ATOM, explanation: Rope.ROPE¬NIL] RETURNS[nb: Thrush.NB] ~ { sHandle: SHandle ¬ SRPCCalls.GetSHandle[shhh]; IF sHandle=NIL THEN RETURN; ForwardReports[sHandle, errCode, explanation]; nb ¬ $callFailed; }; ForwardReports: SRPCCalls.ReportProc ~ { VoiceUtils.ProblemFR[remark: "Synthesizer Server Failure, code: %g, expl: %g", where: $System, a1: atom[ec], a2: rope[expl]]; }; }. & SynthesizerServerToSynthesizerServerSunRPC.mesa Copyright Σ 1990, 1992 by Xerox Corporation. All rights reserved. Pier, May 24, 1990 12:56:29 pm PDT Swinehart, September 19, 1990 7:17:53 am PDT Polle Zellweger (PTZ) October 29, 1990 3:30:54 pm PST Procedures Handles Connecting instance should be a SunRPC address, in the form "sun#[1.2.3.4]#5", where [1.2.3.4] is the Arpa address, and 5 is the port. Polle Zellweger (PTZ) October 29, 1990 3:30:54 pm PST Allow detection of NIL ropes across a SunRPC connection. changes to: TextToSpeech Κͺ•NewlineDelimiter –(cedarcode) style™šœ/™/Icodešœ Οeœ7™BK™"K™,K™5—K˜šΟk ˜ K˜Kšœžœžœ˜Kšœžœžœ˜Kšœ žœžœ˜ šœ žœ˜K˜n—K˜Kšœ˜Kšœ ˜ Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜K˜ K˜K˜—KšΟn*œžœž˜9Kšžœ\˜cKšžœ˜"Kšœ˜K˜Kšžœ˜K˜Icode0šœ žœ˜šœ žœ˜"J™—Kšœžœ/˜Dhead™ šŸ œžœ˜K˜Kšœ žœ ˜Kšœ!Οc˜8Kšœžœ  ˜5Kšœžœ˜Kšœ˜Kšœžœžœ˜Kšœ žœž˜šœžœ žœ˜šΠos˜Kš‘œ‘6˜OKš‘œ‘/˜NKš‘˜—Kšœžœ˜Kšœ%Ÿ œΏ˜πK˜K˜—K˜—šŸ œžœ˜K˜Kšœ žœ ˜Kšœ ˜ Kšœžœ˜Kšœžœž˜šœžœ žœ˜š‘˜Kš‘œ‘6˜OKš‘œ‘/˜NKš‘˜—Kšœžœ˜Kšœ%Ÿ œs˜’K˜K˜—K˜—šŸœžœ˜$K˜Kšœ žœ ˜Kšœž˜š œžœžœžœžœ˜Qš‘˜Kš‘œ‘6˜OKš‘œ‘/˜NKš‘˜—Kšœžœ˜Kšœžœ˜Kšœ3Ÿœ:˜‰K˜K˜"K˜$K˜———™šŸ œžœžœžœ˜AKšœ˜Kšžœžœžœ*˜