Skip to content

Commit

Permalink
Show only exit option on tray
Browse files Browse the repository at this point in the history
  • Loading branch information
rkosh committed Nov 1, 2019
1 parent 8fe4800 commit a7d601c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ahk/Balance.ahk
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Persistent
#SingleInstance
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

#Include lib\VA.ahk

global LOOKUP_INTERVAL = 1000 ; Time in milliseconds (lower means frequent changes)
global LOOKUP_INTERVAL = 1000 ; Time in milliseconds (lower means frequent changes. Atleast 1000ms is recommended)
global RIGHT_LEFT_VOLUME_RATIO := 1/2 ; Balance R -----X----- L


Expand All @@ -17,7 +18,8 @@ SetBalance(){
device_name := VA_GetDeviceName(device)
}

If ( InStr(device_name, "Realtek", false) || InStr(device_name, "DELL", false) ) {
; Effective only for the following device ("EDIFIER R19U")
If not InStr(device_name, "EDIFIER R19U") {
Return
}

Expand Down Expand Up @@ -45,6 +47,14 @@ DecreaseVolume(){

SetTimer, setBalance, %LOOKUP_INTERVAL% ; Check for changes after

Menu, tray, NoStandard
menu, tray, add
menu, tray, add, Exit
menu, tray, add
return

Exit:
ExitApp
; Uncomment the following code for realtime volume changes
/*
WheelUp::
Expand Down

0 comments on commit a7d601c

Please sign in to comment.