AutoHotkey Community

It is currently May 27th, 2012, 9:40 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: SoundSleep
PostPosted: November 29th, 2004, 1:49 pm 
Offline

Joined: November 29th, 2004, 10:24 am
Posts: 10
How about getting a SoundSleep!
Well following script turns down your computer's volume over a specified period of time. After the specified period it just sends a stop signal to the media player or optionally you can also shutdown your computer.
Good for all those who have a habit of listening to music while retiring to bed.
Code:
#s::
InputBox, ss_SecToStop, SoundSleep, Please enter sleep time in minutes, , 150, 125
if ErrorLevel <> 0

   return
SoundGet, ss_OriginalVol
ss_SecToStop *= 60
Loop, %ss_SecToStop%
{
   Sleep, 1000
   SoundGet, ss_CurVol
   ss_VolStep = %ss_CurVol%
   ss_VolStep /= %ss_SecToStop%
   SoundSet, -%ss_VolStep%
   ss_SecToStop--
}
Send, {MEDIA_STOP}
;Some Media Players take time to stop
Sleep, 1000   
;Restore the original volume
SoundSet, %ss_OriginalVol%

;You can as well shutdown your computer
;Shutdown, 9 ;(Shutdown + Power down)

_________________
Sandeep


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 29th, 2004, 6:39 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
Cool script! Sometimes I do like to go to sleep listening to Bach.

Btw, welcome to the forum, Sandeep! :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 30th, 2004, 1:33 am 
Offline

Joined: November 29th, 2004, 10:24 am
Posts: 10
Thanks Buddy!

_________________
Sandeep


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 30th, 2004, 8:42 am 
Offline

Joined: July 22nd, 2004, 6:33 am
Posts: 193
Location: cedar city UT
nice script thanks for sharing :lol:

_________________
^sleepy^


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2009, 12:27 am 
Creative script!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2009, 12:29 am 
Offline

Joined: November 15th, 2009, 10:21 pm
Posts: 21
Location: London, UK
Creative script!

_________________
Image

http://www.autohotkey.net/~FirstToyLab/


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group