Subject: Quick redesign of Nuthatch => VoiceDB
To: (VoiceProject^)
Cc: swinehart
Introduction
Definitions
Previous Design: entries in Logs, organized through Cypress segment
Catalog
Catalog 8 March 20, 1984 4:06:29 pm PST  -- Example
swinehart.pa 8 March 20, 1984 4:06:29 pm PST
0 24000 0 31555424622B 11234154563B simple March 20, 1984 4:06:29 pm PST
Catalog <voiceFileID=<tune> <time>>\n<creator> <tune> <recordedTime>\n<samples> --Syntax <startingSample?> <refCt> <key1> <key2> <type=simple> <timeStamp>
MakeInterestEntry -- produce interest entry, with no retention, but associates ref uniqueid
Create 8 March 20, 1984 4:06:29 pm PST
swinehart.pa March 20, 1984 5:19:30 pm PST
GVID swinehart.pa $ 3#219@20 Mar 84 16:07:06 PST
Create <voiceFileID>\n<interestedParty> <timeStamp>\n<refType> <refUniqueID>>
AddInterest -- Interest entry now retains voiceFileID
AddUserRef swinehart.pa March 20, 1984 5:25:44 pm PST
GVID swinehart.pa $ 3#219@20 Mar 84 16:07:06 PST
AddUserRef <interestedParty> <timeStamp>\n<refType> <refUniqueID> -- VoiceFileID not known
AddRef 30 March 14, 1985 5:05:48 pm PST
Morley.Lark March 14, 1985 5:20:14 pm PST
SysNoises Rollback
AddRef <voiceFileID>\n<interestedParty> <timeStamp>\n<refType> <refUniqueID> -- vfid known
LoseInterest -- Interest entry no longer retains
LoseUserRef swinehart.pa March 20, 1984 5:27:26 pm PST
GVID swinehart.pa $ 3#219@20 Mar 84 16:07:57 PST
LoseUserRef <interestedParty> <timeStamp>\n<refType> <refUniqueID>
LoseRef <voiceFileID>\n<interestedParty> <timeStamp>\n<refType> <refUniqueID>
RemoveUserRef -- Eliminate all interest in VoiceFileID
RemoveUserRef swinehart.pa March 20, 1984 5:26:05 pm PST
GVID swinehart.pa $ 3#219@20 Mar 84 16:07:06 PST
RemoveUserRef <interestedParty> <timeStamp>\n<refType> <refUniqueID>
RemoveRef <voiceFileID> <interestedParty> <timeStamp>\n<refType> <refUniqueID>
The TunesDB
A Loganberry database with just one log.
Fields
vid: <voiceFileID> (primary index) -- <tune> <createTime>
cre: <rName> -- creator
sta: <startingSamples>
num: <samples>
key: <key1 key2>
The TuneRefDB
A single Loganberry database with one log. Entries are made in this log only when one wants to retain voiceFileID's (In Walnut, not when message is received but when it's moved into some other message set.)
Fields
rid: <refID> (primary index)
rtp: <refType> (secondary index, like GVID)
cre: <rName> (creator of reference)
vid: <voiceFileID> (secondary index)
There can be any number of these, corresponding to the number of separate utterances stored with the voice message.
tim: <timestamp> (of most recent addition of a vid)
Operations
Open: Function to open two databases and store the ID's. OK to do over and over, because of LoganBerry's indifference to that.
Create[tune, creator←me, interval, key, otherAttributes] -- yields TunesDB entry and returns voiceFileID. Stores otherAttributes along with the standard ones, if present.
Retain[voiceFileID, type, refID, creator←me, otherAttributes←NIL]
-- otherAttributes augments entry; must be supplied as a whole and will replace previous entry as a whole. (Not fully implemented. Retain can be called more than once with the same refID and different voiceFileID's. They will all be cited (no way to remove just one, for now.) otherAttributes will only be used the first time refID shows up.)
Forget[type, refID, voiceFileID]
Query[voiceFileID←NIL, type←NIL, refID←NIL, creator←me] =>
[tune, key, vEnt, rEnt]
Either voiceFileID or both type and refID must be non-NIL. vEnt is entire TuneDB entry, NIL if no joy; rEnt is corresponding TuneRefDB entry. Local part of this function implements parsing of resulting voiceFileID to get tune and conversaion of key.
If refID query, and there is more than one vid, tune and key comes from the first one.