<> <> <> <> DIRECTORY BasicTime USING [ GMT ], MBQueue USING [ Queue ], RefID USING [ ID ], RefQ USING [ Queue ], Rope USING [ ROPE ], RPC USING [ EncryptionKey ], ThParty USING [ PartyInfo ], Thrush USING [ ConversationID, ConvEventBody, NB, nullConvID, nullID, PartyID, Reason, ROPE, SHHH, SmartsID, StateInConv ], ThSmartsRpcControl ; FinchSmarts: CEDAR DEFINITIONS = { <> <<>> ConversationID: TYPE = Thrush.ConversationID; nullConvID: ConversationID = Thrush.nullConvID; NB: TYPE = Thrush.NB; nullID: RefID.ID = Thrush.nullID; WhoOriginated: TYPE = { unknown, us, them }; PartyID: TYPE = Thrush.PartyID; Reason: TYPE = Thrush.Reason; ROPE: TYPE = Thrush.ROPE; SHHH: TYPE = Thrush.SHHH; FinchInfo: TYPE = REF FinchInfoBody; FinchInfoBody: TYPE = MONITORED RECORD [ smartsID: Thrush.SmartsID_nullID, partyID: PartyID _ nullID, shh: SHHH_NIL, conversations: RefQ.Queue -- of ConvDescs --, currentConvID: ConversationID _ nullConvID, requests: MBQueue.Queue, stateChange: CONDITION, myName: ThSmartsRpcControl.InterfaceName _ [], myRName: ROPE _ NIL, myPassword: RPC.EncryptionKey _ NULL, <> ReportSystemState: PROC[ on: BOOL ], ReportConversationState: PROC[ nb: NB, cDesc: ConvDesc, remark: ROPE_NIL ] ]; ConvDesc: TYPE = REF ConvDescBody; ConvDescBody: TYPE = RECORD [ <> situation: Thrush.ConvEventBody, -- amalgam of useful info from last-reported event <> whoOriginated: WhoOriginated _ unknown, ultimateState: Thrush.StateInConv _ idle, -- last state reached (except for idle) <> <> <> <> startTime: BasicTime.GMT_NULL, subject: ROPE_NIL, numParties: NAT_0, numActive: NAT_0, numIdle: NAT_0, partyInfo: ThParty.PartyInfo_NIL, -- Complete description as of some recent time <> clientData: REF _ NIL, <> << but this field is cleared once the ConvDesc leaves the FinchInfo.conversations Queue.>> originatorRecorded: BOOL_FALSE, reportComplete: 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, nb: Thrush.NB_NIL]; <> PlaceCall: PROC [ convID: Thrush.ConversationID _ nullConvID, rName: ROPE_NIL, number: ROPE_NIL, useNumber: BOOL_FALSE]; <> <> <> <> <> <> <> AnswerCall: PROC[convID: ConversationID]; DisconnectCall: PROC[ convID: ConversationID, reason: Thrush.Reason_$terminating, comment: ROPE_NIL ]; <> <<>> <> 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; <<>> <> <<>> <> <> <> <<>> FinchState: TYPE = { unknown, running, stopped }; Procs: TYPE = REF ProcsRecord; ProcsRecord: TYPE = RECORD [ finchIsRunning: PROC RETURNS [isRunning: BOOL] ]; Register: PROC [finchSmartsProcs: Procs]; <> <<>> GetProcs: PROC RETURNS [Procs]; <> <<>> CurrentFinchState: PROC RETURNS [finchState: FinchState]; <> <<>> }. <<>> <> <> <> <> <> <> <> <> <> <> <<>> <> <> <> <> <> <<>> <> <> <> <<>>