1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-25 12:10:03 +00:00

merge audacious_bar to callbacks.barval

This commit is contained in:
Phil Sutter 2009-11-23 23:22:50 +01:00
parent 086829b017
commit b78664d8c5
3 changed files with 7 additions and 11 deletions

View File

@ -262,17 +262,13 @@ void print_audacious_title(struct text_object *obj, char *p, int p_max_size)
info.audacious.items[AUDACIOUS_TITLE]);
}
void print_audacious_bar(struct text_object *obj, char *p, int p_max_size)
uint8_t audacious_barval(struct text_object *obj)
{
double progress;
(void)obj;
if (!p_max_size)
return;
progress =
atof(info.audacious.items[AUDACIOUS_POSITION_SECONDS]) /
atof(info.audacious.items[AUDACIOUS_LENGTH_SECONDS]);
new_bar(obj, p, p_max_size, (int) (progress * 255.0f));
return round_to_int(
atof(info.audacious.items[AUDACIOUS_POSITION_SECONDS]) * 255.0 /
atof(info.audacious.items[AUDACIOUS_LENGTH_SECONDS]));
}
#define AUDACIOUS_PRINT_GENERATOR(name, idx) \

View File

@ -78,6 +78,6 @@ void print_audacious_filename(struct text_object *, char *, int);
void print_audacious_playlist_length(struct text_object *, char *, int);
void print_audacious_playlist_position(struct text_object *, char *, int);
void print_audacious_main_volume(struct text_object *, char *, int);
void print_audacious_bar(struct text_object *, char *, int);
uint8_t audacious_barval(struct text_object *);
#endif

View File

@ -1268,7 +1268,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->callbacks.print = &print_audacious_main_volume;
END OBJ(audacious_bar, &update_audacious)
scan_bar(obj, arg);
obj->callbacks.print = &print_audacious_bar;
obj->callbacks.barval = &audacious_barval;
#endif /* AUDACIOUS */
#ifdef BMPX
END OBJ(bmpx_title, &update_bmpx)