1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-24 11:55:43 +00:00

* Improved performance slightly

* Added mpd_interval config option to specify an update interval for the
    mpd thread

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@954 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Brenden Matthews 2007-09-02 03:02:33 +00:00
parent 38d2cdfc84
commit 16ea4f6587
5 changed files with 42 additions and 7 deletions

View File

@ -1,5 +1,10 @@
# $Id$
2007-09-01
* Improved performance slightly
* Added 'mpd_interval' config option to specify an update interval for the
mpd thread
2007-08-31
* _Really_ fix mpd SIGPIPE issues
* Fix timed thread race condition, seen esp. on new kernel scheduler (cfs).

View File

@ -269,6 +269,13 @@
<para></para></listitem>
</varlistentry>
<varlistentry>
<term><command><option>mpd_interval</option></command></term>
<listitem>
MPD thread update interval (defaults to Conky's update interval)
<para></para></listitem>
</varlistentry>
<varlistentry>
<term><command><option>net_avg_samples</option></command></term>
<listitem>

View File

@ -234,7 +234,7 @@ void update_stuff()
if (NEED(INFO_MPD)) {
if (!mpd_timed_thread) {
init_mpd_stats(&info);
mpd_timed_thread = timed_thread_create((void*)update_mpd, (void*) NULL, update_interval * 1000000);
mpd_timed_thread = timed_thread_create((void*)update_mpd, (void*) NULL, info.mpd.interval * 1000000);
if (!mpd_timed_thread) {
ERR("Failed to create MPD timed thread");
}

View File

@ -687,7 +687,6 @@ static void new_font(char *buf, char * args) {
struct special_t *s = new_special(buf, FONT);
int tmp = selected_font;
selected_font = s->font_added = 0;
load_fonts();
selected_font = tmp;
}
}
@ -1113,6 +1112,7 @@ enum text_object_type {
OBJ_mpd_host,
OBJ_mpd_port,
OBJ_mpd_password,
OBJ_mpd_interval,
OBJ_mpd_bar,
OBJ_mpd_elapsed,
OBJ_mpd_length,
@ -3878,9 +3878,7 @@ static void generate_text_internal(char *p, int p_max_size, struct text_object *
#endif /* __OpenBSD__ */
OBJ(font) {
#ifdef X11
new_font(p, obj->data.s);
#endif /* X11 */
}
void format_diskio(unsigned int diskio_value)
{
@ -7050,6 +7048,12 @@ else if (strcasecmp(name, a) == 0 || strcasecmp(name, b) == 0)
else
CONF_ERR;
}
CONF("mpd_interval") {
if (value)
info.mpd.interval = strtod(value, 0);
else
CONF_ERR;
}
#endif
#ifdef __OpenBSD__
CONF("sensor_device") {
@ -7318,6 +7322,12 @@ else if (strcasecmp(name, a) == 0 || strcasecmp(name, b) == 0)
update_interval = strtod(value, 0);
else
CONF_ERR;
#ifdef MPD
if (info.mpd.interval == 0) {
// default to update_interval
info.mpd.interval = update_interval;
}
#endif /* MPD */
}
CONF("total_run_times") {
if (value)
@ -7404,6 +7414,12 @@ else if (strcasecmp(name, a) == 0 || strcasecmp(name, b) == 0)
fclose(fp);
#undef CONF_ERR
#ifdef MPD
if (info.mpd.interval == 0) {
// default to update_interval
info.mpd.interval = update_interval;
}
#endif /* MPD */
}
@ -7608,6 +7624,12 @@ int main(int argc, char **argv)
case 'u':
update_interval = strtod(optarg, 0);
#ifdef MPD
if (info.mpd.interval == 0) {
// default to update_interval
info.mpd.interval = update_interval;
}
#endif /* MPD */
break;
case 'i':

View File

@ -177,6 +177,7 @@ struct mpd_s {
unsigned int port;
char host[128];
char password[128];
double interval;
float progress;
int bitrate;
int length;