Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. Gui, +ToolWindow
  2. #NoEnv
  3. #Persistent
  4. #SingleInstance, Force
  5. #MaxHotkeysPerInterval 200
  6. Menu, Tray, NoStandard
  7. Menu, Tray, Add, Close, Exit
  8. WinSet, AlwaysOnTop
  9. Gui_X := ""
  10. Gui_Y := "y10"
  11. Back_Colour := 0x000000
  12. Font_Colour := 0xffffff
  13. BackBar_Colour := 0x363636
  14. Bar_Colour := 0xffffff
  15. VolUp_Key := "^!="
  16. VolDown_Key := "^!-"
  17. Timeout := 500
  18. Max_Trans := 160
  19. Update := 0
  20. SoundGet, Vol
  21. Curr_Vol := Vol
  22. Trans := Max_Trans
  23. Gui, Color, % Back_Colour,
  24. Gui, Font, c%Font_Colour% s12
  25. Gui, Add, Text, w500 Center, Volume
  26. Gui, Font
  27. Gui, Add, Progress, w500 vProgress c%Bar_Colour% +Background%BackBar_Colour%, % Curr_Vol
  28. Gui, Font, c%Font_Colour% s24
  29. SoundGet, Vol
  30. RegExMatch( Vol, "(?<Percent>\d+)\.", rg )
  31. Gui, Add, Text, w500 Center vVol, % rgPercent
  32. Gui, Show, NoActivate h80 w530 %Gui_X% %Gui_Y%, Vol_OSD
  33. WinSet, Region, w530 h105 R10-10 0-0, Vol_OSD
  34. WinSet, Transparent, %Trans%, Vol_OSD
  35. Gui, -Caption +AlwaysOnTop +ToolWindow +E0x20 +SysMenu
  36. Hotkey, % VolUp_Key, Volume_Up
  37. Hotkey, % VolDown_Key, Volume_Down
  38. SetTimer, Update, 50
  39. SetTimer, Fade, % "-" Timeout
  40. return
  41. Fade:
  42. While ( Trans > 0 && Update = 0)
  43. { Trans -= 4
  44. WinSet, Transparent, % Trans, Vol_OSD
  45. Sleep, 16
  46. }
  47. Return
  48.  
  49. Update:
  50. Update := 0
  51. SoundGet, Vol
  52. If ( Vol <> Curr_Vol )
  53. { Update := 1
  54. GuiControl,, Progress, % Vol
  55. RegExMatch( Vol, "(?<Percent>\d+)\.", rg )
  56. GuiControl,, Vol, % rgPercent
  57. Curr_Vol := Vol
  58. While ( Trans < Max_Trans )
  59. { Trans += 10
  60. WinSet, Transparent, % Trans, Vol_OSD
  61. Sleep 1
  62. }
  63. SetTimer, Fade, % "-" Timeout
  64. }
  65. Return
  66. Exit:
  67. ExitApp
  68. Return
  69. Volume_Up::SoundSet,+1
  70. Volume_Down::SoundSet,-1
  71. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement