]> gitweb.fluxo.info Git - awesompd.git/commitdiff
Fix the status switching to disconnected when volume bounds are hit
authorAlexander Yakushev <yakushev.alex@gmail.com>
Sat, 15 Oct 2011 13:39:19 +0000 (16:39 +0300)
committerAlexander Yakushev <yakushev.alex@gmail.com>
Sat, 15 Oct 2011 13:39:19 +0000 (16:39 +0300)
When the volume is tried to set beyond its bounds (for example, make it lower when it's already zero) mpc returned an empty string which was treated like a disconnect. This dirty hack removes the problem.

awesompd.lua
jamendo.lua

index 8db3cb577fd0333f6f004f25d93bad2a84babb7f..1a1e0aa2a8998fecccb67affb1a651d9740df11d 100644 (file)
@@ -1,7 +1,7 @@
 ---------------------------------------------------------------------------
 -- @author Alexander Yakushev <yakushev.alex@gmail.com>
 -- @copyright 2010-2011 Alexander Yakushev
--- @release v1.0.7
+-- @release v1.0.8
 ---------------------------------------------------------------------------
 
 awesompd = {}
@@ -278,14 +278,16 @@ end
 
 function awesompd:command_volume_up()
    return function()
-             self:command("volume +5",self.update_track)
+             self:command("volume +5")
+             self:update_track() -- Nasty! I should replace it with proper callback later.
              self:notify_state(self.NOTIFY_VOLUME)
           end
 end
 
 function awesompd:command_volume_down()
    return function()
-             self:command("volume -5",self.update_track)
+             self:command("volume -5")
+             self:update_track()
              self:notify_state(self.NOTIFY_VOLUME)
           end
 end
index 870a42120a83054130d5df20d00dc5365e4c968d..5af6121c17e5d693851d89953056f0debbe5f350 100644 (file)
@@ -1,7 +1,7 @@
 ---------------------------------------------------------------------------
 -- @author Alexander Yakushev <yakushev.alex@gmail.com>
 -- @copyright 2011 Alexander Yakushev
--- @release v1.0.7
+-- @release v1.0.8
 ---------------------------------------------------------------------------
 
 module('jamendo', package.seeall)