From 6348db6799aede103ed69522affc79411cb67e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 1 Dec 2020 22:42:41 +0100 Subject: Switch from spaces to tabs --- tt.volume.ahk | 92 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'tt.volume.ahk') diff --git a/tt.volume.ahk b/tt.volume.ahk index 59d16a7..e01be7d 100644 --- a/tt.volume.ahk +++ b/tt.volume.ahk @@ -13,53 +13,53 @@ RAlt & F5::SetVolume(GetKeyState("Shift") ? -2 : -1) SetVolume(n) { - SoundGet, w, WAVE - SoundSet, 15 - w := round(w) + n - if (w > 100) - w := 100 - if (w < 0) - w := 0 - SoundSet, %w%, WAVE - OSD(w) + SoundGet, w, WAVE + SoundSet, 15 + w := round(w) + n + if (w > 100) + w := 100 + if (w < 0) + w := 0 + SoundSet, %w%, WAVE + OSD(w) } /* SetVolume(n) { - global wMax - static vMin := 4 - - SoundGet, s - SoundGet, w, WAVE - s := round(s) - w := round(w) - - if (s > vMin or w > wMax) - wMax := w - else if (wMax = "") - wMax := 100 - - v := s + w - wMax + n - - if (v > 100) - v := 100 - - if (v >= vMin) - { - s := v - w := wMax - } - else - { - s := vMin - w := wMax - vMin + v - } - - SoundSet, %s% - SoundSet, %w%, WAVE - OSD(v) ; display volume on screen + global wMax + static vMin := 4 + + SoundGet, s + SoundGet, w, WAVE + s := round(s) + w := round(w) + + if (s > vMin or w > wMax) + wMax := w + else if (wMax = "") + wMax := 100 + + v := s + w - wMax + n + + if (v > 100) + v := 100 + + if (v >= vMin) + { + s := v + w := wMax + } + else + { + s := vMin + w := wMax - vMin + v + } + + SoundSet, %s% + SoundSet, %w%, WAVE + OSD(v) ; display volume on screen } */ @@ -80,11 +80,11 @@ Gui, OSD:Show, x0 y%y% AutoSize NA, OSD OSD(text) { - SetTimer, RemoveOSD, Off - WinSet, AlwaysOnTop, On, OSD - GuiControl, OSD:Text, OSD, %text% - SetTimer, RemoveOSD, 3000 - return + SetTimer, RemoveOSD, Off + WinSet, AlwaysOnTop, On, OSD + GuiControl, OSD:Text, OSD, %text% + SetTimer, RemoveOSD, 3000 + return } RemoveOSD: -- cgit v1.2.3