VoicePlayBack.mesa
interface to replay sounds, plus all the guff to move a cue along a slab display
Ades, April 28, 1986 1:54:30 pm PDT
this is a separate module because playback requests to the voice file server can be queued up and hence where visual cues are employed these must also be properly queued. Events which complicate this are requests to play voice not in a slab [i.e. not wanting visual cues], requests to stop playback, and editing of a slab whilst it is being tracked. All these events MUST be handled by this module. That ought to include both finch and walnutvoice eventually - the correct procedures are provided by this interface to both play a complete rope and stop the playing of all ropes.
DIRECTORY
Rope USING [ROPE],
ViewerClasses USING [Viewer],
TiogaOpsDefs USING [Ref],
Menus USING [MenuProc];
VoicePlayBack: CEDAR DEFINITIONS = BEGIN
PlayBackMenuProc: Menus.MenuProc;
the routine behind the PlayVoice button for both text and voice viewers
PlaySlabSection: PROC [viewer: ViewerClasses.Viewer, node: TiogaOpsDefs.Ref, from, to: INT];
'node' is the voice-profile rope in the voice viewer 'viewer': play all the sound represented by characters 'from' through 'to' inclusive
PlayWholeSlab: PROC [viewer: ViewerClasses.Viewer];
PlayRopeWithoutCue: PROC [voiceID: Rope.ROPE];
given a tune which is not pictorially represented, just play it
PlayBackInProgress: PROC RETURNS [BOOLEAN];
tests whether the playback system is active: regard it as a hint and call the next procedure before starting to record
CancelPlayBack: PROC;
aborts any playback cues in progress and any playback requests queued up: DOESN'T call VoiceRope.Stop.
RemoveViewerReferences: PROC [viewer: ViewerClasses.Viewer] RETURNS [okay: BOOLEAN];
this procedure changes all queued visual playback entries for a viewer to non-visual ones, unless
the viewer is currently at the head of the cue queue as a visual entry, in which case it does nothing and returns false. Must be called before a viewer is destroyed: if ~okay then viewer must not be destroyed
RedrawViewer: PROC [viewer: ViewerClasses.Viewer, newContents: Rope.ROPE, unchangedHead, deleteChars, insertChars: INT, timeRemnant: INT, age: BOOLEAN, selectionsAfterRedraw: SelectionsAfterRedraw] RETURNS [newNode: TiogaOpsDefs.Ref];
called in order to redraw an edited voice viewer, which may or may not be in the queue of viewers in which cues are appearing or are about to appear: newContents is the result of the edit as is timeRemnant, and the three INT arguments refer to the display prior to the edit
all voice viewers will be 'aged' by this call [see VoiceAging for details] unless age=FALSE OR insertChars = 0
because the contents of the viewer are to be completely reset, any selections therein will be upset: how selections are to be affected must always be specified explicitly. The choices [only concerned with primary and secondary: feedback, should it be there, will always be destroyed] are
SelectionsAfterRedraw: TYPE = { unAltered, deSelected, primaryOnInsert };
END.