Guest User

Untitled

a guest
Apr 26th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. QuietMode = 0
  2. IniRead, EditSoundThreshold, Config.ini, Options, EditSoundThreshold, 50
  3. IniRead, EditReduceSound, Config.ini, Options, EditReduceSound, 80
  4. DllCall("winmm.dll\mciSendString", "Str", "open new alias MediaControlInterface type waveaudio wait")
  5. DllCall("winmm.dll\mciSendString", "Str", "set MediaControlInterface time format milliseconds wait")
  6. VarSetCapacity(MicrophoneVolume,100)
  7. DllCall("QueryPerformanceFrequency", "Int64*", QueryPerformanceFrequency)
  8.  
  9. Gui, +AlwaysOnTop +LastFound +Resize +ToolWindow -Caption MinSize MaxSize
  10. If (DllCall("dwmapi\DwmIsCompositionEnabled", "UInt*", IsEnabled) = 0){
  11. Gui, Color, 0xFFFFFE
  12. VarSetCapacity(rect, 16, -1)
  13. DllCall("dwmapi\DwmExtendFrameIntoClientArea", "UInt", WinExist(), "uint", &rect)
  14. WinSet, TransColor, 0xFFFFFE
  15. }
  16. Gui, Font, cBlack s16, Segoe UI
  17. Gui, Add, Text, x0 y0 gTextTitle, Options
  18. Gui, Font, s9
  19. Gui, Add, Text, x230 y15 w28 Disabled vTextMicrophoneVolume
  20. Gui, Add, Text, x20 y30, Sound Threshold
  21. Gui, Add, Text, x20 y50, Reduce all sounds by
  22. Gui, Add, Text, x230 y50, `%
  23. Gui, Add, Text, x20 y70, Output Device
  24. Gui, Font, s8, Segoe UI Light
  25. Gui, Add, Edit, x165 y25 w60 h20 gEditSoundThreshold vEditSoundThreshold
  26. Gui, Add, UpDown,, %EditSoundThreshold%
  27. Gui, Add, Edit, x165 y45 w60 h20 gEditReduceSound vEditReduceSound
  28. Gui, Add, UpDown,, %EditReduceSound%
  29. Gui, Add, DropDownList, x165 y65 w60 h20
  30. Gui, Add, Progress, x80 y15 h10 w145 -Smooth vProgressMicrophoneVolume
  31. Gui, Show, w260 h90 Hide
  32. Menu, Tray, NoStandard
  33. Menu, Tray, Add, Options, MenuHandler
  34. SetTimer, CheckVolume, 0
  35.  
  36.  
  37. Return
  38. CheckVolume:
  39. DllCall("winmm.dll\mciSendString", "Str", "status MediaControlInterface level", "Str", MicrophoneVolume, "UInt", 100, "UInt", 0, "Cdecl Int")
  40. GuiControl,, ProgressMicrophoneVolume, % (MicrophoneVolume *= 0.78125)
  41. GuiControl,, TextMicrophoneVolume, % Round(MicrophoneVolume) "%"
  42.  
  43. Return
  44. TextTitle:
  45. If (A_GuiEvent = "DoubleClick")
  46. Gui, Hide
  47. Else
  48. PostMessage, 0xA1, 2,,, A
  49.  
  50. Return
  51. EditSoundThreshold:
  52. EditReduceSound:
  53. GuiControlGet, %A_ThisLabel%
  54. IniWrite, % %A_ThisLabel%, Config.ini, Options, %A_ThisLabel%
  55.  
  56. Return
  57. MenuHandler:
  58. If (A_ThisMenuItem = "Options")
  59. Gui, Show
  60.  
  61.  
  62.  
  63.  
  64.  
  65. *Ctrl::ExitApp
Add Comment
Please, Sign In to add comment