VoiceInText.mesa:
interface to the routines which integrate voice into normal tioga documents
 Ades, April 23, 1986 8:36:06 pm PST
DIRECTORY
VoiceViewers USING [VoiceViewerInfo],
VoiceRope USING [Handle],
Rope USING [ROPE],
MBQueue USING [Queue],
Menus USING [MenuProc, MenuEntry],
TiogaOpsDefs USING [Location],
ViewerClasses USING [Viewer];
VoiceInText: CEDAR DEFINITIONS = BEGIN
thrushHandle: VoiceRope.Handle;
voiceButtonQueue: MBQueue.Queue;
DebugRope: PROC [Rope.ROPE];
ChangeMenu: PROC [viewer: ViewerClasses.Viewer, subMenu: Menus.MenuEntry];
this procedure clauses the given submenu to toggle in and out of view for the given viewer.
I lifted this code from TEditDocumentsImpl in Tioga - it really ought to be available to the public somewhere. Also it is bound into the Tioga idea that there are three possible sub-menus for any given viewer - "places", "levels" and one other supplied by the user. Using this code for viewers other than tioga viewers [as DictationOps does] is rather squalid
ApplyToCharsInPrimarySelection: PROC [ActionProc: PROC [TiogaOpsDefs.Location]];
a generally useful procedure: applies ActionProc to every character in the primary selection, locking the selection first
ApplyToLockedChars: PROC [ActionProc: PROC [TiogaOpsDefs.Location]];
as above but used where the selection is already locked
StoreVoiceAtSelection: PROC [voiceViewerInfo: VoiceViewers.VoiceViewerInfo] RETURNS [succeeded: BOOLEAN];
place the supplied voice at the selection and make a source marker there
PlaySelection: PROC;
find any voice within the current selection and play it back [if more than one talks bubble, from left to right]
CancelProc: Menus.MenuProc;
an appropriate procedure to put behind any STOP buttons for recording/playback of voice
DeleteVoiceFromChar: PROC [position: TiogaOpsDefs.Location];
DeleteSourceMarker: PROC [viewer: ViewerClasses.Viewer, positionInParent: TiogaOpsDefs.Location, voiceViewerNumber: INT];
the specified viewer contains a source marker for the given voiceViewerNumber at the specified position: delete it
SaveRopeAtSourceMarker: PROC [viewer: ViewerClasses.Viewer, positionInParent: TiogaOpsDefs.Location, voiceViewerNumber: INT, voiceRopeID: Rope.ROPE, textInVoice: Rope.ROPE] RETURNS [succeeded: BOOLEAN];
try to save the contents of the voice viewer voiceViewerNumber [specified as the voiceRopeID] at the given viewer/node location: will fail if the viewer/node are not a valid combination or if the given location does not bear a source marker
END.