summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 466530d)
raw | patch | inline | side by side (parent: 466530d)
author | Max Kellermann <max@duempel.org> | |
Fri, 3 Oct 2008 13:35:58 +0000 (15:35 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Fri, 3 Oct 2008 13:35:58 +0000 (15:35 +0200) |
The glib function g_timeout_add() wants the interval as guint in
milliseconds. Store the update interval in this form, instead of
having to multiply MPD_UPDATE_TIME with 1000.
milliseconds. Store the update interval in this form, instead of
having to multiply MPD_UPDATE_TIME with 1000.
src/main.c | patch | blob | history |
diff --git a/src/main.c b/src/main.c
index 5c2d0e52ce11973b9086c709290439957ae143db..da9f55389a321abcdf7340fcf07f524c585aa1df 100644 (file)
--- a/src/main.c
+++ b/src/main.c
#include <string.h>
/* time between mpd updates [s] */
-static const float MPD_UPDATE_TIME = 0.5;
+static const guint update_interval = 500;
#define BUFSIZE 1024
if (cmd == CMD_VOLUME_UP || cmd == CMD_VOLUME_DOWN) {
/* make sure we dont update the volume yet */
g_source_remove(update_source_id);
- update_source_id = g_timeout_add((guint)(MPD_UPDATE_TIME * 1000),
+ update_source_id = g_timeout_add(update_interval,
timer_mpd_update,
GINT_TO_POINTER(TRUE));
}
/* attempt to connect */
reconnect_source_id = g_timeout_add(1, timer_reconnect, NULL);
- update_source_id = g_timeout_add((guint)(MPD_UPDATE_TIME * 1000),
+ update_source_id = g_timeout_add(update_interval,
timer_mpd_update,
GINT_TO_POINTER(TRUE));
g_timeout_add(10000, timer_check_key_bindings, NULL);