Favourite Photos
electronicholas.com

Photos, Thoughts and Software from a worldly Entrepreneur

Application

Documentation
(1) Start/Cancel Fade.

(2) Set/Stop/Cancel Alarm.

(3) Show/Hide Settings.

(4) Snooze Alarm.

(5) Show Preferences.

(6) iTunes Volume indicator (can be used to control volume while iTuneSleep is not fading up/down).

(7) Alarm/Fade information display.

(8) Fade Status: Red bar indicates waiting to fade, Green bar indicates fading. Time on the right indicates time remaining until fade starts while bar is red, and time until fade ends while bar is green. Time on the left indicates elapsed time.

(9) Fade Settings (shown).

(10) Alarm Settings (hidden).

Fade Settings

If you select 'Currently selected Track' or 'Chosen Track' to fade with, you can change the track or volume as you wish before the fade begin. As you approach the time for fade to begin, iTuneSleep will fade that track down. You can select a new track or volume level as often as you want, iTuneSleep will only fade down the volume during the fade part.

If you select 'Chosen Playlist', iTuneSleep will fade out the last part of the total time of the entire playlist which will depend on the fade ratio, and as you advance through the tracks it will fade by respective amounts. Ticking "Shuffle Playlist" will turn on Shuffle for that playlist and start with a random track from it, otherwise Shuffle will be turned off.

If you select 'Chosen Radio', iTuneSleep will fade your chosen iTunes Radio Stream out for the last part of that time which will depend on the fade ratio. iTuneSleep will look for Radio Streams found in any of your playlists or in your main library.

If you select 'x Next Tracks' iTuneSleep will again fade out the last part of the total time of the number of tracks you select which will depend on the fade ratio. iTuneSleep will not change the current playlist so the 'Next tracks' refer to the next tracks of the current playlist. 'x Random Tracks' will do the same except it will choose that number of tracks randomly from your main library.

If you select 'x Minutes' iTuneSleep will simply fade out for the last part of that time which will depend on the fade ratio, regardless of any track changes you make in iTunes during the fade.

Sleep or Shut Down
If you choose sleep or shut down then the computer will go to sleep or shut down after the music has faded out.

Alarm Settings

If you select 'Currently selected Track' then iTuneSleep will simply press 'Play' in iTunes when the Alarm goes off, which will play the selected track if there is one, or the first track of the selected playlist is there isn't.

If you select 'Chosen track' you will be asked to choose a track in your iTunes library by name. iTuneSleep will then wake you up by fading in this track gradually.

If you select 'Chosen Playlist' then you will be asked to choose a Playlist in your iTunes library. iTuneSleep will then wake you up by fading in that playlist in gradually starting with the first track in that playlist. Ticking "Shuffle Playlist" will turn on Shuffle for that playlist and start with a random track from it, otherwise Shuffle will be turned off.

If you select 'Chosen Radio then you will be asked to choose a Radio Stream in your iTunes library. iTuneSleep will then wake you up by fading in that Radio Stream in gradually. iTuneSleep will look for Radio Streams found in any of your playlists or in your main library.

If you select 'Random track' then iTuneSleep will wake you up by fading in with a random track for your iTunes library. If you wish you can select the rating of the random track. (For example, if you choose '****" then the random track will be one of the '****' rated tracks in your library.

Alarm Time
You can choose to have the alarm go off at the time you set, or after a number of hours you set (by choosing After X time).

Once Only
The alarm will go off once at the time (or after X time as detailed above) and not set itself to go off again.

Use iCal
The alarm will go off before your next iCal event of a chosen calendar, or before the first event of each day as specified in the preferences. iTuneSleep will ignore repeating events. This is due to an Apple bug in iCal's applescript library, however look for repeating event support in future versions.

On Days
The alarm will go off at the time you set on the days you set unless it it cancelled.

(Please note that if iTuneSleep has to start up your computer before an alarm, you user account must be set to log in automatically to enable the Alarm to work... )

Stop Alarm

When the alarm is going off the Set/Cancel Alarm buttons show a '--»|' symbol. Pressing this button will stop the alarm, and if it was set to only go off once it will be unset, otherwise the next alarm time will be set.

Snooze Alarm

Selecting 'Snooze Alarm' when the alarm is set will give you the option of delaying it. If you do this while it is fading up during an alarm, iTunes will pause. You can delay the alarm by the set times or by a custom time. Alternatively you can choose a new time for the alarm to go off. If the Alarm type is 'iCal', then you can choose to 're-acquire' the next iCal event by pressing 'Get next iCal Alarm Time'.

Preferences

Documentation
Note: Preferences will not take effect until next time iTuneSleep fade/alarm is set.

General

Check for new versions of iTuneSleep
Choose whether or not to have iTuneSleep check for new versions online when your computer is started up.

Fade

Open before/after Fade
Choose any file or Application to open before or after the Fade takes place.

Fade Ratio
The fade ratio sets sets when the smooth sine wave fade should start. For example, choosing 20/80 for the fade ratio as shown above and setting iTuneSleep to fade with 20 minutes of music will result in iTuneSleep keeping the iTunes volume the same for 4 minutes, then fade out for the remaining 16 minutes. Note that iTuneSleep calculates the fade volume based on how far through the track or collection of tracks iTunes is, not on a timer. Skipping to the end of the track will reduce the volume to zero and complete the fade. This allows more flexibility - for example if you fade with one track and then skip to the next track iTuneSleep will treat the new track as the track to fade to, rather than a time based on the length of the old one.

Dim Display after 1 min
Turns off your displays after 1 min of activity. Returns your settings to normal when finished/cancelled. Prevents you getting dazzled as you listen to faded music.

Mute Mac Volume
Mutes the system volume after the fade. Also stops startup chime waking you up if you have shut your mac down overnight and have an alarm set. Note: system volume is automatically unmuted during an alarm or fade.

Alarm

Open before/after Alarm
Choose any file or Application to open before or after the Alarm takes place.

Open iTuneSleep Application before Alarm
Opens iTuneSleep before each alarm (allows you to use 'snooze' easily, or to stop the alarm).

Maximum iTunes Volume for Alarm
iTunes volume fades up smoothly from nothing to this preset iTunes volume during alarm.

System (Mac) Volume for Alarm
iTuneSleep sets your main system volume to this preset level before starting the alarm.

Test
Test the volumes you have set to allow you to gauge what the maximum volume will be after iTuneSleep has finished fading up.

Time taken to fade up during Alarm
iTunes fades from 0 to the set volume taking this long to do so. Can set a value between 10 seconds and 10 minutes.

Raise iTunes Volume if Alarm is stopped
If you an alarm in progress, this option allows you to choose whether or not to have iTuneSleep quickly fade up to your set alarm iTunes volume.

Automatically pause iTunes if Alarm is stoped
If you an alarm in progress, this option allows you to choose whether or not to have iTuneSleep pause iTunes.

To add a delay (in seconds) between the time your computer is woken or started up and when the alarm goes off, simply add a new preference into the iTunesleep preferences (found in ~/Library/Preferences/com.electronicholas.itunesleep.plist) and call it 'alarm_delay', giving it a value in seconds you wish to delay the alarm

iCal

Log completed Fade and Alarm events in iCal
Creates a calendar in iCal (if it doesnt already exist) called 'iTuneSleep Log' which is then updated with logs of successful alarms, fades, and alarm cancellations.

iCal Alarms go off [ ] minutes before...
Choose how long before your iCal event the iTuneSleep alarm will go off.

Every event of Calendar [ ] or First event of the day
Choose a calendar whose events iTuneSleep will use to set the alarm times, or have iTuneSleep set the alarm to go off before the first event of any calendar on each day.

Click here to leave a comment.

Salling Clicker Remote Control

Documentation
&tWhen you launch the iTuneSleep Remote from your Phone or PDA the status of iTuneSleep is displayed. To set or cancel a Fade or Alarm press '*' or 'more'.

If you have set the alarm you can press '0' at any time to snooze (delay) the alarm or set it to a new time. You can even do this while the alarm is going off and iTunes is fading up...

Press '#' at any time for iTuneSleep Remote Help.

You can also change the system volume on your computer by using the 'up' and 'down' toggle keys, and skip to the next or go back to the previous iTunes track using the 'left' and 'right' toggle keys. Pressing the 'ok' or 'select' button will pause or play iTunes.

'More' Menu

Press 'more' or '*' to bring up this menu.

Start/Cancel Fade
Please see the 'Fade Settings' section of the application help to learn about the alarm options. If you select 'Last Fade Settings' iTuneSleep will use the last fade settings which were set. (Please note: if you use last fade settings, iTuneSleep will also remember whether you chose to sleep or shut down your computer)

Set Alarm
Please see the 'Alarm Settings' section of the application help to learn about the alarm options. If you select 'Last Alarm Settings' iTuneSleep will use the last alarm settings which were set and allow you to set a new time. This menu item becomes 'Change Alarm' when an alarm is successfully set.

Change Alarm
This appears instead of 'Set Alarm' when there is an alarm set. Please see below for the 'Change Alarm' options.

View Alarm Setting
View the current setting of the alarm.

Sleep Mac Now
Sleep your Mac immediately.

Change Alarm

Stop/Cancel Alarm
Selecting 'Stop Alarm' will stop an Alarm currently going off. Selecting 'Cancel Alarm' will cancel the alarm which is set.

Delay ... mins
Please see the 'Snooze Alarm' section of the application help for details.

Change Alarm Time...
Please see the 'Snooze Alarm' section of the application help for details.

Set for Specific Days...
Select this to set the alarm to repeat on specific days. List the days you wish it to go off: 1 = Sunday, 2 = Monday etc. Please see the 'Alarm Settings' section of the application help for more information.

Click here to leave a comment.

AppleScript Functionality

Documentation

Find below details of functions which can be called to perform actions such as setting the alarm and starting a fade. You should call the iTuneSleep Daemon when using these functions: tell application "iTuneSleep Daemon".

get_daemon_status()
This returns the status of the iTuneSlee daemon: 'fade_idle' when waiting to fade down, 'fade_active' when fading down, 'alarm_active' when the alarm is fading up, and 'idle' at all other times.

start_fade()
This starts the fade down based on the settings stored in the preferences.

cancel_fade()
Cancels an active fade down.

change_alarm(arg1,arg2,arg3)
Changes or cancels an alarm setting. 'arg1' is either boolean true (set alarm) or false (cancel alarm). If you cancel the alarm it will be unset. If you cancel the alarm while it is active (fading up), iTunes will also be paused. 'arg2' and 'arg3' are irrelavent when setting 'arg1' to false.

'arg2' is the time you wish to set the alarm for when choosing 'arg1' = 'true'. This MUST be formatted as the time string of a date (set arg2 to time string of date "Monday, April 17, 2006 09:12:40"). This will be of the form: "09:13:22".

'ar3' specifys if you wish the alarm to go off only once, or on certain days, or using ical. The syntax is as follows. To set it once, set ar3 to "once___". To set it for certain days, insert the numbers of the days you wish it to go off, and pad the rest with "_", for example setting it for wednesdays and thursdays is "45_____". (Sunday = 1, Monday = 2 etc). To set it for use with iCal, set arg3 to "ical___".

start_alarm()
Will start the alarm (fade up) immediately based on the settings stored in the preferences.

Click here to leave a comment.
post on facebook - Del.icio.us - Digg - reddit