April 8, 1987 11:42:48 am PDTVoiceViewers
VoiceViewerInfo: TYPE = REF VoiceViewerInfoRec;
VoiceViewerInfoRec:
TYPE =
RECORD [
-- the data structure underpinning all voice viewers
viewer: ViewerClasses.Viewer,
viewerNumber: INT,
ropeInterval: VoiceRopeInterval, -- the rope interval represented by the viewer
soundList: SoundList, -- a list of the sound/silence intervals in that rope interval
remnant: INT, -- the display shows the rope interval using characters representing a fixed amount of time: this is samplesInRope MOD lengthOfACharacterInSamples
charMarkList: LIST OF INT ← NIL, -- an ordered list of the characters which have character marks on them
textMarkList: LIST OF TextMarkEntry ← NIL, -- see below: list is again ordered
ageList: LIST OF IntPair ← NIL, -- see below: each age lasts until the next element in the list, otherwise until the end of the viewer
color: BOOLEAN ← FALSE, -- is the viewer currently on the color display?
edited: BOOLEAN ← FALSE, -- the true indication whether the voice has been edited: at times may not agree with the viewer's 'edited' flags
editInProgress: BOOLEAN ← TRUE, -- set if an initiated edit has yet to complete: this includes all cut/paste operations; input to the viewer; alteration of markers and redrawing operations, since none of these is allowed to occur simultaneously in this implementation. It is created TRUE and only set FALSE once the viewer's contents are valid
destroyEvent: ViewerEvents.EventRegistration,
changeColumnEvent: ViewerEvents.EventRegistration,
parentViewer: ViewerClasses.Viewer ← NIL, -- trace of where the SourceMarker for the viewer is, NIL if no parent
positionInParent: TiogaOpsDefs.Location, -- ditto: invalid if parentViewer = NIL
nextInfoRec: VoiceViewerInfo ← NIL
Textual markers are held as a list of the following elements as part of the VoiceViewerInfo; see VoiceMarkersImpl and TextInVoiceImpl for more details
TextMarkEntry: TYPE = REF TextMarkRec;
TextMarkRec:
TYPE =
RECORD [
position: INT, -- the number of the character to which the text is attached
text: Rope.ROPE, -- the text itself
displayChars: INT, -- how much of the text can be displayed [without running into the next TextMarkEntry], in characters
width: INT -- how much space this display will take, measured in voice character widths
aging markers in VoiceViewerInfo are held as a list the following records
IntPair:
TYPE =
RECORD [
position: INT,
age: INT
These constants define how a voice rope maps onto a graphical representation (in fact a rope of characters in special font, collectively producing the capillary display.)
soundRopeCharsPerSecond: NAT = 4;
soundRopeCharLength:
NAT = Jukebox.bytesPerChirp/soundRopeCharsPerSecond;
Jukebox.BytesPerChirp is the measure of voice samples per second
soundRopeCharDivisions: NAT = 4; -- number of stripes per character;
soundRopeResolution:
NAT = soundRopeCharLength/soundRopeCharDivisions;
voiceViewerMenu: Menus.Menu;
The menu for all voice viewers
voiceViewerInfoList: VoiceViewerInfo;
The list of all currently existing voice edit windows.
Data structures used in editing voice.
VoiceRopeInterval:
TYPE = VoiceRope.VoiceRopeInterval;
RECORD [ropeID: Rope.ROPE, start: INT, length: INT]
Selection: TYPE = REF SelectionRec;
SelectionRec:
TYPE =
RECORD [
Specification of where to insert voice into a slab: if ropeInterval.length # nil then selection is to be deleted first.
viewer: ViewerClasses.Viewer,
voiceViewerInfo: VoiceViewerInfo,
ropeInterval: VoiceRopeInterval,
displayNode: TiogaOpsDefs.Ref
];
The purpose of the next data object is to keep track of voice which is to be moved to some part of some slab—both a VoiceRopeInterval and a cache of the SoundList, charMarkList and textMarkList which correspond to it.
SoundInterval: TYPE = REF SoundIntervalRec;
SoundIntervalRec:
TYPE =
RECORD [
ropeInterval: VoiceRopeInterval,
soundList: SoundList ← NIL,
charMarkList: LIST OF INT ← NIL,
textMarkList: LIST OF TextMarkEntry ← NIL
];
SoundList: TYPE = LIST OF Sound;
Sound:
TYPE =
RECORD [
silence: INT, -- a Sound element simply consists of a length of silence
sound: INT -- Followed by a length of sound - either may legally be zero
];
VoiceMarkers
Constants describing the size of characters used in the voiceProfile/voicePlay fonts
These probably should be extracted from font 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;
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