PlayNoiseImpl.mesa
Last Edited by: Swinehart, December 17, 1985 10:32:10 am PST
DIRECTORY
Atom USING [ MakeAtom ],
Booting USING [ RegisterProcs, CheckpointProc ],
FinchSmarts USING [ PlayNoise ],
Process USING [ Detach, MsecToTicks, Pause ],
UserProfile USING [ Token ]
;
PlayNoiseImpl: CEDAR PROGRAM
IMPORTS
Atom, Booting, FinchSmarts, Process, UserProfile
= {
reallyBoot: BOOLTRUE;
didOurBest: BOOL;
maxTime: CARDINAL ← 4000;
PlayTheRollbackButton: Booting.CheckpointProc = TRUSTED {
PlayAButton[$rollback];
IF ~reallyBoot THEN rejection ← "Just pretending";
};
PlayAButton: PROC[name: ATOM] = TRUSTED {
didOurBest ← FALSE;
Process.Detach[FORK ReallyPlayAButton[name]];
FOR i: NAT IN [0..100) DO
Process.Pause[Process.MsecToTicks[maxTime/100]];
IF didOurBest THEN EXIT;
ENDLOOP;
};
ReallyPlayAButton: PROC[name: ATOM] = {
[]𡤏inchSmarts.PlayNoise[noiseName: name, wait: TRUE];
didOurBest ← TRUE;
};
IF Atom.MakeAtom[UserProfile.Token["Finch.NoisyBoot", "FALSE"]] = $TRUE THEN
Booting.RegisterProcs[c: PlayTheRollbackButton, r: NIL, b: PlayTheRollbackButton];
}.