" / $color${fs_free /}/${fs_size /} ${fs_bar 6 /}\n"
"${color grey}Networking:\n"
" Up:$color ${upspeed eth0} k/s${color grey} - Down:$color ${downspeed eth0} k/s\n"
- "${color grey}Temperatures:\n"
- " CPU:$color ${i2c temp 1}°C${color grey} - MB:$color ${i2c temp 2}°C\n"
"$hr\n"
#ifdef SETI
"${color grey}SETI@Home Statistics:\n"
destroy_tcp_port_monitor_collection( info.p_tcp_port_monitor_collection );
info.p_tcp_port_monitor_collection = NULL;
#endif
+#if defined(XMMS) || defined(BMP) || defined(AUDACIOUS) || defined(INFOPIPE)
+ if (info.xmms.thread) {
+ if (destroy_xmms_thread()!=0)
+ {
+ ERR("error destroying xmms_player thread");
+ }
+ }
+ if ( (!info.xmms.thread) && (info.xmms.current_project > PROJECT_NONE) &&
+ (create_xmms_thread() !=0) )
+ {
+ CRIT_ERR("unable to create xmms_player thread!");
+ }
+#endif
extract_variable_text(text);
free(text);
text = NULL;
destroy_tcp_port_monitor_collection( info.p_tcp_port_monitor_collection );
info.p_tcp_port_monitor_collection = NULL;
#endif
+#if defined(XMMS) || defined(BMP) || defined(AUDACIOUS) || defined(INFOPIPE)
+ if ( info.xmms.thread && (destroy_xmms_thread()!=0) )
+ {
+ ERR("error destroying xmms_player thread");
+ }
+#endif
}
static int string_to_bool(const char *s)
tcp_port_monitor_collection_args.min_port_monitors = MIN_PORT_MONITORS_DEFAULT;
tcp_port_monitor_args.min_port_monitor_connections = MIN_PORT_MONITOR_CONNECTIONS_DEFAULT;
#endif
+
+#if defined(XMMS) || defined(BMP) || defined(AUDACIOUS) || defined(INFOPIPE)
+ info.xmms.current_project=PROJECT_NONE;
+#endif
}
static void load_config_file(const char *f)
CONF_ERR;
}
#endif /* X11 */
+#if defined(XMMS) || defined(BMP) || defined(AUDACIOUS) || defined(INFOPIPE)
+ CONF("xmms_player") {
+ if (value) {
+ if (strncmp(value,"none",4)==0)
+ info.xmms.current_project=PROJECT_NONE;
+ else if (strncmp(value,"xmms",4)==0)
+ info.xmms.current_project=PROJECT_XMMS;
+ else if (strncmp(value,"bmp",3)==0)
+ info.xmms.current_project=PROJECT_BMP;
+ else if (strncmp(value,"audacious",9)==0)
+ info.xmms.current_project=PROJECT_AUDACIOUS;
+ else if (strncmp(value,"infopipe",8)==0)
+ info.xmms.current_project=PROJECT_INFOPIPE;
+ else
+ CONF_ERR;
+ }
+ else
+ CONF_ERR;
+ }
+#endif
#ifdef MPD
CONF("mpd_host") {
if (value)
tcp_port_monitor_collection_args.min_port_monitors = MIN_PORT_MONITORS_DEFAULT;
tcp_port_monitor_args.min_port_monitor_connections = MIN_PORT_MONITOR_CONNECTIONS_DEFAULT;
#endif
+
+#if defined(XMMS)
+ SET_XMMS_PROJECT_AVAILABLE(info.xmms.project_mask, PROJECT_XMMS);
+#endif
+#if defined(BMP)
+ SET_XMMS_PROJECT_AVAILABLE(info.xmms.project_mask, PROJECT_BMP);
+#endif
+#if defined(AUDACIOUS)
+ SET_XMMS_PROJECT_AVAILABLE(info.xmms.project_mask, PROJECT_AUDACIOUS);
+#endif
+#if defined(INFOPIPE)
+ SET_XMMS_PROJECT_AVAILABLE(info.xmms.project_mask, PROJECT_INFOPIPE);
+#endif
/* handle command line parameters that don't change configs */
#ifdef X11
}
#if defined(XMMS) || defined(BMP) || defined(AUDACIOUS) || defined(INFOPIPE)
- /* joinable thread for xmms activity */
- pthread_attr_init(&info.xmms.thread_attr);
- pthread_attr_setdetachstate(&info.xmms.thread_attr, PTHREAD_CREATE_JOINABLE);
- /* init mutexex */
- pthread_mutex_init(&info.xmms.item_mutex, NULL);
- pthread_mutex_init(&info.xmms.runnable_mutex, NULL);
- /* init runnable condition for worker thread */
- pthread_mutex_lock(&info.xmms.runnable_mutex);
- info.xmms.runnable=1;
- pthread_mutex_unlock(&info.xmms.runnable_mutex);
- if (pthread_create(&info.xmms.thread, &info.xmms.thread_attr, xmms_thread_func, NULL))
+ if ( (info.xmms.current_project > PROJECT_NONE) && (create_xmms_thread() !=0) )
{
- CRIT_ERR("unable to create xmms thread!");
+ CRIT_ERR("unable to create xmms_player thread!");
}
#endif
main_loop();
#if defined(XMMS) || defined(BMP) || defined(AUDACIOUS) || defined(INFOPIPE)
- /* signal xmms worker thread to terminate */
- pthread_mutex_lock(&info.xmms.runnable_mutex);
- info.xmms.runnable=0;
- pthread_mutex_unlock(&info.xmms.runnable_mutex);
- /* destroy thread attribute and wait for thread */
- pthread_attr_destroy(&info.xmms.thread_attr);
- if (pthread_join(info.xmms.thread, NULL))
+ if ( info.xmms.thread && (destroy_xmms_thread()!=0) )
{
- ERR("error joining xmms thread");
+ ERR("error destroying xmms_player thread");
}
- /* destroy mutexes */
- pthread_mutex_destroy(&info.xmms.item_mutex);
- pthread_mutex_destroy(&info.xmms.runnable_mutex);
#endif
return 0;