# NWSClock
This program started out as a utility that announced the time every 15 minutes in the style of the Console Replacement system, which was formerly used by the National Weather service on NOAA Weather Radio. However, it has evolved into a rather customizable talking clock, mostly thanks to feedback I got during development.
## How to use the clock
Just run the program and configure it to your liking.
## Configuring the clock
This section will attempt to describe the various options in the configuration dialog.
* Startup Hidden: This starts the application in the system tray. Left-clicking the tray icon simply unhides the main window and brings it to the foreground, and right-clicking the icon brings up a menu with various options.
* Register Global Hotkeys: This registers some hotkeys that can be used from anywhere in Windows.
* 24 Hour Mode: Announces 24 hour time instead of 12 hour time.
* Coordinated Universal Time: Announces UTC time instead of local time.
* Bypass Time Marker: Skips announcement of AM or PM in 12 hour mode.
* Include time Zone: Includes the time zone in the local time announcement.
* Time Intro Message: The message that starts the time announcement. By default, this is "The current time is".
* Announcement Interval: This sets how often the time is announced throughout the hour. By default, this is 15 minutes.
* Announce Time on Startup: Announces the current time when the program starts.
* End Time announcement with Comma: Ends the time announcement with a comma. This is how the CRS time announcements were done.
* Announce Date: Appends the current date to the time announcement.
* Short Date Format: excludes the day of the week from the date announcement.
* Date Intro Message: The message that starts the date announcement. By default, this is "The current date is".
* Audio Device: This sets the audio device that the speech engine uses, and requires a speech engine restart in order to take effect.
* Own Audio Device: Keeps the audio device open even when nothing is being spoken. Again, this option requires a speech engine restart in order to take effect.
* Volume: Sets the audio volume. Note: on Windows XP and older, this sets the entire system volume.
* Speaker: The voice that is used for time announcements. By default, this is Paul.
* Speaking Rate: How fast the time announcements are spoken. By default, this is 180 words per minute.
* Reset Speech on Parameter Set: Resets the speech engine before applying new parameters. This is useful if you set a parameter that isn't accessible from the configuration in any custom messages, and you want to go back to the defaults.
* User Dictionary: Allows you to load a user dictionary into the speech engine.
* Greeting Message: A custom message that is spoken before the time announcement.
* Closing Message: A custom message that is spoken after the time announcement.
* Beep on Interval Reach: plays a generic sound when the announcement interval is reached.
* Enable Interruptability: When this option is enabled, the clock thread isn't blocked while speaking, which allows the speech to be interrupted. Note: alarms won't get interrupted when this is enabled.
* Alarm Enabled: Enables the alarm. When this option is enabled, the following options appear.
  * Alarm Hour: The hour the alarm is scheduled to go off.
  * Alarm Minute: The minute the alarm is scheduled to go off.
  * Alarm Second: The second the alarm is scheduled to go off.
  * Alarm File: Sets an audio file to play when the alarm time is reached.
  * Alarm Message: Sets a custom message that is spoken when the alarm time is reached. This message is spoken after any audio files have played.
* Quiet Mode: Allows automatic time announcements to be silenced for a set range of hours. When this option is enabled, the following options appear.
  * Quiet After Hour: The hour automatic announcements go silent.
  * Quiet Before Hour: The hour automatic announcements resume.

Note: to effectively make the clock on-demand, enable Quiet Mode and set Quiet Before Hour and Quiet After Hour to the same value, such as 0.
## Resetting the configuration
If you would like to go back to the default settings, simply press the delete key from the main window or select the "Reset Configuration" option from the Clock pull-down menu. This will also set the user interface back to it's default state.
## Setting the path of the configuration file
There is an option to set the path of the INI file that stores the clock settings. When a new path is set, a registry value is written to HKEY_CURRENT_USER\Software\Datajake\NWSClock, and deleted when the path is empty. There is also an option to store the configuration to the registry.
## General shortcuts
The following is a list of shortcuts that you can use when you are in the main window.
* Enter: Bring up the configuration dialog.
* Delete: Reset the configuration.
* Ctrl+S: Set the configuration file path.
* Space: Speak the current time.
* Escape: Minimize the window to the system tray.
* Backspace: Enable or disable painting the current time to the main window. When Announce Date is enabled, the date is painted as well.
* Backslash: Include seconds in the painted time.
* Ctrl+R: Restart the speech engine.

The following is a list of hotkeys that you can use from anywhere in Windows when Register Global Hotkeys is enabled.
* Alt+F7: Bring up the configuration dialog.
* Alt+F8: Bring up the about box.
* Alt+F11: Hide or show the main window.
* Alt+F12: Speak the current time.
* Ctrl+Alt+Shift+R: Speak the current contents of the clipboard.

## Command-line parameters
The following arguments can be added after the program name in any order.
* /c: Configure the clock before the main window is created.
* /h: Hide the main window on startup.
* /i: Set the INI path.

Note: /i takes effect before /c, so you can start the program with the options "/i /c" to set the INI path and configure the clock before the main program starts.

Have fun!