]> git.rmz.io Git - dotfiles.git/blobdiff - awesome/widgets/mpc.lua
awesome/mpc: use a keep alive timer instead of ping on error
[dotfiles.git] / awesome / widgets / mpc.lua
index bd64fa85b4f6adfd2b5df9bf085b00d6411806ea..2ef26b503f94d8f36509678d2f2a85b00484c738 100644 (file)
@@ -32,7 +32,7 @@ function mpc.new(host, port, password, error_handler, ...)
         _try_reconnect = false,
         _idle_subsystems = { ... }
     }, { __index = mpc })
         _try_reconnect = false,
         _idle_subsystems = { ... }
     }, { __index = mpc })
-    self:_connect()
+    self:connect()
     return self
 end
 
     return self
 end
 
@@ -52,7 +52,7 @@ function mpc:_error(err)
     end
 end
 
     end
 end
 
-function mpc:_connect()
+function mpc:connect()
     if self._connected then return end
     -- Reset all of our state
     self._reply_handlers = {}
     if self._connected then return end
     -- Reset all of our state
     self._reply_handlers = {}
@@ -197,7 +197,7 @@ function mpc:_send(command, callback)
 end
 
 function mpc:send(...)
 end
 
 function mpc:send(...)
-    self:_connect()
+    self:connect()
     if not self._connected then
         return
     end
     if not self._connected then
         return
     end