diff options
author | Joerg T. (Mic92) <jthalheim@gmail.com> | 2011-09-01 16:08:02 +0200 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2011-09-02 05:13:32 +0200 |
commit | 25b375bd6b8ee5ceb04d09fca2d8ba413850d278 (patch) | |
tree | 1d408d91177ef28653acf8b23516f607a9ad597d /contrib | |
parent | 18e1823dedcd844ad0e35fb271b2ed3926722920 (diff) | |
download | vicious-legacy-25b375bd6b8ee5ceb04d09fca2d8ba413850d278.tar.xz |
[pulse] round volume to integer
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/pulse.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/pulse.lua b/contrib/pulse.lua index 52fcf9e..4b0260f 100644 --- a/contrib/pulse.lua +++ b/contrib/pulse.lua @@ -17,6 +17,9 @@ local string = { format = string.format, gmatch = string.gmatch } +local math = { + floor = math.floor +} -- }}} @@ -71,7 +74,7 @@ local function worker(format, sink) local vol = tonumber(string.match(data, "set%-sink%-volume "..escape(sink).." (0x[%x]+)")) if vol == nil then vol = 0 end - return { vol/0x10000*100, "on"} + return { math.floor(vol/0x10000*100), "on"} end -- }}} |