VoiceRopeDB.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Doug Terry, June 3, 1986 4:59:44 pm PDT
Routines for storing voice ropes in a database and manipulating their structure. This interface is internal to the voice rope package.
DIRECTORY
LoganBerry USING [Entry, ErrorCode, OpenDB],
RefID USING [nullID],
Rope USING [ROPE],
Thrush USING [Tune, VoiceInterval, EncryptionKey];
VoiceRopeDB: CEDAR DEFINITIONS = {
Handle: TYPE = REF HandleRec;
HandleRec: TYPE = RECORD [
voiceRopeDB: LoganBerry.OpenDB←RefID.nullID,
voiceInterestDB: LoganBerry.OpenDB←RefID.nullID,
voiceRopeDBName: Rope.ROPE,
voiceInterestDBName: Rope.ROPE
];
TuneList: TYPE = LoganBerry.Entry;
Header: TYPE = LoganBerry.Entry;
ID: TYPE = Rope.ROPE;
Database operations
Open: PROC [dbName: Rope.ROPE] RETURNS [handle: Handle ← NIL, openEc: LoganBerry.ErrorCode ← NIL, expl: Rope.ROPE];
Prepares the given database for service.
Read: PROC [handle: Handle, ropeID: ID] RETURNS [header: Header, length: INT, struct: TuneList];
Returns the structure of the given voice rope.
Write: PROC [handle: Handle, struct: TuneList] RETURNS [ropeID: ID, length: INT];
Writes the voice rope information into the database.
Voice rope structure
SimpleTuneList: PROC [tune: Thrush.Tune, interval: Thrush.VoiceInterval, key: Thrush.EncryptionKey] RETURNS [list: TuneList];
Builds a tune list with a single tune's information.
NextTuneOnList: PROC [list: TuneList] RETURNS [tune: Thrush.Tune, interval: Thrush.VoiceInterval, key: Thrush.EncryptionKey, rest: TuneList];
Returns information about the next tune on the list; assumes that list really points to a properly structured TuneList so doesn't bother to check attribute types. The rest of the list is returned so this routine can be repetitively called to get all the tunes on the list.
TuneListInterval: PROC [list: TuneList, interval: Thrush.VoiceInterval] RETURNS [new: TuneList];
Returns the tune list representing the structure of the voice rope interval. Warning: this operation modifies the original list!
}.
Doug Terry, June 3, 1986 3:30:54 pm PDT
Created internal DB interface.
changes to: DIRECTORY, VoiceRopeDB, OpenDB, ReadVoiceRope, WriteVoiceRope, SimpleTuneList, NextTuneOnList, TuneListInterval