fix(mpd): Handle broken connections

This commit is contained in:
Michael Carlberg 2017-01-13 13:02:51 +01:00
parent 22140f7db9
commit 15f880eba4
4 changed files with 62 additions and 55 deletions
include/modules

View file

@ -10,8 +10,6 @@ POLYBAR_NS
using namespace mpd;
namespace chrono = std::chrono;
namespace modules {
class mpd_module : public event_module<mpd_module>, public input_handler {
public:
@ -70,9 +68,11 @@ namespace modules {
chrono::system_clock::time_point m_lastsync{};
float m_synctime{1.0f};
int m_quick_attempts{0};
// This flag is used to let thru a broadcast once every time
// the connection state changes
mpd::connection_state m_statebroadcasted{mpd::connection_state::NONE};
connection_state m_statebroadcasted{connection_state::NONE};
progressbar_t m_bar_progress;
iconset_t m_icons;