AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Simple volume replacement

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Tasman



Joined: 20 May 2006
Posts: 21

PostPosted: Sat May 20, 2006 8:37 pm    Post subject: Simple volume replacement Reply with quote

As most of my apps, a simple replacement for the standard volume control normally found in the system tray.
Certainly not an improvement to some of the more elaborate alternatives found in this forum, but then again much smaller.
Mainly meant for use with alternative shells that do not provide this functionality.
In order to simulate the "ding" sound used to check the volume by ear, you will have to place a .wav in the script's directory.
I used the "ding.wav" from win98 for this.
Searching your drive for *.wav will usually provide ample alternatives.

Code:

sound = ding.wav
GoSub, DoVolume
return

DoVolume:
   SoundGet, MySlider
   SoundGet, _mute, , mute
   if _mute = On
      _mute = 1
   else _mute = 0
   Gui, -MinimizeBox
   Gui, Add, Slider,h100 w40 vMySlider gDisplayCount AltSubmit Vertical Invert TickInterval20 Center, % MySlider ;%
   Gui, Add, Checkbox, v_Mute gMute Checked%_mute%, Mute
   Gui, Add, Button, gVolumeApp, Master
   Gui, Show, , Volume ,
return
DisplayCount: ; onchange set the volume and play a ding
   Gui, Submit, Nohide
   SoundSet, %MySlider%
   if A_GuiControlEvent <> Normal
      return
   SoundPlay, %sound%
return
Mute: ; set to mute or non-mute
   Gui, Submit, Nohide
   SoundSet, _Mute, , MUTE
return
VolumeApp: ; display the volume master control
   run, sndvol32.exe
return
GuiEscape:
GuiClose:
   ExitApp
return
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group