mpd: adapt Playing::on_io to post-refactor Context API
queryMPD() was removed from Context by the master-side dedup refactor (perf(mpd): avoid duplicate playing-state updates). fetchState() is already called earlier in on_io and emit() updates the GUI, so the redundant queryMPD() call is dropped, matching the identical resolution applied to Playing::on_timer on master.
This commit is contained in:
@@ -50,7 +50,6 @@ void Idle::stop() {
|
||||
ctx_->setState(std::make_unique<Stopped>(ctx_));
|
||||
}
|
||||
|
||||
|
||||
void Idle::update() noexcept {
|
||||
// This is intentionally blank.
|
||||
}
|
||||
@@ -140,7 +139,6 @@ void Playing::timer() noexcept {
|
||||
timer_connection_ = Glib::signal_timeout().connect_seconds(timer_slot, 1);
|
||||
}
|
||||
|
||||
|
||||
void Playing::idle() noexcept {
|
||||
auto conn = ctx_->connection().get();
|
||||
assert(conn != nullptr);
|
||||
@@ -218,7 +216,6 @@ bool Playing::on_io(Glib::IOCondition const&) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ctx_->queryMPD();
|
||||
ctx_->emit();
|
||||
|
||||
if (!mpd_send_idle_mask(
|
||||
@@ -239,25 +236,23 @@ bool Playing::on_io(Glib::IOCondition const&) {
|
||||
}
|
||||
|
||||
void Playing::stop() {
|
||||
RUN_NOIDLE_AND_CMD(Playing,
|
||||
if (timer_connection_.connected()) {
|
||||
RUN_NOIDLE_AND_CMD(
|
||||
Playing, if (timer_connection_.connected()) {
|
||||
timer_connection_.disconnect();
|
||||
|
||||
mpd_run_stop(ctx_->connection().get());
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
ctx_->setState(std::make_unique<Stopped>(ctx_));
|
||||
}
|
||||
|
||||
void Playing::pause() {
|
||||
RUN_NOIDLE_AND_CMD(Playing,
|
||||
if (timer_connection_.connected()) {
|
||||
RUN_NOIDLE_AND_CMD(
|
||||
Playing, if (timer_connection_.connected()) {
|
||||
timer_connection_.disconnect();
|
||||
|
||||
mpd_run_pause(ctx_->connection().get(), true);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
ctx_->setState(std::make_unique<Paused>(ctx_));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user