1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-26 08:38:26 +00:00

xmms more error messages

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@497 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Philip Kovacs 2006-01-12 00:10:40 +00:00
parent dfa0ba0598
commit 3dc1345eee
2 changed files with 29 additions and 11 deletions

View File

@ -4569,13 +4569,13 @@ void reload_config(void)
if (info.xmms.thread) {
if (destroy_xmms_thread()!=0)
{
ERR("error destroying xmms thread");
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 thread!");
CRIT_ERR("unable to create xmms_player thread!");
}
#endif
extract_variable_text(text);
@ -4634,7 +4634,7 @@ void clean_up(void)
#if defined(XMMS) || defined(BMP) || defined(AUDACIOUS) || defined(INFOPIPE)
if ( info.xmms.thread && (destroy_xmms_thread()!=0) )
{
ERR("error destroying xmms thread");
ERR("error destroying xmms_player thread");
}
#endif
}
@ -5544,7 +5544,7 @@ int main(int argc, char **argv)
#if defined(XMMS) || defined(BMP) || defined(AUDACIOUS) || defined(INFOPIPE)
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
@ -5553,7 +5553,7 @@ int main(int argc, char **argv)
#if defined(XMMS) || defined(BMP) || defined(AUDACIOUS) || defined(INFOPIPE)
if ( info.xmms.thread && (destroy_xmms_thread()!=0) )
{
ERR("error destroying xmms thread");
ERR("error destroying xmms_player thread");
}
#endif

View File

@ -52,7 +52,7 @@ enum _infopipe_keys {
INFOPIPE_USEC_POSITION,
INFOPIPE_POSITION,
INFOPIPE_USEC_TIME,
INFOPIPE_TIME,
INFOPIPE_TIME,
INFOPIPE_BITRATE,
INFOPIPE_FREQUENCY,
INFOPIPE_CHANNELS,
@ -61,6 +61,14 @@ enum _infopipe_keys {
};
#endif
static char *xmms_project_name[] = {
"none",
"xmms",
"bmp",
"audacious",
"infopipe"
};
/* access to this item array is synchronized with mutexes */
static xmms_t g_items;
@ -90,8 +98,10 @@ void update_xmms(void)
int create_xmms_thread(void)
{
/* Was an an available project requested? */
if (!TEST_XMMS_PROJECT_AVAILABLE(info.xmms.project_mask, info.xmms.current_project))
if (!TEST_XMMS_PROJECT_AVAILABLE(info.xmms.project_mask, info.xmms.current_project)) {
fprintf(stderr, "xmms_player '%s' not configured\n", xmms_project_name[info.xmms.current_project]);
return(-1);
}
/* The project should not be PROJECT_NONE */
if (info.xmms.current_project==PROJECT_NONE)
@ -157,6 +167,16 @@ int destroy_xmms_thread(void)
}
#if defined(XMMS) || defined(BMP) || defined(AUDACIOUS)
void check_dlerror(void)
{
const char *error;
if ((error = dlerror()) != NULL) {
ERR("error grabbing function symbol");
pthread_exit(NULL);
}
}
/* ------------------------------------------------------------
* Worker thread function for XMMS/BMP/Audacious data sampling.
* ------------------------------------------------------------ */
@ -220,10 +240,8 @@ void *xmms_thread_func_dynamic(void *pvoid)
/* Grab the function pointers from the library */
xmms_remote_is_running = dlsym(handle, "xmms_remote_is_running");
if ((error = dlerror()) != NULL) {
ERR("error grabbing function symbol");
pthread_exit(NULL);
}
check_dlerror();
xmms_remote_is_paused = dlsym(handle, "xmms_remote_is_paused");
if ((error = dlerror()) != NULL) {
ERR("error grabbing function symbol");