mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-15 17:47:09 +00:00
if_xmms2_connected: convert to callbacks.iftest
This commit is contained in:
parent
cec0f3b8c6
commit
06a4650f60
@ -1450,14 +1450,6 @@ void generate_text_internal(char *p, int p_max_size,
|
||||
}
|
||||
#endif /* __FreeBSD__ __OpenBSD__ */
|
||||
|
||||
#ifdef XMMS2
|
||||
OBJ(if_xmms2_connected) {
|
||||
if (cur->xmms2.conn_state != 1) {
|
||||
DO_JUMP;
|
||||
}
|
||||
}
|
||||
#endif /* XMMS */
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
OBJ(iconv_start) {
|
||||
do_iconv_start(obj);
|
||||
|
@ -1224,6 +1224,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
|
||||
END OBJ(xmms2_timesplayed, &update_xmms2)
|
||||
obj->callbacks.print = &print_xmms2_timesplayed;
|
||||
END OBJ_IF(if_xmms2_connected, &update_xmms2)
|
||||
obj->callbacks.iftest = &if_xmms2_connected;
|
||||
#endif
|
||||
#ifdef AUDACIOUS
|
||||
END OBJ(audacious_status, &update_audacious)
|
||||
|
@ -386,3 +386,10 @@ XMMS2_PRINT_GENERATOR(playlist, "%s")
|
||||
XMMS2_PRINT_GENERATOR(timesplayed, "%i")
|
||||
|
||||
#undef XMMS2_PRINT_GENERATOR
|
||||
|
||||
int check_xmms2_connected(struct text_object *obj)
|
||||
{
|
||||
(void)obj;
|
||||
|
||||
return info.xmms2.conn_state == CONN_OK;
|
||||
}
|
||||
|
@ -75,5 +75,6 @@ void print_xmms2_id(struct text_object *, char *, int);
|
||||
void print_xmms2_size(struct text_object *, char *, int);
|
||||
void print_xmms2_playlist(struct text_object *, char *, int);
|
||||
void print_xmms2_timesplayed(struct text_object *, char *, int);
|
||||
int check_xmms2_connected(struct text_object *);
|
||||
|
||||
#endif /*XMMS2_H_*/
|
||||
|
Loading…
Reference in New Issue
Block a user