FROM: Brian Neal 6/24/89 ============================ AlarmingClock ============================= WHAT: A simple clock program whoose alarm is, well, alarming! Best results are obtained by hooking up your stereo to your Amiga and cranking the volume! HOW: I GETTING STARTED From the Workbench: Click on the AlarmingClock directory drawer, then on the AlarmingClock icon. Or, From the CLI: Follow these steps: 1> cd dfx:AlarmingClock 1> run AlarmingClock II DESCRIPTION The upper display is the current system time, in 24 hour form. If this time is incorrect, set the correct time via Preferences or the CLI command "Date". The lower display, initially 00:00, is the alarm time. Each digit in the alarm display can be clicked on, and subsequently changed by then clicking on the arrow buttons that flank the display. Once you have found the desired alarm time, click on the ALARM button in the lower right corner to set the alarm. Click again to shut the alarm off. When the current time equals the alarm time, and the ALARM button is set, the alarm will sound repeatedly until you click on the ALARM button. The TEST button can be used at any time to hear the alarm. Use this to adjust the volume of your monitor (or preferably, your stereo!!). The close box in the upper left corner will terminate AlarmingClock. HOW IT WORKS: AlarmingClock needs two sound files, located in it's directory. Be sure the current directory is AlarmingClock when running from the CLI. If you use the Workbench, this is all taken care of for you. These sound files are loaded into memory, and all in all, AlarmingClock hogs up about 53K when running. AlarmingClock tries to grab a stereo pair of channels to use for the alarm. If you are running another application that is using audio, AlarmingClock may fail. It keeps the channels until you terminate it. Since AlarmingClock takes up so much memory for what it does, I decided to let it be light on the CPU. It wakes up every five seconds to display the time, and check to see if the alarm needs sounding. Thus it can only be off from the system's clock by five secs. max. If you change the time via "Date" or whatever, AlarmingClock will get around to updating itself within five seconds. My code for the clock is largely based on "mclk" by Mike Meyer, found on one of my Aztec C disks. Thanks Mike! The sound files are IFF, but are treated as raw data files. Oh well, maybe I'll write an IFF reader someday, or wait for the promised IFF.library. Probably wait. They were taken off of Glen Merriman's cool Missile game found on Fred Fish #50 (check it out!). As far as I know, they are also public domain. If not, I'm in big trouble!! This was compiled with Manx Aztec v3.6. I don't know if it will compile with any other compiler, but I assume it will... WHO: This was brought to you by Brian Neal. I hereby place this program in the public domain, for non-commercial use. It may be distributed in one of the following three forms: (i) The source code files, executable code, and this README file (ii) The executable code, and this README file. (iii) The source code files, and this README file. The source code files are AlarmingClock.c and isup.c. I have provided an icon to use, distribute it at your option, it makes running it easier. I owe a large debt to all those nice folks who placed their programs and source into the public domain. In that same friendly spirit, I hope others can learn from my trial and error approach at Amiga hacking. If you obtained this stuff in form (ii) above, and want the source code, send me a formatted disk and enough loose stamps for postage and I'll send it off to you. You can also send comments, questions, suggestions, etc., but don't blame me if you have a heart attack. The alarm still makes me jump! Brian Neal 2418 Cedar Heights Drive Cedar Falls, IA 50613 for (;;) { Amiga(); /* Long live the Amiga! */ }