Clock
version  1.1

Dan Comiskey
comiskey@bu.edu (until 8/95)
cis 74547,3542

Clock is an alarm clock for the 3a.  It uses the full screen to display the time, and has an alarm that can be configured to ring once or daily, snoozed, selectable sound and volume, and will save its settings between launches if desired.
The installation is straightforward - put the Clock.opa file in any APP directory, and install on the system screen (or within an application launcher or shell).
Features: 

	Doesn't use the build-in ALM: driver!
	Will turn the Psion on and come to foreground when an alarm is due.
	Idles when in background, allows auto turn-off to occur.
	Will auto turn-off when in foreground (uses the time-out setting from system screen)
	Any Wve file may be used as alarm sound
	Plays any alarm sound for up to 45 seconds (regardless of how long sound is)
	Stops alarm playback after 45 seconds, repeats alarm every 5 minutes up to 4 times
	Saves prefs (if desired)
	Customizable snooze setting
	Easily turn off Psion - just hit the space bar
	Display shows if an alarm is pending
	Proper monitoring of system events, will quit if the system asks it to
		(even when in foreground, to keep rcom users happy)
	"Nifty" shadowed numerals
Its use is pretty straightforward. The clock runs continuously, if you set an alarm it will ring when next that time of day occurs (ie if it is 8am, an alarm set for 7am will ring the next day, whereas an alarm set for 10 am will ring later that same day). The space bar turns the psion off immediately. To snooze a ringing alarm, hit the space bar, any other key will silence the alarm. (The Psion will turn off when snoozed if so configured in the preferences.) The program is about 7k on disk, and uses 10k of memory for itself and the system uses 16k additional while it is running. (I've observed this to go to 26k while an alarm is sounding). These values are on my 512k 3a, which is the only machine this has been tested on.
This program is "cheap shareware" - if you use it, do something nice for some one that you wouldn't have done anyway. (Kind of pink and squishy sounding, I admit.) Personally I'm fed up with overpriced shareware for the Psion; IMHO, anyone charging more than 10-15$ for a program should have a very good reason why it's worth it, and the limited size of the potential market is not such a reason. I'd rather people use my work and enjoy it. 
Note: this program does not work if run on the PC Psion emulator. It panics when the call to the FRC: driver is made; I assume this driver must not exist in the emulator environment.
I've tried to make this program as complete as possible - the only other thing I thought of was multiple alarms. I've figured out how I would do that, but it would take a lot of work and time so I think it may not happen. (I'm a 4th year Medical student, so I'm not supposed to spend all my time writing code!) I also thought of rewriting the code to be asynchronous, as demonstrated in Appman (thanks Jezar), so the clock would continue to run while menus and dialogs were up, but I just don't understand the Window server well enough to tackle this (eagerly awaiting the release of the Wserver psionics file...) 
If you can think of any other functions that would be good, or just wish to give me feedback, please contact me.
The normal legal stuff applies - although I've done my best to make sure this program won't hurt you, use it at your own risk, there are no warrantees. I retain all rights to this program and the code, if you want the code email me and I'm likely to be agreeable (and it will be a lot more understandable than Revtran generated!). If you wish to put this on any media which you are selling for profit (CD or floppy) you must contact me for permission.
All of the functions are pretty self-evident, however for those who *like* to read these readme files...

MENU choices

	Set Alarm (psion-s)

Allows you to set an alarm. The default time and mode (once vs. daily) are stored in the prefs file if it exists, otherwise the defaults of 8:00 am and once are offered)

	Preferences (psion-p)

Allows you to create a preferences file that will be used for default settings. The default settings (without a prefs file) are:

	Default Alarm	Chimes
	Default Time		8:00 am
	Snooze Time		7 minutes
	Alarm Volume	Loud
	Daily Alarm		No
	Off on Snooze	Yes
	Prefs Disk		M (Internal)
Alarm - may be any sound in a WVE directory, or the three sounds in ROM (Chimes, Fanfare, Soft bells).
Time - any time
Snooze Time - from 5 to 15 minutes
Alarm Volume - Soft, Medium, Loud, Ouch!
Daily Alarm - Yes or No (note even if this is Yes, you still need to set the alarm after you load the program, it will NOT "turn on" the alarm without being told to)
Off on Snooze - turn the Psion off when an alarm is snoozed.
Prefs Disk - M, A, or B.  Note: this is the order the disks are searched for a prefs file at startup. If you change where this file is stored, only the first prefs file found will be used.  It is located in the OPD directory.

	Cancel Alarm (psion-c)

Cancels the pending alarm.  If the alarm is set to daily, it will prompt to cancel just the next alarm, or to turn off the daily alarms.

	About (psion-a)

Author and version.

	Exit

Exits the Program, cancels any outstanding alarm.

Credits: The numeral drawing routines were derived/modified from code posted in the Net by Juergen Weigert and Rudolf Koenig, called s7. (however I'd be inclined to give them more credit if they had chosen to comment this code!!)

History
1.1	Rewrote alarm notification dialog (so you can hit ANY key to silence the alarm - except the spacebar which is the snooze bar) plus added background graphics
	Changed alarm playing procedure to play alarm for 45 seconds (regardless of length of WVE file or repeats saved with it); also to stop alarm automatically and reset it up to 4 times if not silenced.
	Enabled detection of external power, and system settings to determine if autooff should occur when on external power.
	Checked for existence of SSD before scanning it for wve files or trying to write prefs file to it.
	General cleaning up of code.
1.0	Never released - I didn't want to inflict a version 1.0 on anyone!