mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 02:55:12 +00:00
if_mpd_playing: convert to callbacks.iftest
This commit is contained in:
parent
482f2d50b4
commit
41f32f8766
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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) \
|
||||
{ \
|
||||
|
@ -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_*/
|
||||
|
Loading…
Reference in New Issue
Block a user