1 ; Volume On-Screen-Display (OSD) -- by Rajat
2 ; http://www.autohotkey.com
3 ; This script assigns hotkeys of your choice to raise and lower the
4 ; master and/or wave volume. Both volumes are displayed as different
7 ;_________________________________________________
8 ;_______User Settings_____________________________
10 ; Make customisation only in this area or hotkey area only!!
12 ; The percentage by which to raise or lower the volume each time:
15 ; How long to display the volume level bar graphs:
16 vol_DisplayTime = 2000
18 ; Master Volume Bar color (see the help file to use more
22 ; Background color; for transparent, set to 111111
25 ; Bar's screen position. Use -1 to center the bar in that dimension:
28 vol_Width = 400 ; width of bar
29 vol_Thick = 20 ; thickness of bar
31 ; If your keyboard has multimedia buttons for Volume, you can
32 ; try changing the below hotkeys to use them by specifying
33 ; Volume_Up, ^Volume_Up, Volume_Down, and ^Volume_Down:
34 ;HotKey, Volume_Up, vol_MasterUp
35 ;HotKey, Volume_Down, vol_MasterDown
37 HotKey, #Up, vol_MasterUp ; Win+UpArrow
38 HotKey, #Down, vol_MasterDown
39 HotKey, ^!Up, vol_MasterUp ; Ctrl+Alt+UpArrow
40 HotKey, ^!Down, vol_MasterDown
43 ;___________________________________________
44 ;_____Auto Execute Section__________________
46 ; DON'T CHANGE ANYTHING HERE (unless you know what you're doing).
50 vol_BarOptionsMaster = 1 ZH%vol_Thick% ZX0 ZY0 W%vol_Width% CB%vol_CBM% CW%vol_CW%
51 ;vol_BarOptionsMaster = 1 ZH%vol_Thick% ZX0 ZY0 W%vol_Width%
53 ; If the X position has been specified, add it to the options.
54 ; Otherwise, omit it to center the bar horizontally:
57 vol_BarOptionsMaster = %vol_BarOptionsMaster% X%vol_PosX%
60 ; If the Y position has been specified, add it to the options.
61 ; Otherwise, omit it to have it calculated later:
64 vol_BarOptionsMaster = %vol_BarOptionsMaster% Y%vol_PosY%
72 ;___________________________________________
75 vol_tmp := VA_GetMasterVolume()
76 vol_Master := (vol_tmp + vol_Step)
77 VA_SetMasterVolume(vol_Master)
82 vol_tmp := VA_GetMasterVolume()
83 vol_Master := (vol_tmp - vol_Step)
84 VA_SetMasterVolume(vol_Master)
89 ; To prevent the "flashing" effect, only create the bar window if it
90 ; doesn't already exist:
91 IfWinNotExist, vol_Progress
93 ; Calculate position here in case screen resolution changes while
94 ; the script is running:
95 Progress, %vol_BarOptionsMaster%, , , vol_Progress
96 ;WinSet, TransColor, 111111, vol_Progress
98 ; Get the volume in case the user or an external program changed them:
99 vol_Master := VA_GetMasterVolume()
100 Progress, 1:%vol_Master%
101 SetTimer, vol_BarOff, %vol_DisplayTime%
105 SetTimer, vol_BarOff, off