ViewVoiceRope.mesa
Copyright Ó 1986, 1987 by Xerox Corporation. All rights reserved.
Last Edited by: Swinehart, January 31, 1987 2:24:57 pm PST
Doug Terry, July 1, 1986 9:56:00 am PDT
Solely for use with ViewRec.
DIRECTORY Rope
USING [
ROPE], VoiceRope;
ViewVoiceRope:
CEDAR
DEFINITIONS = {
Open:
PROC [
If voiceRopeDBName or localName is omitted, a default based on the user profile choice of Thrush Server is invented. If Complain is omitted, Log.Problem[...$Finch] is used. See VoiceDB for meaning of the names.
voiceRopeDBName: Rope.ROPE ← NIL,
localName: Rope.ROPE ← NIL
]
RETURNS[--handle: Handle--];
In all the routines that follow, if handle is omitted, one will be invented using all the defaults.
Creating and playing voice ropes
Record:
PROC[
--handle: Handle←NIL--]
RETURNS [voiceRope:
ID];
Records a tune, registers it in the VoiceDB, returns its ID.
NIL return value indicates that something went wrong.
Play:
PROC[
--handle: Handle←NIL,-- voiceRope:
ID, queueIt:
BOOL←
TRUE, failOK:
BOOL←
FALSE, wait:
BOOL←
FALSE];
Play a specified voice rope. The boolean arguments are interpreted as follows:
queueIt => play after all other record/playback requests are satisfied.
failOK => playing is optional; leave connection open if tune doesn't exist.
wait => wait until things appear to be started properly, or have failed.
Stop:
PROC[
--handle: Handle--];
Stops any recording or playback in progress.
Interests in voice ropes
Retain:
PROC [
--handle: Handle ← NIL,-- vr:
ID, class: Rope.
ROPE, refID: Rope.
ROPE, other: Rope.
ROPE ←
NIL];
Registers a new interest in the voice rope. The voice rope will be retained until either a corresponding Forget is done or the class' garbage collection process determines that the voice rope is no longer referenced, e.g. refID no longer exists. Taken together, the vr, class, and refID must be unique. Repeated calls of Retain with the same parameters (ignoring other) will only register a single interest.
Forget:
PROC [
--handle: Handle ← NIL,-- vr:
ID, class: Rope.
ROPE, refID: Rope.
ROPE];
The specified refID of the specified class drops its interest in the voice rope. The voice rope is not necessarily deleted, however, since other interests in the same voice rope may exist.
GetByInterest:
PROC [
--handle: Handle ← NIL,-- class: Rope.
ROPE, refID: Rope.
ROPE]
RETURNS [voiceRope:
ID];
Returns any voice rope that is of interest to the given class and refID; returns NIL if no such voice rope exists.
N.B.: System noises, like Beeps and intolerably cute rollback tunes are indexed in the interest database as refID's like "beep", "rollback", and so on, under the class "SysNoises".
Editing voice ropes
Cat: PROC [--handle: Handle,-- vr1, vr2, vr3, vr4, vr5: ID ← NIL] RETURNS [new: ID];
Substr: PROC [--handle: Handle,-- vr: ID, start: INT ← 0, len: INT ← LAST[INT]] RETURNS [new: ID];
Replace: PROC [--handle: Handle,-- vr: ID, start: INT ← 0, len: INT ← LAST[INT], with: ID ← NIL] RETURNS [new: ID];
Length: PROC [--handle: Handle,-- vr: ID] RETURNS [len: INT];
Information about voice ropes
DescribeRope: PROC [--handle: Handle,-- vr: ID, minSilence: INT ← -1] RETURNS [noise: VoiceRope.IntervalSpecs];
Fetch: PROC [--handle: Handle,-- vr: ID, index: INT] RETURNS [VoiceSample];
}.
Swinehart, January 30, 1986 9:34:42 am PST
Created from WalnutVoiceImpl routines; voice message facilities, without Walnut specifics
Doug Terry, March 22, 1986 1:32:03 pm PST
Changed recording and playback routines to deal in voice ropes instead of tunes; upgraded interest management; added facilities for editing voice ropes.
Doug Terry, March 22, 1986 3:59:22 pm PST
changes to: VoiceRope, Record, Play, Retain, Forget, Cat, Substr, Replace, Length
Doug Terry, April 1, 1986 4:16:01 pm PST
changes to: ViewVoiceRope, Record, Play, Stop, Retain, Forget, Cat, Substr, Replace, Length
Doug Terry, April 9, 1986 8:53:37 pm PST
changes to: DescribeRope, DIRECTORY
Doug Terry, June 16, 1986 11:36:27 am PDT
changes to: ViewVoiceRope, Record, Play, Stop, Retain, Forget, GetByInterest, Cat, Substr, Replace, Length
Doug Terry, July 1, 1986 9:56:00 am PDT
changes to: ViewVoiceRope