--- xmms-infopipe-1.0/src/infopipe.c Sun Dec 10 12:44:30 2000 +++ /usr/local/src/xmms-infopipe-1.0/src/infopipe.c Mon Feb 5 19:03:08 2001 @@ -135,19 +135,25 @@ void request_handler_thread(void) { FILE *p; /* Stream to be associated with the pipe. */ + int fd; /* File descriptor of the fifo file */ while(1) { - - p = fopen(FIFO_FILE,"w"); - + fd = open(FIFO_FILE, O_RDWR | O_NONBLOCK); + if(fd < 0) { + fprintf(stderr, "Pipe open failed"); + xmms_remote_quit(infopipe_gp.xmms_session); + } + + p = fdopen(fd,"w"); if(p == NULL) { fprintf(stderr,"Pipe open failed"); xmms_remote_quit(infopipe_gp.xmms_session); } + blast_info(p); - + fclose(p); - usleep(500); /* This to prevent duplicate information. */ + sleep(1); /* This to prevent duplicate information. */ } } @@ -183,4 +189,9 @@ xmms_remote_get_playlist_title(infopipe_gp.xmms_session,current)); fprintf(pipe, "File: %s\n", xmms_remote_get_playlist_file(infopipe_gp.xmms_session,current)); + + fprintf(pipe, "Is playing: %s\n", + xmms_remote_is_playing(infopipe_gp.xmms_session) ? "yes" : "no"); + fprintf(pipe, "Is paused: %s\n", + xmms_remote_is_paused(infopipe_gp.xmms_session) ? "yes" : "no"); }