DIRECTORY RefID USING [ID], Rope USING [ROPE], RuntimeError USING [ UNCAUGHT ], SRPCCalls USING [ Conversation, Error, GetSHandle, Handle, NewRPCConversation, ReleaseConversation, ReportProc, SHandle, TimeoutEnable], Thrush, ThrushSunRPC, ThrushSunRPCConvert, VoiceRopeServer, VoiceRopeServerSunImport, VoiceRopeServerSunRPC, VoiceRopeServerSunRPCClient ; VoiceRopeServerToVoiceRopeServerSunRPC: CEDAR PROGRAM IMPORTS RuntimeError, SRPCCalls, ThrushSunRPCConvert, VoiceRopeServerSunRPCClient EXPORTS VoiceRopeServer, VoiceRopeServerSunImport ~ { OPEN ThrushSunRPCConvert; VoiceRope: TYPE = VoiceRopeServer.VoiceRope; VoiceRopeInterval: TYPE = VoiceRopeServer.VoiceRopeInterval; InterestClass: TYPE = VoiceRopeServer.InterestClass; Users: TYPE = VoiceRopeServer.Users; maxEnergy: INTEGER = VoiceRopeServer.maxEnergy; EnergyRange: TYPE = VoiceRopeServer.EnergyRange; EnergySequence: TYPE = VoiceRopeServer.EnergySequence; EnergySequenceRec: TYPE = VoiceRopeServer.EnergySequenceRec; VoiceSample: TYPE = VoiceRopeServer.VoiceSample; VoiceBlock: TYPE = VoiceRopeServer.VoiceBlock; VoiceBlockRec: TYPE = VoiceRopeServer.VoiceBlockRec; Interval: TYPE = VoiceRopeServer.Interval; IntervalSpecs: TYPE = VoiceRopeServer.IntervalSpecs; sunSHHH: CARD32 = 0; SHandle: TYPE ~ SRPCCalls.SHandle; Record: PUBLIC PROC[shhh: Thrush.SHHH ฌ Thrush.none, credentials: Thrush.Credentials, serviceID: RefID.ID, recordedParty: Thrush.PartyID ฌ Thrush.nullID, intID: CARD ฌ 0, queueIt: BOOL ฌ TRUE] RETURNS [nb: Thrush.NB, voiceRope: VoiceRope] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srVoiceRope: VoiceRopeServerSunRPC.VoiceRope; [srNB, srVoiceRope] ฌ VoiceRopeServerSunRPCClient.Record[h: GetInfo[shhh], shhh: sunSHHH, credentials: CredentialsToSr[credentials], serviceID: serviceID, recordedParty: recordedParty, intID: intID, queueIt: queueIt]; nb ฌ SrToATOM[srNB]; voiceRope ฌ SrToVoiceRope[srVoiceRope]; }; Play: PUBLIC PROC[shhh: Thrush.SHHH ฌ Thrush.none, voiceRope: VoiceRope, credentials: Thrush.Credentials, serviceID: RefID.ID, intID: CARD ฌ 0, 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 ฌ VoiceRopeServerSunRPCClient.Play[h: GetInfo[shhh], shhh: sunSHHH, voiceRope: VoiceRopeToSr[voiceRope], credentials: CredentialsToSr[credentials], serviceID: serviceID, intID: intID, queueIt: queueIt]; nb ฌ SrToATOM[srNB]; }; Stop: PUBLIC PROC[shhh: Thrush.SHHH ฌ Thrush.none, credentials: Thrush.Credentials, serviceID: RefID.ID] RETURNS [nb: Thrush.NB] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srNB ฌ VoiceRopeServerSunRPCClient.Stop[h: GetInfo[shhh], shhh: sunSHHH, creentials: CredentialsToSr[credentials], serviceID: serviceID]; nb ฌ SrToATOM[srNB]; }; Pause: PUBLIC PROC[shhh: Thrush.SHHH ฌ Thrush.none, credentials: Thrush.Credentials, serviceID: RefID.ID] RETURNS [nb: Thrush.NB] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srNB ฌ VoiceRopeServerSunRPCClient.Pause[h: GetInfo[shhh], shhh: sunSHHH, cedentials: CredentialsToSr[credentials], serviceID: serviceID]; nb ฌ SrToATOM[srNB]; }; Resume: PUBLIC PROC[shhh: Thrush.SHHH ฌ Thrush.none, credentials: Thrush.Credentials, serviceID: RefID.ID] RETURNS [nb: Thrush.NB] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srNB ฌ VoiceRopeServerSunRPCClient.Resume[h: GetInfo[shhh], shhh: sunSHHH, credentials: CredentialsToSr[credentials], serviceID: serviceID]; nb ฌ SrToATOM[srNB]; }; Retain: PUBLIC PROC [shhh: Thrush.SHHH ฌ Thrush.none, callerRName: Rope.ROPE, vr: VoiceRope, class: InterestClass, refID: Rope.ROPE, other: Rope.ROPE ฌ NIL] RETURNS [nb: Thrush.NB] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srNB ฌ VoiceRopeServerSunRPCClient.Retain[h: GetInfo[shhh], shhh: sunSHHH, callerRName: ROPEToSr[callerRName], vr: VoiceRopeToSr[vr], class: ROPEToSr[class], refID: ROPEToSr[refID], other: ROPEToSr[other] ]; nb ฌ SrToATOM[srNB]; }; Forget: PUBLIC PROC [shhh: Thrush.SHHH ฌ Thrush.none, vr: VoiceRope, class: InterestClass, refID: Rope.ROPE] RETURNS [nb: Thrush.NB] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srNB ฌ VoiceRopeServerSunRPCClient.Forget[h: GetInfo[shhh], shhh: sunSHHH, vr: VoiceRopeToSr[vr], class: ROPEToSr[class], refID: ROPEToSr[refID] ]; nb ฌ SrToATOM[srNB]; }; GetByInterest: PUBLIC PROC [shhh: Thrush.SHHH ฌ Thrush.none, class: InterestClass, refID: Rope.ROPE] RETURNS [nb: Thrush.NB, voiceRope: VoiceRope] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srVoiceRope: VoiceRopeServerSunRPC.VoiceRope; [srNB, srVoiceRope] ฌ VoiceRopeServerSunRPCClient.GetByInterest[h: GetInfo[shhh], shhh: sunSHHH, class: ROPEToSr[class], refID: ROPEToSr[refID] ]; nb ฌ SrToATOM[srNB]; voiceRope ฌ SrToVoiceRope[srVoiceRope]; }; Cat: PUBLIC PROC [shhh: Thrush.SHHH ฌ Thrush.none, callerRName: Rope.ROPE, vr1, vr2, vr3, vr4, vr5: VoiceRope ฌ NIL] RETURNS [nb: Thrush.NB, new: VoiceRope] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srVoiceRope: VoiceRopeServerSunRPC.VoiceRope; [srNB, srVoiceRope] ฌ VoiceRopeServerSunRPCClient.Cat[h: GetInfo[shhh], shhh: sunSHHH, callerRName: ROPEToSr[callerRName], vr1: VoiceRopeToSr[vr1], vr2: VoiceRopeToSr[vr2], vr3: VoiceRopeToSr[vr3], vr4: VoiceRopeToSr[vr4], vr5: VoiceRopeToSr[vr5]]; nb ฌ SrToATOM[srNB]; new ฌ SrToVoiceRope[srVoiceRope]; }; Substr: PUBLIC PROC [shhh: Thrush.SHHH ฌ Thrush.none, callerRName: Rope.ROPE, vr: VoiceRope, start: INT ฌ 0, len: INT ฌ LAST[INT]] RETURNS [nb: Thrush.NB, new: VoiceRope] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srVoiceRope: VoiceRopeServerSunRPC.VoiceRope; [srNB, srVoiceRope] ฌ VoiceRopeServerSunRPCClient.Substr[h: GetInfo[shhh], shhh: sunSHHH, callerRName: ROPEToSr[callerRName], vr: VoiceRopeToSr[vr], start: start, len: len]; nb ฌ SrToATOM[srNB]; new ฌ SrToVoiceRope[srVoiceRope]; }; Replace: PUBLIC PROC [shhh: Thrush.SHHH ฌ Thrush.none, callerRName: Rope.ROPE, vr: VoiceRope, start: INT ฌ 0, len: INT ฌ LAST[INT], with: VoiceRope ฌ NIL] RETURNS [nb: Thrush.NB, new: VoiceRope] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srVoiceRope: VoiceRopeServerSunRPC.VoiceRope; [srNB, srVoiceRope] ฌ VoiceRopeServerSunRPCClient.Replace[h: GetInfo[shhh], shhh: sunSHHH, callerRName: ROPEToSr[callerRName], vr: VoiceRopeToSr[vr], start: start, len: len, with: VoiceRopeToSr[with]]; nb ฌ SrToATOM[srNB]; new ฌ SrToVoiceRope[srVoiceRope]; }; Length: PUBLIC PROC [shhh: Thrush.SHHH ฌ Thrush.none, vr: VoiceRope] RETURNS [nb: Thrush.NB, len: INT] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; [srNB, len] ฌ VoiceRopeServerSunRPCClient.Length[h: GetInfo[shhh], shhh: sunSHHH, vr: VoiceRopeToSr[vr]]; nb ฌ SrToATOM[srNB]; }; DescribeRope: PUBLIC PROC [shhh: Thrush.SHHH ฌ Thrush.none, vr: VoiceRope, minSilence: INT ฌ -1] RETURNS [nb: Thrush.NB, length: INT, noise: IntervalSpecs] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srIntervalSpecs: VoiceRopeServerSunRPC.IntervalSpecs; [srNB, length, srIntervalSpecs] ฌ VoiceRopeServerSunRPCClient.DescribeRope[h: GetInfo[shhh], shhh: sunSHHH, vr: VoiceRopeToSr[vr], minSilence: minSilence]; nb ฌ SrToATOM[srNB]; noise ฌ SrToIntervalSpecs[srIntervalSpecs]; }; GetEnergies: PUBLIC PROC [shhh: Thrush.SHHH ฌ Thrush.none, vr: VoiceRope, samplesPerSegment: [1..8000] ฌ 160] RETURNS [nb: Thrush.NB, energies: EnergySequence] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srEnergySequence: VoiceRopeServerSunRPC.EnergySequence; [srNB, srEnergySequence] ฌ VoiceRopeServerSunRPCClient.GetEnergies[h: GetInfo[shhh], shhh: sunSHHH, vr: VoiceRopeToSr[vr], samplesPerSegment: samplesPerSegment]; nb ฌ SrToATOM[srNB]; energies ฌ SrToEnergySequence[srEnergySequence]; }; FetchBlock: PUBLIC PROC [shhh: Thrush.SHHH ฌ Thrush.none, vr: VoiceRope, start: INT, len: INT ฌ 8000, decrypt: BOOLEAN ฌ TRUE] RETURNS [nb: Thrush.NB, block: VoiceBlock] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srVoiceBlock: VoiceRopeServerSunRPC.VoiceBlock; [srNB, srVoiceBlock] ฌ VoiceRopeServerSunRPCClient.FetchBlock[h: GetInfo[shhh], shhh: sunSHHH, vr: VoiceRopeToSr[vr], start: start, len: len, decrypt: decrypt]; nb ฌ SrToATOM[srNB]; block ฌ SrToVoiceBlock[srVoiceBlock]; }; StoreBlock: PUBLIC PROC [shhh: Thrush.SHHH ฌ Thrush.none, block: VoiceBlock, key: Thrush.EncryptionKey ฌ Thrush.nullKey] RETURNS [nb: Thrush.NB, voiceRope: VoiceRope] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srVoiceRope: VoiceRopeServerSunRPC.VoiceRope; [srNB, srVoiceRope] ฌ VoiceRopeServerSunRPCClient.StoreBlock[h: GetInfo[shhh], shhh: sunSHHH, block: VoiceBlockToSr[block], key: EncryptionKeyToSr[key]]; nb ฌ SrToATOM[srNB]; voiceRope ฌ SrToVoiceRope[srVoiceRope]; }; SetPermissions: PUBLIC PROC [shhh: Thrush.SHHH ฌ Thrush.none, callerRName: Rope.ROPE, vr: VoiceRope, playAccess: Users, editAccess: Users] RETURNS [nb: Thrush.NB] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srNB ฌ VoiceRopeServerSunRPCClient.SetPermissions[h: GetInfo[shhh], shhh: sunSHHH, callerRName: ROPEToSr[callerRName], vr: VoiceRopeToSr[vr], playAccess: UsersToSr[playAccess], editAccess: UsersToSr[editAccess]]; nb ฌ SrToATOM[srNB]; }; GetPermissions: PUBLIC PROC [shhh: Thrush.SHHH ฌ Thrush.none, vr: VoiceRope] RETURNS [nb: Thrush.NB, playAccess: Users, editAccess: Users] = { ENABLE { SRPCCalls.Error => { nb ฌ ReportError[shhh, errCode, explanation]; CONTINUE; }; RuntimeError.UNCAUGHT => { nb ฌ ReportError[shhh, $unknownError]; CONTINUE; }; }; srNB: ThrushSunRPC.NB; srPlayAccess, srEditAccess: VoiceRopeServerSunRPC.Users; [srNB, srPlayAccess, srEditAccess] ฌ VoiceRopeServerSunRPCClient.GetPermissions[h: GetInfo[shhh], shhh: sunSHHH, vr: VoiceRopeToSr[vr]]; nb ฌ SrToATOM[srNB]; playAccess ฌ SrToUsers[srPlayAccess]; editAccess ฌ SrToUsers[srEditAccess]; }; GetInfo: PROC[shhh: Thrush.SHHH] RETURNS [h: SRPCCalls.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 ฌ 390912; -- decimal program number for VoiceRopeServer sunPgmVersion: CARD ฌ 1; sunCallTimeout: INT ฌ 3000; sunCallRetries: INT ฌ 3; sunCallTimeoutEnable: SRPCCalls.TimeoutEnable ฌ always; ReportProblem: TYPE ~ VoiceRopeServerSunImport.ReportProblem; VRHandle: TYPE ~ REF VRHandleRec; VRHandleRec: TYPE ~ RECORD [ reportProblem: ReportProblem, reportData: REF ]; ImportInterface: PUBLIC PROC [instance: Rope.ROPE, reportProblem: ReportProblemฌNIL, reportData: REFฌNIL] RETURNS [shhh: Thrush.SHHH] ~ { vrHandle: VRHandle ฌ NEW[VRHandleRec ฌ [reportProblem, reportData]]; shhh ฌ SRPCCalls.NewRPCConversation[serverName: instance, rpcProgram: sunPgm, rpcVersion: sunPgmVersion, timeoutEnable: sunCallTimeoutEnable, timeoutInMs: sunCallTimeout, retries: sunCallRetries, reportProc: ForwardReports, clientData: vrHandle]; SRPCCalls.GetSHandle[shhh].enabled ฌ TRUE; }; 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 ~ { vrHandle: VRHandle ฌ NARROW[sHandle.clientData]; IF vrHandle=NIL THEN RETURN; -- Can't report, perhaps handle has been released vrHandle.reportProblem[vrHandle.reportData, ec, expl]; }; }. < VoiceRopeServerToVoiceRopeServerSunRPC.mesa Copyright ำ 1990, 1992 by Xerox Corporation. All rights reserved. Pier, May 24, 1990 12:51:46 pm PDT Swinehart, September 16, 1990 9:58:35 pm PDT Polle Zellweger, December 28, 1990 12:11 pm PST VoiceRopeServer is a voice service interface. It is exported to $recording service parties to provide access to procedures for recording and playing voice, and for VoiceRope editing activities. The following two definitions are identical to those in Jukebox; they are reproduced here to avoid a dependency on Jukebox Creating and playing voice ropes Pause playing the scheduled intervals. No effect on recording. No reports at present. Interests in voice ropes Editing voice ropes Information about voice ropes Retrieval and storage of voice samples Creates a new voice rope whose contents are the given block. Access control Restricts access to the specified voice rope. Only the creator of a voice rope may change its access control lists, i.e. invoke this operation. 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) August 14, 1990 10:45:24 pm PDT changes to: DIRECTORY, EXPORTS Polle Zellweger (PTZ) October 29, 1990 5:13:22 pm PST Allow detection of NIL ropes across a SunRPC connection. changes to: Retain, Forget, GetByInterest Polle Zellweger, December 27, 1990 6:15:26 pm PST Added callerRName field to operations that need to know the caller's name. changes to: Retain, Cat, Substr, Replace, SetPermissions ส ิ•NewlineDelimiter –(cedarcode) style™šœ+™+Icodešœ ฯeœ7™BKšœ"™"K™,K™/—K˜JšœAฯo œw™ยJ™šฯk ˜ KšœŸœŸœ˜KšœŸœŸœ˜Kšœ ŸœŸœ˜ šœ Ÿœ˜K˜v—Kšœ˜Kšœ ˜ K˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜K˜K˜—Kšฯn&œŸœŸ˜5KšŸœJ˜QKšŸœ*˜1Kšœ˜K˜KšŸœ˜K˜Kšœ Ÿœ˜,KšœŸœ%˜  œQ˜›K˜K˜+K˜K˜—š   œŸ œŸœCŸœ Ÿœ˜ฃšก˜Kšกœก6˜OKšกœก/˜NKšก˜—KšœŸœ˜Kšœ7˜7Kšœ7  œ_˜กK˜K˜0K˜——™&š  œŸ œŸœ&ŸœŸœŸœŸœŸœ Ÿœ˜ญšก˜Kšกœก6˜OKšกœก/˜NKšก˜—KšœŸœ˜Kšœ/˜/Kšœ3  œc˜ K˜K˜%K˜K™—š   œŸ œŸœOŸœ Ÿœ˜ชšก˜Kšกœก6˜OKšกœก/˜NKšก˜—K™