DIRECTORY BasicTime USING [ GMT ], RefTab USING [ Ref ], Rope USING [ ROPE ], RPC USING [ EncryptionKey ], Thrush USING [ CallUrgency, ConversationHandle, ConvEventBody, EncryptionKey, EventSequence, IntervalSpec, IntervalSpecs, NB, newTune, nullConvHandle, nullHandle, PartyHandle, ProseSpec, ProseSpecs, Reason, ROPE, SHHH, SmartsHandle, StateInConv, ThHandle, Tune, VoiceInterval ], ThSmartsRpcControl ; FinchSmarts: CEDAR DEFINITIONS = { ConversationHandle: TYPE = Thrush.ConversationHandle; nullConvHandle: Thrush.ConversationHandle = Thrush.nullConvHandle; NB: TYPE = Thrush.NB; nullHandle: Thrush.ThHandle = Thrush.nullHandle; Orig: TYPE = { unknown, us, them }; PartyHandle: TYPE = Thrush.PartyHandle; Reason: TYPE = Thrush.Reason; ROPE: TYPE = Thrush.ROPE; SHHH: TYPE = Thrush.SHHH; FinchInfo: TYPE = REF FinchInfoBody; FinchInfoBody: TYPE = MONITORED RECORD [ smartsID: Thrush.SmartsHandle_Thrush.nullHandle, partyID: Thrush.PartyHandle _ Thrush.nullHandle, shh: SHHH_NIL, conversations: ConvDesc_NIL, currentConvID: ConversationHandle _ nullConvHandle, thProcess: PROCESS_NIL, thAction: CONDITION, apprise: BOOL_FALSE, myName: ThSmartsRpcControl.InterfaceName _ [], myRName: ROPE _ NIL, myPassword: RPC.EncryptionKey _ NULL, serverInstanceName: ROPE _ NIL, serverInstance: ROPE_NIL, namesGVInstanceName: ROPE_NIL, namesGVInstance: ROPE_NIL, sysNoises: RefTab.Ref _ NIL, ReportSystemState: PROC[ on: BOOL ], ReportConversationState: PROC[ nb: NB, cDesc: ConvDesc, remark: ROPE_NIL ] ]; ConvDesc: TYPE = REF ConvDescBody; ConvDescBody: TYPE = RECORD [ cState: Thrush.ConvEventBody, -- amalgam of useful info from reported events desiredState: Thrush.StateInConv_any, -- what we're aiming for desiredPartyID: PartyHandle_NULL, desiredReason: Reason_wontSay, desiredComment: ROPE_NIL, requestedIntervals: Thrush.IntervalSpecs_NIL, pendingIntervals: Thrush.IntervalSpecs_NIL, -- a tail of requestedIntervals, to be started requestedProses: Thrush.ProseSpecs_NIL, pendingProses: Thrush.ProseSpecs_NIL, -- a tail of requestedProses, to be started newEvent, newSpec, newKeys, newAddress: BOOL _FALSE, descValid: BOOL_FALSE, clientData: REF _ NIL, -- only known use: FinchTool uses to store Viewer pointer next, prev: ConvDesc_NIL, otherPartyID: PartyHandle _ nullHandle, otherPartyDesc: ROPE_ NIL, startTime: BasicTime.GMT_NULL, originator: Orig _ unknown, weOriginated: BOOL_FALSE, -- This Finch originated the call bluejayConnection: BOOL_FALSE, proseConnection: BOOL_FALSE, conference: BOOL_FALSE, completed: BOOL_FALSE, failed: BOOL_FALSE ]; InitFinchSmarts: PROC [ thrushInstance: Thrush.ROPE_NIL, ReportSystemState: PROC[ on: BOOL ], ReportConversationState: PROC[ nb: NB, cDesc: ConvDesc, remark: ROPE_NIL ] ]; FinchIsRunning: PROC RETURNS [finchIsRunning: BOOL]; UninitFinchSmarts: PROC[problem: Thrush.ROPE_NIL]; PlaceCall: PROC [ convID: Thrush.ConversationHandle _ Thrush.nullConvHandle, rName: ROPE_NIL, number: ROPE_NIL, urgency: Thrush.CallUrgency_normal, useNumber: BOOL_FALSE]; AnswerCall: PROC[convID: Thrush.ConversationHandle]; DisconnectCall: PROC[ convID: Thrush.ConversationHandle, reason: Thrush.Reason_terminating, comment: ROPE_NIL ]; GetHistory: PROC[ convID: Thrush.ConversationHandle, toState: INT_0 -- i.e., all-- ] RETURNS [ s: Thrush.EventSequence ]; GetRname: PROC[partyID: Thrush.PartyHandle] RETURNS [ rName: ROPE]; RecordReason: TYPE = { ok, abandoned, failed, hopeless }; RecordTuneProc: TYPE = PROC[ useTune: Thrush.Tune_Thrush.newTune, useInterval: Thrush.VoiceInterval_[], queueIt: BOOL_FALSE ] RETURNS[ reason: RecordReason, -- << wouldn't need if only "ok" and "failed/hopeless" are supported.>> tune: Thrush.Tune, interval: Thrush.VoiceInterval_NULL, key: Thrush.EncryptionKey_NULL ]; RecordTune: RecordTuneProc; StopTuneProc: TYPE = PROC[ reason: RecordReason_ok -- other valid value: abandon (recording only: supported?) ]; StopTune: StopTuneProc; PlaybackTuneProc: TYPE = PROC [ tune: Thrush.Tune, interval: Thrush.VoiceInterval_[], key: Thrush.EncryptionKey, queueIt: BOOL_FALSE, failOK: BOOL_FALSE, -- playing is optional; leave connection open if tune doesn't exist. wait: BOOL _ FALSE -- wait until things appear to be started properly, or have failed ] RETURNS [ started: BOOL_FALSE ]; PlaybackTune: PlaybackTuneProc; PlayNoiseProc: TYPE = PROC [ noiseName: ATOM, queueIt: BOOL_FALSE, -- Should be FALSE if timeout stuff is used! serverInstance: ROPE_NIL, -- defaults to UserProfile.ThrushClientServerInstance; this is where the noise is stored. failOK: BOOL_FALSE, -- playing is optional; leave connection open if tune doesn't exist. wait: BOOL _ FALSE -- wait until things appear to be started properly, or have failed ] RETURNS [ started: BOOL ]; -- TRUE: things appear to be started properly PlayNoise: PlayNoiseProc; TextToSpeechProc: TYPE = PROC [text: Rope.ROPE, queueIt: BOOL_TRUE, proseTranslateProc: ProseTranslateProc_NIL] RETURNS [reason: RecordReason_ok]; ProseTranslateProc: TYPE = PROC [inText: Rope.ROPE] RETURNS [outText: Rope.ROPE]; TextToSpeech: TextToSpeechProc; RegisterTranslateProcType: TYPE = PROC [translate: ProseTranslateProc_NIL]; RegisterTranslateProc: RegisterTranslateProcType; StopSpeechProc: TYPE = PROC [reason: RecordReason_ok]; StopSpeech: StopSpeechProc; ResetProse: StopSpeechProc; GetConvDesc: PROC[convID: ConversationHandle] RETURNS [cDesc: ConvDesc]; DequeueInterval: PROC[cDesc: ConvDesc] RETURNS [ int: Thrush.IntervalSpec_NIL ]; Feep: PROC[feepString: ROPE]; FinchState: TYPE = { unknown, running, stopped }; Procs: TYPE = REF ProcsRecord; ProcsRecord: TYPE = RECORD [ playbackTune: PlaybackTuneProc, playNoise: PlayNoiseProc, recordTune: RecordTuneProc, stopTune: StopTuneProc, textToSpeech: TextToSpeechProc, registerTranslateProc: RegisterTranslateProcType, stopSpeech: StopSpeechProc, resetProse: StopSpeechProc, finchIsRunning: PROC RETURNS [isRunning: BOOL] ]; Register: PROC [finchSmartsProcs: Procs]; GetProcs: PROC RETURNS [Procs]; CurrentFinchState: PROC RETURNS [finchState: FinchState]; }. ÒFinchSmarts.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Polle Zellweger (PTZ) October 24, 1985 4:56:34 pm PDT Last Edited by: Swinehart, September 7, 1985 7:29:26 am PDT Types Call backs Switching data Client Data Initialization Whenever a toggle occurs, so does this procedure. Client-relevant changes in conversation state are reported in gory detail; FinchSmarts is allowed to invent parts of it (e.g., reason and remark fields) Expect ReportSystemState, followed by some number of ReportConversationStates, soon. No more than one client should call this procedure, at present. Call Management Uses specified conversation, creates a new one or uses one that's in a sufficiently idle state. Interpretation of rName and number -- evaluate until action can be taken: rName exists in switching system (has an Etherphone, usually) and ~use#: call that party. number#NIL: rName is simply a description; call by number rName=NIL or use#: invalid parameters rName exists in obsolete directory and ~use#: use the resulting number all tests fail: no such party. Recording and Playback ok: something was recorded abandoned: user or client program asked to abandon the recording (supported?) failed: something went wrong, but may not next time. hopeless: will continue to fail until somebody does something creative. convID: Thrush.ConversationHandle _ Thrush.nullConvHandle, --vestigial until I figger it out This procedure waits until the recording is complete. While it is running, calls to the registered procedures may occur to inform the user of what's happening. Client is responsible for arranging process structures so that there is a process available to call StopTune while a call to RecordTune is still pending. convID should be defaulted convID: Thrush.ConversationHandle _ Thrush.nullConvHandle, --vestigial until I figger it out Terminates recording or playback of tune, if any. Causes any pending RecordTune to terminate and return. convID: Thrush.ConversationHandle _ Thrush.nullConvHandle, --vestigial until I figger it out Some tunes are stored in the Grapevine registry under global "noise names". Play one of them. convID: Thrush.ConversationHandle _ Thrush.nullConvHandle, --vestigial until I figger it out Text-to-speech server A translate proc is used to modify the text rope to make it more intelligible. Examples: 1) words that the Prose doesn't pronounce correctly could be respelled or given as phonemes, and 2) Prose commands to alter speech speed or pitch could be added. Send rope to text-tospeech server. Called with rope = the current selection by FinchTool's SpeakText button. Input rope will be modified by the translate proc if (a) one is specified with this call or (b) one has previously been specified via RegisterTranslateProc[proc] below. Register default translate procedure to be used by TextToSpeech to make the text rope more intelligible. Most useful as a way to modify the action of the FinchTool's SpeakText button. Flushes text-to-speech server queues, halts current speech. Flushes text-to-speech server queues, initiates Prose self-test, and resets all speech parameters. Intended as an escape hatch. Conversation Access <> Registration This is like the WalnutRegistry. Finch registers its procedures here, and clients of Finch obtain and use them. FinchRegistryImpl implements these procedures. Finch runs FinchRegistryImpl if it's not already running, and so do its applications. Multiple instances of FinchRegistryImpl produce multiple registrations, though, so be careful with configs. Unlike WalnutRegistry, this one is presently set up to deal with only one set of registered procs at a time. Created for use by WalnutVoice, which wants to be able to run with or without Finch running. Register a set of procedures to be invoked when the appropriate database changes occur. Return a registration that can be used to name the set Get the current registered set, or NIL a quick and safe way to find out if Finch has been loaded and if it is active or not Swinehart, July 18, 1985 3:31:34 pm PDT Created FinchSmarts.Register and friends -- easier for WalnutVoice to deal with Finch. changes to: InitFinchSmarts, RecordTuneProc, RecordTune, StopTuneProc, StopTune, PlaybackTuneProc, PlaybackTune, PlayNoiseProc, PlayNoise, Feep, FinchState, Procs, CurrentFinchState, Procs, Register, FinchIsRunning, UninitFinchSmarts, GetProcs Polle Zellweger (PTZ) July 13, 1985 5:20:26 pm PDT adding Text-to-Speech server Changes to: DIRECTORY, FinchInfoBody, ConvDescBody Added: TextToSpeech, StopSpeech Swinehart, August 6, 1985 4:19:33 pm PDT Merge PTZ Prose changes changes to: DIRECTORY, FinchInfoBody, ConvDescBody, PlayNoise, TextToSpeech, StopSpeechProc, StopSpeech, ProcsRecord Polle Zellweger (PTZ) August 29, 1985 5:06:29 pm PDT changes to: TextToSpeechProc, ProseTranslateProc, TextToSpeech, StopSpeechProc, StopSpeech, ResetProse, ProcsRecord Polle Zellweger (PTZ) September 3, 1985 6:17:21 pm PDT Allow registration of proseTranslateProc. changes to: ProseTranslateProc, TextToSpeech, RegisterTranslateProcType, RegisterTranslateProc, ProcsRecord Polle Zellweger (PTZ) October 24, 1985 4:56:25 pm PDT Move bluejayConnection and proseConnection from FinchInfo to ConvDesc. changes to: FinchInfoBody, ConvDescBody ÊÓ˜™Icodešœ Ïmœ1™Jšœžœ˜!J˜Jšœžœžœ˜Jšœ)žœ˜-Jšœ'žœ .˜ZJšœ#žœ˜'Jšœ!žœ +˜QJšœ(žœž˜4Jšœ žœžœ˜J˜J™ Jšœ žœžœ 9˜PJšœžœ˜Jšœ'˜'Jšœžœžœ˜Jšœžœžœ˜J˜Jšœžœžœ !˜;Jšœžœžœ˜Jšœžœžœ˜Jšœ žœžœ˜Jšœ žœž˜Jšœžœž˜J˜—J™—™J˜šŸœžœ˜Jšœžœžœ˜ šŸœžœžœ˜$J™1—š Ÿœžœžœžœžœ˜JJšœ˜™˜—Jšœ˜JšœT™TJ™?—J˜JšŸœžœžœžœ˜4J˜JšŸœžœžœžœ˜3J˜—™J˜šŸ œžœ˜Jšœ:˜:Jšœžœžœ˜Jšœžœ˜Jšœ#˜#Jšœ žœžœ˜J™_™IJ™YJ™9J™%J™FJ™—J˜—šŸ œžœ$˜4J˜—šŸœžœ˜Jšœ"˜"J˜"Jšœ žœž˜Jšœ˜—J˜šŸ œžœ.žœ œ˜TJšžœ˜$—J˜JšŸœžœžœ žœ˜CJ˜—™J˜šœžœ'˜9J™J™MJ™4J™G—J˜šŸœžœžœ˜Jšœ\™\J˜$J˜%Jšœ žœž˜Jšœ˜Jšžœ˜Jšœ G˜]J˜Jšœžœ˜$Jšœž˜J˜Jšœ†ÏbœŸ œ™»Jš¡œ™—JšŸ œ˜J˜šŸ œžœžœ˜Jšœ\™\Jšœ :˜RJšœ˜J™i—JšŸœ˜J˜šŸœž œ˜Jšœ\™\Jšœ˜J˜"J˜Jšœ žœž˜Jšœžœžœ D˜XJšœž  B˜UJšœžœ žœžœ˜"—JšŸ œ˜J˜J™^šŸ œž œ˜Jšœ\™\Jšœ žœ˜Jšœ žœžœ ,˜AJšœžœžœ Y˜sJšœžœžœ D˜XJšœž  B˜UJšœžœ žœ -˜J—JšŸ œ˜J˜—™KšŸœžœžœ žœ žœžœ)žœžœ˜’š Ÿœžœžœžœžœžœ˜QK™û—šŸ œ˜Kšœ˜™˜—KšŸœžœžœ žœ˜KšŸœ˜1K™¸—J˜JšŸœžœžœ˜6šŸ œ˜J™;—šŸ œ˜J™€—J˜—™JšŸ œžœžœ˜HJ˜JšŸœžœžœžœ˜PJ˜—š¡™J˜JšŸœžœ žœ˜J˜—™ J™J™äJ™lJ™\J™J˜1J˜Jšœžœžœ ˜šœ žœžœ˜J˜Jšœ˜Jšœ˜Jšœ˜J˜J˜1J˜J˜Jšœžœžœ žœ˜.J˜J˜—šŸœžœ˜)Jšœ™J™—šŸœžœžœ ˜Jšœ#ž™&J™—šŸœžœžœ˜9J™T—J™—J˜J™™'K™VKšœ Ïrç™ó—™2K™Kšœ ¢&™2Kšœ¢™—™(K™Kšœ ¢h™t—K™™4Kšœ ¢g™s—™6Kšœ¢œ™)Kšœ ¢_™k—™5KšœF™FKšœ ¢™'—K™—…—˜5=