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

Small build fix & zero playtime and progress bars when XMMS2 playback is stopped.

patch contributed by sleipner
This commit is contained in:
Pavel Labath 2010-06-13 19:10:59 +02:00
parent c4a0916e6b
commit d8f5239360
2 changed files with 6 additions and 4 deletions

View File

@ -223,6 +223,7 @@ int handle_playback_state_change(xmmsv_t *value, void *p)
break; break;
case XMMS_PLAYBACK_STATUS_STOP: case XMMS_PLAYBACK_STATUS_STOP:
strncpy(ptr->xmms2.status, "Stopped", text_buffer_size - 1); strncpy(ptr->xmms2.status, "Stopped", text_buffer_size - 1);
ptr->xmms2.elapsed = ptr->xmms2.progress = ptr->xmms2.percent = 0;
break; break;
default: default:
strncpy(ptr->xmms2.status, "Unknown", text_buffer_size - 1); strncpy(ptr->xmms2.status, "Unknown", text_buffer_size - 1);
@ -252,7 +253,7 @@ int handle_playlist_loaded(xmmsv_t *value, void *p)
return TRUE; return TRUE;
} }
void update_xmms2(void) int update_xmms2(void)
{ {
struct information *current_info = &info; struct information *current_info = &info;
@ -266,7 +267,7 @@ void update_xmms2(void)
/* did init fail? */ /* did init fail? */
if (xmms2_conn == NULL) { if (xmms2_conn == NULL) {
fprintf(stderr,"XMMS2 init failed. %s\n", xmmsc_get_last_error(xmms2_conn)); fprintf(stderr,"XMMS2 init failed. %s\n", xmmsc_get_last_error(xmms2_conn));
return; return 0;
} }
/* init ok but not connected yet.. */ /* init ok but not connected yet.. */
@ -284,7 +285,7 @@ void update_xmms2(void)
if (!xmmsc_connect(xmms2_conn, path)) { if (!xmmsc_connect(xmms2_conn, path)) {
fprintf(stderr,"XMMS2 connection failed. %s\n", xmmsc_get_last_error(xmms2_conn)); fprintf(stderr,"XMMS2 connection failed. %s\n", xmmsc_get_last_error(xmms2_conn));
current_info->xmms2.conn_state = CONN_NO; current_info->xmms2.conn_state = CONN_NO;
return; return 0;
} }
/* set callbacks */ /* set callbacks */
@ -318,6 +319,7 @@ void update_xmms2(void)
xmmsc_io_out_handle(xmms2_conn); xmmsc_io_out_handle(xmms2_conn);
} }
return 0;
} }

View File

@ -53,6 +53,6 @@ struct xmms2_s {
int conn_state; int conn_state;
}; };
void update_xmms2(void); int update_xmms2(void);
#endif /*XMMS2_H_*/ #endif /*XMMS2_H_*/