mpd_interval -> music_player_interval
authorPhilip Kovacs <pkovacs@users.sourceforge.net>
Sun, 2 Sep 2007 04:26:08 +0000 (04:26 +0000)
committerPhilip Kovacs <pkovacs@users.sourceforge.net>
Sun, 2 Sep 2007 04:26:08 +0000 (04:26 +0000)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@957 7f574dfc-610e-0410-a909-a81674777703

ChangeLog
doc/config_settings.xml
extras/nano/conky.nanorc
extras/vim/syntax/conkyrc.vim
src/audacious.c
src/common.c
src/conky.c
src/conky.h

index 2b564ca..0ce6301 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,8 +2,8 @@
 
 2007-09-01
        * Improved performance slightly
-       * Added 'mpd_interval' config option to specify an update interval for the
-       mpd thread
+       * Added 'music_player_interval' config option to specify an update interval for
+                       music player threads (currently honored by mpd and audacious).
        * Fixed some minor memory leaks associated with SIGUSR1
 
 2007-08-31
index 7f3a01a..515a831 100644 (file)
 </varlistentry>
 
 <varlistentry>
-       <term><command><option>mpd_interval</option></command></term>
+       <term><command><option>music_player_interval</option></command></term>
        <listitem>
-               MPD thread update interval (defaults to Conky's update interval)
+               Music player thread update interval (defaults to Conky's update interval)
        <para></para></listitem>
 </varlistentry>
 
index 0386246..1ac6297 100644 (file)
@@ -6,7 +6,7 @@
 syntax "conky" "\.*conkyrc.*$"
 
 ## Configuration items
-color green "\<(alignment|background|border_margin|border_width|cpu_avg_samples|default_color|default_shade_color|default_outline_color|double_buffer|draw_borders|draw_graph_borders|draw_shades|draw_outline|font|gap_x|gap_y|imap|mail_spool|max_port_monitor_connections|max_specials|max_user_text|maximum_width|minimum_size|mpd_host|mpd_port|mpd_password|net_avg_samples|no_buffers|out_to_console|override_utf8_locale|own_window|own_window_class|own_window_colour|own_window_hints|own_window_title|own_window_transparent|own_window_type|pad_percents|pop3|stippled_borders|total_run_times|update_interval|uppercase|use_spacer|use_xft|xftalpha|xftfont)\>"
+color green "\<(alignment|background|border_margin|border_width|cpu_avg_samples|default_color|default_shade_color|default_outline_color|double_buffer|draw_borders|draw_graph_borders|draw_shades|draw_outline|font|gap_x|gap_y|imap|mail_spool|max_port_monitor_connections|max_specials|max_user_text|maximum_width|minimum_size|mpd_host|mpd_port|mpd_password|music_player_interval|net_avg_samples|no_buffers|out_to_console|override_utf8_locale|own_window|own_window_class|own_window_colour|own_window_hints|own_window_title|own_window_transparent|own_window_type|pad_percents|pop3|stippled_borders|total_run_times|update_interval|uppercase|use_spacer|use_xft|xftalpha|xftfont)\>"
 
 ## Variables
 color brightblue "\<(acpiacadapter|acpifan|acpitemp|acpitempf|addr|adt746xcpu|adt746xfan|align|alignr|apm_adapter|apm_battery_life|apm_battery_time|audacious_bar|audacious_bitrate|audacious_channels|audacious_filename|audacious_frequency|audacious_length|audacious_length_seconds|audacious_playlist_length|audacious_playlist_position|audacious_position|audacious_position_seconds|audacious_status|audacious_title|battery|battery_time|bmpx_album|bmpx_artist|bmpx_bitrate|bmpx_title|bmpx_track|bmpx_uri|buffers|cached|color|colour|cpu|cpubar|diskio|downspeed|downspeedf|else|entropy_avail|entropy_bar|entropy_poolsize|exec|execbar|execgraph|execi|execibar|execigraph|font|freq|freq_dyn|freq_dyn_g|freq_g|fs_bar|fs_free|fs_free_perc|fs_size|fs_used|goto|hddtemp|head|hr|hwmon|i2c|i8k_ac_status|i8k_bios|i8k_buttons_status|i8k_cpu_temp|i8k_cpu_tempf|i8k_left_fan_rpm|i8k_left_fan_status|i8k_right_fan_rpm|i8k_right_fan_status|i8k_serial|i8k_version|if_existing|if_running|if_mounted|kernel|linkstatus|loadavg|machine|mails|mem|membar|memmax|memperc|mpd_album|mpd_artist|mpd_bar|mpd_bitrate|mpd_elapsed|mpd_file|mpd_length|mpd_name|mpd_percent|mpd_smart|mpd_status|mpd_title|mpd_vol|new_mails|nodename|offset|outlinecolor|platform|pre_exec|processes|running_processes|shadecolor|stippled_hr|swap|swapbar|swapmax|swapperc|sysname|tab|tail|tcp_portmon|texeci|time|top|top_mem|totaldown|totalup|tztime|updates|upspeed|upspeedf|upspeedgraph|uptime|uptime_short|voffset|voltage_mv|voltage_v)\>"
index e6f9794..cb820d0 100644 (file)
@@ -40,6 +40,7 @@ syn keyword ConkyrcSetting
         \ mpd_host
         \ mpd_password
         \ mpd_port
+        \ music_player_interval
         \ net_avg_samples
         \ no_buffers
         \ out_to_console
index 330365d..9f40516 100644 (file)
@@ -63,7 +63,8 @@ void update_audacious(void)
 int create_audacious_thread(void)
 {
   if (!info.audacious.p_timed_thread)
-    info.audacious.p_timed_thread = timed_thread_create (audacious_thread_func, NULL, 1000000);
+    info.audacious.p_timed_thread = 
+      timed_thread_create (audacious_thread_func, NULL, info.music_player_interval * 1000000);
 
   if (!info.audacious.p_timed_thread || timed_thread_run (info.audacious.p_timed_thread))
     return (-1);
index 1bb7eb1..9447b42 100644 (file)
@@ -234,7 +234,8 @@ 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, info.mpd.interval * 1000000);
+                       mpd_timed_thread = 
+        timed_thread_create((void*)update_mpd, (void*) NULL, info.music_player_interval * 1000000);
                        if (!mpd_timed_thread) {
                                ERR("Failed to create MPD timed thread");
                        }
index 772ac26..03b2f23 100644 (file)
@@ -1111,7 +1111,6 @@ 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,
@@ -1121,6 +1120,7 @@ enum text_object_type {
        OBJ_mpd_percent,
        OBJ_mpd_smart,
 #endif
+  OBJ_music_player_interval,
 #ifdef XMMS2
     OBJ_xmms2_artist,
     OBJ_xmms2_album,
@@ -7065,13 +7065,13 @@ 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
+    CONF("music_player_interval") {
+      if (value)
+        info.music_player_interval = strtod(value, 0);
+      else
+        CONF_ERR;
+      }
 #ifdef __OpenBSD__
                CONF("sensor_device") {
                        if(value)
@@ -7339,12 +7339,10 @@ 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) {
+                       if (info.music_player_interval == 0) {
                                // default to update_interval
-                               info.mpd.interval = update_interval;
+                               info.music_player_interval = update_interval;
                        }
-#endif /* MPD */
                }
                CONF("total_run_times") {
                        if (value)
@@ -7431,12 +7429,10 @@ else if (strcasecmp(name, a) == 0 || strcasecmp(name, b) == 0)
        fclose(fp);
 #undef CONF_ERR
 
-#ifdef MPD
-       if (info.mpd.interval == 0) {
+       if (info.music_player_interval == 0) {
                // default to update_interval
-               info.mpd.interval = update_interval;
+               info.music_player_interval = update_interval;
        }
-#endif /* MPD */
 
 }
 
@@ -7641,12 +7637,10 @@ int main(int argc, char **argv)
 
                case 'u':
                        update_interval = strtod(optarg, 0);
-#ifdef MPD
-                       if (info.mpd.interval == 0) {
+                       if (info.music_player_interval == 0) {
                                // default to update_interval
-                               info.mpd.interval = update_interval;
+                               info.music_player_interval = update_interval;
                        }
-#endif /* MPD */
                        break;
 
                case 'i':
index b46ece0..894d5a7 100644 (file)
@@ -177,7 +177,6 @@ struct mpd_s {
        unsigned int port;
        char host[128];
        char password[128];
-       double interval;
        float progress;
        int bitrate;
        int length;
@@ -351,6 +350,7 @@ struct information {
 #endif
        short kflags;  /* kernel settings, see enum KFLAG */
        struct entropy_s entropy;
+  double music_player_interval;
 };
 
 enum {