Code: Select all
;∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙
#NoEnv
#NoTrayIcon
#Persistent
#SingleInstance, Force
SetBatchLines -1
;;---------------------------------------------
SetTimer, ShowVol, 500 ;; Keeps above taskbar in z-order.
;;---------------------------------------------
SoundSet, 7 ; Set to prefered default volume level.
;;---------------------------------------------
;∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙
;;------------- VOLUME GUI -------------
;;----- Volume Gui Positioning.
SWide := A_ScreenWidth - 53
SHigh := A_ScreenHeight - 40
GWidth := 48
GHeight := 41
;;----- Location for Cursor to Scroll Volume.
TaskbarAreaX := A_ScreenWidth - 153 ; Pixels from the right side of the screen.
TaskbarAreaY := A_ScreenHeight - 39 ; Pixels from the bottom of the screen.
;;---------------------------------------------
Gui,
+AlwaysOnTop
-Caption
+E0x20 ;; Comment out to stop click-through ability.
+LastFound
+ToolWindow
WinSet Transparent, 255 ;; Full Opaqueness (click-through)
Gui, Color, 1B1F21
GUI, Margin, 3, 2
Gui, Font, s6 w600 cAQUA q5, VERDANA ;; Aqua Volume Label.
Gui, Add, Text, x3 y6 gVolume, VOLUME
Gui, Font, s12 w400 cLIME q5, CALIBRI ;; Lime % Volume Value.
Gui, Add, Text, x5 y16 w%GWidth% BackgroundTrans vVolumeText,
Gui, Show, x%SWide% y%SHigh% w%GWidth% h%GHeight% NA, Vol-Level
SetTimer, UpdateVolume, 500
Return
;;---------------------------------------------
;∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙
;;-------------- FUNCTIONS --------------
UpdateVolume:
SoundGet, Volume
VolumePercentage := Round(Volume)
if (Volume == 0) {
GuiControl, -Redraw, VolumeText
Gui, Font, s6 w600 cC0C0C0 q5, VERDANA ;; SILVER > MUTED VOLUME.
GuiControl, Font, VolumeText
GuiControl, +Redraw, VolumeText
GuiControl,, VolumeText, MUTE ;; MUTED VOLUME. BOLD
}
else if (Volume == 100) {
GuiControl, -Redraw, VolumeText
Gui, Font, s10 w600 cFF0000 q5, VERDANA ;; RED > MAX VOLUME.
GuiControl, Font, VolumeText
GuiControl, +Redraw, VolumeText
GuiControl,, VolumeText, MAX ;; MAXED VOLUME. BOLD
}
else if (Volume >= 25 && Volume <= 35) {
GuiControl, -Redraw, VolumeText
Gui, Font, s12 w400 cBFFF00 q5, CALIBRI
GuiControl, Font, VolumeText
GuiControl, +Redraw, VolumeText
GuiControl,, VolumeText, %VolumePercentage%`% ;; Lime/Yellow Zone. 25-35
}
else if (Volume >= 35 && Volume <= 50) {
GuiControl, -Redraw, VolumeText
Gui, Font, s12 w400 cFFFF00 q5, CALIBRI
GuiControl, Font, VolumeText
GuiControl, +Redraw, VolumeText
GuiControl,, VolumeText, %VolumePercentage%`% ;; Yellow Zone. 35-50
}
else if (Volume >= 50 && Volume <= 65) {
GuiControl, -Redraw, VolumeText
Gui, Font, s12 w400 cFFBE00 q5, CALIBRI
GuiControl, Font, VolumeText
GuiControl, +Redraw, VolumeText
GuiControl,, VolumeText, %VolumePercentage%`% ;; Yellow/Orange Zone. 50-65
}
else if (Volume >= 65 && Volume <= 80) {
GuiControl, -Redraw, VolumeText
Gui, Font, s12 w400 cFF8000 q5, CALIBRI
GuiControl, Font, VolumeText
GuiControl, +Redraw, VolumeText
GuiControl,, VolumeText, %VolumePercentage%`% ;; Orange Zone. 65-80
}
else if (Volume >= 80 && Volume <= 90) {
GuiControl, -Redraw, VolumeText
Gui, Font, s12 w400 cFF5500 q5, CALIBRI
GuiControl, Font, VolumeText
GuiControl, +Redraw, VolumeText
GuiControl,, VolumeText, %VolumePercentage%`% ;; Orange/Red Zone. 80-90
}
else if (Volume >= 90 && Volume <= 99) {
GuiControl, -Redraw, VolumeText
Gui, Font, s12 w400 cFF1111 q5, CALIBRI
GuiControl, Font, VolumeText
GuiControl, +Redraw, VolumeText
GuiControl,, VolumeText, %VolumePercentage%`% ;; Red Zone. 90-99
}
else {
GuiControl, -Redraw, VolumeText
Gui, Font, s12 w400 cLIME q5, CALIBRI
GuiControl, Font, VolumeText
GuiControl, +Redraw, VolumeText
GuiControl,, VolumeText, %VolumePercentage%`% ;; Lime > Comfort Zone Volume. 1-24
}
Return
;;---------------------------------------------
ShowVol:
Gui, Show, NA, Vol-Level
Return
;;---------------------------------------------
; If +E0x20 is commented out, the Volume Label on the Volume Gui will set the volume level to the below percentage when clicked.
Volume:
SoundSet, 3 ; Set to prefered default volume level.
Return
;;---------------------------------------------
;∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙
;;----------- VOLUME SCROLL -----------
;;---------------- UP
~WheelUp::
CoordMode, Mouse, Screen
MouseGetPos, xPos, yPos
if (xPos >= TaskbarAreaX && yPos >= TaskbarAreaY && xPos <= (TaskbarAreaX + 150) && yPos <= (TaskbarAreaY + 40))
{
SoundSet +2
}
Return
;;---------------- DOWN
~WheelDown::
CoordMode, Mouse, Screen
MouseGetPos, xPos, yPos
if (xPos >= TaskbarAreaX && yPos >= TaskbarAreaY && xPos <= (TaskbarAreaX + 150) && yPos <= (TaskbarAreaY + 40))
{
SoundSet -2
}
Return
;;------------------- END -------------------
;∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙=∙