Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/modules/mpd/mpd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class MPD : public ALabel {
void tryConnect();
void checkErrors(mpd_connection* conn);
void fetchState();
void queryMPD();

inline bool stopped() const { return connection_ && state_ == MPD_STATE_STOP; }
inline bool playing() const { return connection_ && state_ == MPD_STATE_PLAY; }
Expand Down
1 change: 0 additions & 1 deletion include/modules/mpd/state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ class Context {
void tryConnect() const;
void checkErrors(mpd_connection*) const;
void do_update();
void queryMPD() const;
void fetchState() const;
constexpr mpd_state state() const;
void emit() const;
Expand Down
1 change: 0 additions & 1 deletion include/modules/mpd/state.inl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ constexpr inline mpd_state Context::state() const { return mpd_module_->state_;
inline void Context::do_update() { mpd_module_->setLabel(); }

inline void Context::checkErrors(mpd_connection* conn) const { mpd_module_->checkErrors(conn); }
inline void Context::queryMPD() const { mpd_module_->queryMPD(); }
inline void Context::fetchState() const { mpd_module_->fetchState(); }
inline void Context::emit() const { mpd_module_->emit(); }

Expand Down
15 changes: 0 additions & 15 deletions src/modules/mpd/mpd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,6 @@ auto waybar::modules::MPD::update() -> void {
ALabel::update();
}

void waybar::modules::MPD::queryMPD() {
if (connection_ != nullptr) {
spdlog::trace("{}: fetching state information", module_name_);
try {
fetchState();
spdlog::trace("{}: fetch complete", module_name_);
} catch (std::exception const& e) {
spdlog::error("{}: {}", module_name_, e.what());
state_ = MPD_STATE_UNKNOWN;
}

dp.emit();
}
}

std::string waybar::modules::MPD::getTag(mpd_tag_type type, unsigned idx) const {
std::string result =
config_["unknown-tag"].isString() ? config_["unknown-tag"].asString() : "N/A";
Expand Down
1 change: 0 additions & 1 deletion src/modules/mpd/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ bool Playing::on_timer() {
return false;
}

ctx_->queryMPD();
ctx_->emit();
} catch (std::exception const& e) {
spdlog::warn("mpd: Playing: error: {}", e.what());
Expand Down