<> <> <> <> <<>> DIRECTORY BasicTime USING [GMT], Rope USING [ROPE], IO USING [STREAM], Jukebox USING [EnergyRange, RunArrayRange]; TuneArchive: CEDAR DEFINITIONS = BEGIN <<>> <> <<>> <> TuneInformation: TYPE = REF TuneInformationHeader; TuneInformationHeader: TYPE = RECORD [ jukeboxNameLength: NAT, -- the length in characters of the name of the jukebox from which this tune was archived tuneNumber: INT, -- the number of the tune, when it was archived createDate: BasicTime.GMT, writeDate: BasicTime.GMT, readDate: BasicTime.GMT, -- again applicable at the time of the archive: read date does not reflect when the archive was made archiveDate: BasicTime.GMT, sizeInChirps: INT ]; tuneInformationBytes: NAT = SIZE[TuneInformationHeader]*2; <> <<>> <<>> <> ChirpContents: TYPE = REF ChirpContentsRecord; ChirpContentsRecord: TYPE = RECORD [ ambientLevel: Jukebox.EnergyRange, runArrayLength: Jukebox.RunArrayRange, sampleBytes: NAT ]; chirpContentsBytes: NAT = SIZE[ChirpContentsRecord]*2; <> <<>> <> <<>> ArchiveTune: PROC [jukeboxName: Rope.ROPE, tuneID: INT, toFile: Rope.ROPE] RETURNS [tuneInformation: TuneInformation, internalJukeboxName: Rope.ROPE]; <> <> <> <<>> ReadArchiveHeader: PROC [readableFileStream: IO.STREAM] RETURNS [tuneInformation: TuneArchive.TuneInformation, archivedJukeboxName: Rope.ROPE]; <> <> <<(if you try it on a non-FS stream the possiblities for signals are endless. . .)>> <<>> PrintArchiveInfo: PROC [out: IO.STREAM, archiveFileName: Rope.ROPE, tuneInformation: TuneArchive.TuneInformation, archivedJukeboxName: Rope.ROPE]; <> <<>> RestoreTune: PROC [fromFile: Rope.ROPE, jukeboxName: Rope.ROPE _ NIL, tuneID: INT _ -1] RETURNS [tuneIDused: INT, restoredJukeboxName: Rope.ROPE]; <> <<>> END.