author | Max Kellermann <max@duempel.org> | |
Sat, 3 Oct 2009 23:18:35 +0000 (01:18 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sat, 3 Oct 2009 23:18:35 +0000 (01:18 +0200) | ||
commit | e25d7523c092a56b404e385daa8eba228c3b3074 | |
tree | 9e11df9cb878de35e53a87b0c5e0f4a980ba87ed | tree | snapshot |
parent | 46c72b9e1f4e35340dfe0fa2dec57622ee60f3ae | commit | diff |
mpdclient: use the "idle" command to reduce CPU and network usage
This patch makes mpdclient and the rest of ncmpc use the new
mpd_glib_source class. When mpdclient_get_connection() is called, it
sends the "noidle" command to MPD. Upon mpdclient_put_connection()
(which is called before returning control back to GLib), mpdclient.c
re-enters "idle" mode. The "idle" event handler lives in main.c, and
replaces timer_mpd_update().
Currently, the update timer is still used when MPD is playing, to keep
the progress bar and the time up to date. This is subject to change
soon.
Servers which do not support "idle" are detected automatically.
This patch makes mpdclient and the rest of ncmpc use the new
mpd_glib_source class. When mpdclient_get_connection() is called, it
sends the "noidle" command to MPD. Upon mpdclient_put_connection()
(which is called before returning control back to GLib), mpdclient.c
re-enters "idle" mode. The "idle" event handler lives in main.c, and
replaces timer_mpd_update().
Currently, the update timer is still used when MPD is playing, to keep
the progress bar and the time up to date. This is subject to change
soon.
Servers which do not support "idle" are detected automatically.
NEWS | diff | blob | history | |
src/main.c | diff | blob | history | |
src/mpdclient.c | diff | blob | history | |
src/mpdclient.h | diff | blob | history |