1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-15 17:47:09 +00:00

if_mpd_playing: convert to callbacks.iftest

This commit is contained in:
Phil Sutter 2009-11-16 23:37:01 +01:00
parent 482f2d50b4
commit 41f32f8766
4 changed files with 8 additions and 8 deletions

View File

@ -1450,14 +1450,6 @@ void generate_text_internal(char *p, int p_max_size,
}
#endif /* __FreeBSD__ __OpenBSD__ */
#ifdef MPD
OBJ(if_mpd_playing) {
if (!mpd_get_info()->is_playing) {
DO_JUMP;
}
}
#endif
#ifdef XMMS2
OBJ(if_xmms2_connected) {
if (cur->xmms2.conn_state != 1) {

View File

@ -1145,6 +1145,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->callbacks.print = &print_mpd_smart;
END OBJ_IF(if_mpd_playing, &update_mpd)
init_mpd();
obj->callbacks.iftest = &check_mpd_playing;
#undef mpd_set_maxlen
#endif /* MPD */
#ifdef MOC

View File

@ -393,6 +393,12 @@ void print_mpd_smart(struct text_object *obj, char *p, int p_max_size)
}
}
int check_mpd_playing(struct text_object *obj)
{
(void)obj;
return mpd_get_info()->is_playing;
}
#define MPD_PRINT_GENERATOR(name, fmt) \
void print_mpd_##name(struct text_object *obj, char *p, int p_max_size) \
{ \

View File

@ -49,5 +49,6 @@ void print_mpd_file(struct text_object *, char *, int);
void print_mpd_vol(struct text_object *, char *, int);
void print_mpd_bitrate(struct text_object *, char *, int);
void print_mpd_status(struct text_object *, char *, int);
int check_mpd_playing(struct text_object *);
#endif /*MPD_H_*/