1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-28 01:28:30 +00:00

convert mpd_barval to double

This commit is contained in:
Phil Sutter 2009-12-04 01:29:56 +01:00
parent 9e587ae6d5
commit 202bbf01ff
3 changed files with 4 additions and 4 deletions

View File

@ -1243,7 +1243,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->callbacks.print = &print_mpd_status; obj->callbacks.print = &print_mpd_status;
obj->callbacks.free = &free_mpd; obj->callbacks.free = &free_mpd;
END OBJ(mpd_bar, &update_mpd) END OBJ(mpd_bar, &update_mpd)
scan_bar(obj, arg, 255); scan_bar(obj, arg, 1);
init_mpd(); init_mpd();
obj->callbacks.barval = &mpd_barval; obj->callbacks.barval = &mpd_barval;
obj->callbacks.free = &free_mpd; obj->callbacks.free = &free_mpd;

View File

@ -378,10 +378,10 @@ uint8_t mpd_percentage(struct text_object *obj)
return round_to_int(mpd_info.progress * 100.0f); return round_to_int(mpd_info.progress * 100.0f);
} }
uint8_t mpd_barval(struct text_object *obj) double mpd_barval(struct text_object *obj)
{ {
(void)obj; (void)obj;
return round_to_int(mpd_info.progress * 255.0f); return mpd_info.progress;
} }
void print_mpd_smart(struct text_object *obj, char *p, int p_max_size) void print_mpd_smart(struct text_object *obj, char *p, int p_max_size)

View File

@ -17,7 +17,7 @@ void update_mpd(void);
void print_mpd_elapsed(struct text_object *, char *, int); void print_mpd_elapsed(struct text_object *, char *, int);
void print_mpd_length(struct text_object *, char *, int); void print_mpd_length(struct text_object *, char *, int);
uint8_t mpd_percentage(struct text_object *); uint8_t mpd_percentage(struct text_object *);
uint8_t mpd_barval(struct text_object *); double mpd_barval(struct text_object *);
void print_mpd_smart(struct text_object *, char *, int); void print_mpd_smart(struct text_object *, char *, int);
void print_mpd_title(struct text_object *, char *, int); void print_mpd_title(struct text_object *, char *, int);
void print_mpd_artist(struct text_object *, char *, int); void print_mpd_artist(struct text_object *, char *, int);