mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 11:05:18 +00:00
convert mpd_percent to callbacks.percentage
This commit is contained in:
parent
61591def8e
commit
bc1b82771f
@ -1133,7 +1133,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
|
||||
obj->callbacks.print = &print_mpd_file;
|
||||
END OBJ(mpd_percent, &update_mpd)
|
||||
init_mpd();
|
||||
obj->callbacks.print = &print_mpd_percent;
|
||||
obj->callbacks.percentage = &mpd_percentage;
|
||||
END OBJ(mpd_album, &update_mpd)
|
||||
mpd_set_maxlen(mpd_album);
|
||||
init_mpd();
|
||||
|
@ -370,10 +370,10 @@ void print_mpd_length(struct text_object *obj, char *p, int p_max_size)
|
||||
format_media_player_time(p, p_max_size, mpd_info.length);
|
||||
}
|
||||
|
||||
void print_mpd_percent(struct text_object *obj, char *p, int p_max_size)
|
||||
uint8_t mpd_percentage(struct text_object *obj)
|
||||
{
|
||||
(void)obj;
|
||||
percent_print(p, p_max_size, (int)(mpd_info.progress * 100));
|
||||
return round_to_int(mpd_info.progress * 100.0f);
|
||||
}
|
||||
|
||||
uint8_t mpd_barval(struct text_object *obj)
|
||||
|
@ -16,7 +16,7 @@ void update_mpd(void);
|
||||
|
||||
void print_mpd_elapsed(struct text_object *, char *, int);
|
||||
void print_mpd_length(struct text_object *, char *, int);
|
||||
void print_mpd_percent(struct text_object *, char *, int);
|
||||
uint8_t mpd_percentage(struct text_object *);
|
||||
uint8_t mpd_barval(struct text_object *);
|
||||
void print_mpd_smart(struct text_object *, char *, int);
|
||||
void print_mpd_title(struct text_object *, char *, int);
|
||||
|
Loading…
Reference in New Issue
Block a user