VoiceMarkers.mesa
module to handle markers in voice, of two types
i) a special character which the user can place at a selection and remove using button-pushes
ii) annotation of voice with text
Ades, April 30, 1986 10:09:54 am PDT
Swinehart, March 23, 1987 2:35:22 pm PST
DIRECTORY
ImagerFont USING [Font],
Menus USING [MenuProc],
TiogaOpsDefs USING [Ref],
ViewerClasses USING [Viewer],
VoiceViewers USING [VoiceViewerInfo, SoundInterval, TextMarkEntry],
Rope USING [ROPE];
VoiceMarkers: CEDAR DEFINITIONS = BEGIN
---- constants describing the size of characters used in the voiceProfile/voicePlay fonts
these probably should be picked up from the fonts parameters. Note that when there is artwork on any part of a line, selections on that line will be as tall as the artwork [see TextInVoiceImpl for how the ascent of the artwork is set]. If there is no artwork on that line we still want the selections to be 'tall', so the two voice fonts each contain one character ['?] which has an ascent of 24.0 - the same as the artwork. This causes all selections to be 'tall'.
See also comments in TextInVoiceImpl about the interaction of artworks and VoiceProfile.Style
voiceCharWidth: REAL = 8.0;
voiceCharAscent: REAL = 9.0;
voiceCharDescent: REAL = 1.0;
voiceCharHeight: REAL = voiceCharAscent + voiceCharDescent;
---- routines to do with character markers
AddCharMark: Menus.MenuProc;
DeleteCharMarks: Menus.MenuProc;
LockedAddCharMark: PROC [viewer: ViewerClasses.Viewer, position: INT];
DisplayCharMarks: PROC [unMarkedRope: Rope.ROPE, charMarkList: LIST OF INT, skipChars: INT]
RETURNS [Rope.ROPE];
this gets called by SoundList.SoundChars, which has been called to build the viewer contents corresponding to some soundlist, the first skipChars omitted: takes that rope and replaces normal characters with marker characters as appropriate
ExtractCharMarks: PUBLIC PROC [viewerInfo: VoiceViewers.VoiceViewerInfo, soundInterval: VoiceViewers.SoundInterval];
return as selection.charMarkList a copy [n.b.] of the section of the character mark list in viewerInfo falling in to the region of selection.ropeInterval
EditCharMarks: PROC [viewerInfo: VoiceViewers.VoiceViewerInfo, unchangedHead, deleteChars, insertChars: INT, soundInterval: VoiceViewers.SoundInterval];
this gets called when an edit is made to the contents of the viewer: it keeps the charMarkList in step with the edit

---- routines to do with textual markers
voiceMarkerFont: ImagerFont.Font; -- the font used to display the text
voiceCharSet: BYTE = 0; -- since at times a 16-bit Xerox character code is called for
TextInput: PROC [viewer: ViewerClasses.Viewer, input: Rope.ROPE];
all printable characters typed in to a voice viewer cause this procedure to be called
BackSpace: PROC [viewer: ViewerClasses.Viewer];
similarly BackSpacing gets this one called
BackWord: PROC [viewer: ViewerClasses.Viewer];
yes - you're getting the pattern . .
RedrawTextMarkers: PROC [viewer: ViewerClasses.Viewer, voiceCharNode: TiogaOpsDefs.Ref];
called by voicePlayBack's redraw procedure [under voiceLock] to place all the textual markers back into a voice viewer
ExtractTextMarks: PUBLIC PROC [viewerInfo: VoiceViewers.VoiceViewerInfo, soundInterval: VoiceViewers.SoundInterval];
return as selection.textMarkList a copy [n.b.] of the section of the textual mark list in viewerInfo falling in to the region of selection.ropeInterval
EditTextMarks: PROC [viewerInfo: VoiceViewers.VoiceViewerInfo, unchangedHead, deleteChars, insertChars: INT, soundInterval: VoiceViewers.SoundInterval];
this gets called when an edit is made to the contents of the viewer: it keeps the textMarkList in step with the edit
RopeFromTextList: PROC [LIST OF VoiceViewers.TextMarkEntry] RETURNS [Rope.ROPE];
convert the list of text markers in a voice viewer into a rope suitable for saving in a textual document at the position of a talks bubble
TextListFromRope: PROC [Rope.ROPE] RETURNS [LIST OF VoiceViewers.TextMarkEntry];
and go the other way
END.