-- File: WalnutVoiceImpl.mesa -- Contents: operations for dealing with voice in Walnut messages -- created September 26, 1983 by Willie-Sue -- Last edit by: -- Willie-Sue on: September 29, 1983 3:42 pm -- Strictly a dummy version DIRECTORY -- Nuthatch USING [NuthatchUserHandle, MakeInterestEntry, RemoveInterestEntry], Rope, -- Runtime USING [IsBound], ViewerClasses USING [Viewer], -- ViewerOps USING [AddProp], -- Walnuthatch USING [MoveTo, InitializeWalnuthatch], -- WalnutSendInternal USING [userRName], WalnutVoice; WalnutVoiceImpl: CEDAR PROGRAM -- IMPORTS -- Nuthatch, Runtime, ViewerOps, Walnuthatch, WalnutSendInternal EXPORTS WalnutVoice = BEGIN ROPE: TYPE = Rope.ROPE; Viewer: TYPE = ViewerClasses.Viewer; -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -- nuthatchHandle: Nuthatch.NuthatchUserHandle_ NIL; -- nuthatchTries: INTEGER_ 0; CheckForWalnuthatch: PUBLIC PROC RETURNS[ra: REF ANY] = -- checks if the Nuthatch stuff is loaded and started; if loaded but there is no nuthatchUserHandle, then the initialization proc is called -- returns NIL if no Nuthatch or the initialization returned NIL BEGIN -- success: BOOL; -- IF nuthatchHandle # NIL THEN RETURN[nuthatchHandle]; -- TRUSTED {IF ~Runtime.IsBound[Walnuthatch.InitializeWalnuthatch] THEN RETURN[NIL]}; -- IF nuthatchTries > 5 THEN RETURN[NIL]; -- [success, nuthatchHandle]_ -- Walnuthatch.InitializeWalnuthatch[WalnutSendInternal.userRName ! -- ABORTED => CONTINUE]; -- IF ~success THEN nuthatchTries_ nuthatchTries + 1; -- RETURN[nuthatchHandle]; RETURN[NIL]; END; -- InternalCheck: PROC RETURNS[Nuthatch.NuthatchUserHandle] = -- checks if the Nuthatch stuff is loaded and started; if loaded but there is no nuthatchUserHandle, then the initialization proc is called -- returns NIL if no Nuthatch or the initialization returned NIL -- BEGIN -- success: BOOL_ FALSE; -- IF nuthatchHandle # NIL THEN RETURN[nuthatchHandle]; -- TRUSTED {IF ~Runtime.IsBound[Walnuthatch.InitializeWalnuthatch] THEN RETURN[NIL]}; -- DO -- IF nuthatchTries > 5 THEN RETURN[NIL]; -- [success, nuthatchHandle]_ -- Walnuthatch.InitializeWalnuthatch[WalnutSendInternal.userRName ! -- ABORTED => CONTINUE]; -- IF success THEN RETURN[nuthatchHandle]; -- nuthatchTries_ nuthatchTries + 1; -- ENDLOOP; -- END; AddNuthatchHandleToViewer: PUBLIC PROC[v: Viewer] = BEGIN -- nuh: Nuthatch.NuthatchUserHandle_ InternalCheck[]; -- IF nuh # NIL THEN ViewerOps.AddProp[v, $NuthatchHandle, nuh]; END; MakeInterestEntry: PUBLIC PROC[voiceID, gvID: ROPE] = BEGIN -- nuh: Nuthatch.NuthatchUserHandle_ InternalCheck[]; -- IF nuh # NIL THEN -- Nuthatch.MakeInterestEntry[nuh, voiceID, gvID ! ABORTED => CONTINUE] END; VoiceMoveTo: PUBLIC PROC[msgSetName, msgName: ROPE] = BEGIN -- nuh: Nuthatch.NuthatchUserHandle_ InternalCheck[]; -- IF nuh # NIL THEN -- Walnuthatch.MoveTo[msgSetName, nuh, msgName ! ABORTED => CONTINUE]; END; RemoveInterestEntry: PUBLIC PROC[voiceID, gvID: ROPE] = BEGIN -- nuh: Nuthatch.NuthatchUserHandle_ InternalCheck[]; -- IF nuh # NIL THEN -- Nuthatch.RemoveInterestEntry[nuh, voiceID, gvID ! ABORTED => CONTINUE]; END; -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * END. Ę˜JšõĪc`œ=œ.œœĪk œžœSžœžœžœžœ9žœ Īnœž œžœGžœžœžœžœžœ žœžRœ1žœžœŸœž œžœžœžœĪœžœ žœžœžœžœžœžœžœ5žœžœžœžœžœžœžœnžœžœžœ žœ&žœžœžœžœŸ œĐjkœžœ Īœžœž œžœžœžœžœžœžœ5žœžœžœžœžœžœžœžœsžœžœ žœ žœžœ?žœžœŸœžœžœžœ<žœžœžœ/žœŸœžœžœžœžœ<žœžœžœ6žœžœžœŸ œžœžœžœžœ<žœžœžœ4žœžœžœŸœžœžœžœžœ<žœžœžœ8žœžœžœRœžœ˜ô—…— ö