2005-07-20 00:30:40 +00:00
|
|
|
#include "conky.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "libmpdclient.h"
|
|
|
|
|
|
|
|
|
|
|
|
void update_mpd()
|
|
|
|
{
|
|
|
|
struct information *current_info = &info;
|
|
|
|
current_info->conn =
|
2006-01-31 03:32:26 +00:00
|
|
|
mpd_newConnection(current_info->mpd.host,
|
|
|
|
current_info->mpd.port, 10);
|
|
|
|
if (strlen(current_info->mpd.password) > 1) {
|
|
|
|
mpd_sendPasswordCommand(current_info->conn,
|
|
|
|
current_info->mpd.password);
|
|
|
|
mpd_finishCommand(current_info->conn);
|
|
|
|
}
|
2005-07-20 00:30:40 +00:00
|
|
|
if (current_info->conn->error) {
|
2006-01-31 03:32:26 +00:00
|
|
|
//ERR("%MPD error: s\n", current_info->conn->errorStr);
|
2005-07-20 00:30:40 +00:00
|
|
|
mpd_closeConnection(current_info->conn);
|
2005-07-28 04:48:27 +00:00
|
|
|
if (current_info->mpd.artist == NULL)
|
|
|
|
current_info->mpd.artist =
|
2006-01-31 03:32:26 +00:00
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
2005-07-28 04:48:27 +00:00
|
|
|
if (current_info->mpd.album == NULL)
|
2005-07-26 05:22:23 +00:00
|
|
|
current_info->mpd.album = malloc(TEXT_BUFFER_SIZE);
|
2005-07-28 04:48:27 +00:00
|
|
|
if (current_info->mpd.title == NULL)
|
2005-07-26 05:22:23 +00:00
|
|
|
current_info->mpd.title = malloc(TEXT_BUFFER_SIZE);
|
2005-10-11 01:37:46 +00:00
|
|
|
if (current_info->mpd.random == NULL)
|
2006-01-31 03:32:26 +00:00
|
|
|
current_info->mpd.random =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
2005-10-11 01:37:46 +00:00
|
|
|
if (current_info->mpd.repeat == NULL)
|
2006-01-31 03:32:26 +00:00
|
|
|
current_info->mpd.repeat =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
2005-10-11 01:37:46 +00:00
|
|
|
if (current_info->mpd.track == NULL)
|
|
|
|
current_info->mpd.track = malloc(TEXT_BUFFER_SIZE);
|
2006-01-31 03:32:26 +00:00
|
|
|
if (current_info->mpd.status == NULL)
|
|
|
|
current_info->mpd.status =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.name == NULL)
|
|
|
|
current_info->mpd.name = malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.file == NULL)
|
|
|
|
current_info->mpd.file = malloc(TEXT_BUFFER_SIZE);
|
|
|
|
strncpy(current_info->mpd.name, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.file, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.artist, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.album, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.title, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.random, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.repeat, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.track, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
if (strlen(current_info->conn->errorStr) > 1) {
|
|
|
|
strncpy(current_info->mpd.status,
|
|
|
|
current_info->conn->errorStr,
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
} else {
|
|
|
|
strncpy(current_info->mpd.status,
|
|
|
|
"MPD not responding",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
}
|
2005-07-28 04:48:27 +00:00
|
|
|
current_info->mpd.bitrate = 0;
|
|
|
|
current_info->mpd.progress = 0;
|
|
|
|
current_info->mpd.elapsed = 0;
|
|
|
|
current_info->mpd.length = 0;
|
2005-07-20 00:30:40 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2005-07-28 04:48:27 +00:00
|
|
|
mpd_Status *status;
|
2005-07-20 00:30:40 +00:00
|
|
|
mpd_InfoEntity *entity;
|
|
|
|
mpd_sendCommandListOkBegin(current_info->conn);
|
|
|
|
mpd_sendStatusCommand(current_info->conn);
|
|
|
|
mpd_sendCurrentSongCommand(current_info->conn);
|
|
|
|
mpd_sendCommandListEnd(current_info->conn);
|
2005-07-28 04:48:27 +00:00
|
|
|
if ((status = mpd_getStatus(current_info->conn)) == NULL) {
|
2006-01-31 03:32:26 +00:00
|
|
|
//ERR("MPD error: %s\n", current_info->conn->errorStr);
|
2005-07-20 00:30:40 +00:00
|
|
|
mpd_closeConnection(current_info->conn);
|
2005-07-28 04:48:27 +00:00
|
|
|
if (current_info->mpd.artist == NULL)
|
|
|
|
current_info->mpd.artist =
|
2006-01-31 03:32:26 +00:00
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
2005-07-28 04:48:27 +00:00
|
|
|
if (current_info->mpd.album == NULL)
|
2005-07-26 05:22:23 +00:00
|
|
|
current_info->mpd.album = malloc(TEXT_BUFFER_SIZE);
|
2005-07-28 04:48:27 +00:00
|
|
|
if (current_info->mpd.title == NULL)
|
2005-07-26 05:22:23 +00:00
|
|
|
current_info->mpd.title = malloc(TEXT_BUFFER_SIZE);
|
2005-10-11 01:37:46 +00:00
|
|
|
if (current_info->mpd.random == NULL)
|
2006-01-31 03:32:26 +00:00
|
|
|
current_info->mpd.random =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.repeat == NULL)
|
|
|
|
current_info->mpd.repeat =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
2005-10-11 01:37:46 +00:00
|
|
|
if (current_info->mpd.track == NULL)
|
|
|
|
current_info->mpd.track = malloc(TEXT_BUFFER_SIZE);
|
2006-01-31 03:32:26 +00:00
|
|
|
if (current_info->mpd.status == NULL)
|
|
|
|
current_info->mpd.status =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.name == NULL)
|
|
|
|
current_info->mpd.name = malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.file == NULL)
|
|
|
|
current_info->mpd.file = malloc(TEXT_BUFFER_SIZE);
|
|
|
|
strncpy(current_info->mpd.name, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.file, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.artist, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.album, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.title, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.random, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.repeat, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.track, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
if (strlen(current_info->conn->errorStr) > 1) {
|
|
|
|
strncpy(current_info->mpd.status,
|
|
|
|
current_info->conn->errorStr,
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
} else {
|
|
|
|
strncpy(current_info->mpd.status,
|
|
|
|
"MPD not responding",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
}
|
2005-07-28 04:48:27 +00:00
|
|
|
current_info->mpd.bitrate = 0;
|
|
|
|
current_info->mpd.progress = 0;
|
|
|
|
current_info->mpd.elapsed = 0;
|
|
|
|
current_info->mpd.length = 0;
|
2005-07-20 00:30:40 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
current_info->mpd.volume = status->volume;
|
|
|
|
//if (status->error)
|
2005-07-28 04:48:27 +00:00
|
|
|
//printf("error: %s\n", status->error);
|
2005-07-20 00:30:40 +00:00
|
|
|
|
2005-07-28 04:48:27 +00:00
|
|
|
if (status->state == MPD_STATUS_STATE_PLAY) {
|
2006-01-31 03:32:26 +00:00
|
|
|
if (current_info->mpd.status == NULL)
|
|
|
|
current_info->mpd.status =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
|
|
|
strncpy(current_info->mpd.status, "Playing",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
2005-07-20 00:30:40 +00:00
|
|
|
}
|
2005-07-28 04:48:27 +00:00
|
|
|
if (status->state == MPD_STATUS_STATE_STOP) {
|
2005-07-29 02:52:08 +00:00
|
|
|
current_info->mpd.bitrate = 0;
|
|
|
|
current_info->mpd.progress = 0;
|
|
|
|
current_info->mpd.elapsed = 0;
|
|
|
|
current_info->mpd.length = 0;
|
2005-09-04 03:43:18 +00:00
|
|
|
if (current_info->mpd.artist == NULL)
|
|
|
|
current_info->mpd.artist =
|
2006-01-31 03:32:26 +00:00
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
2005-09-04 03:43:18 +00:00
|
|
|
if (current_info->mpd.album == NULL)
|
|
|
|
current_info->mpd.album = malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.title == NULL)
|
|
|
|
current_info->mpd.title = malloc(TEXT_BUFFER_SIZE);
|
2005-10-11 01:37:46 +00:00
|
|
|
if (current_info->mpd.random == NULL)
|
2006-01-31 03:32:26 +00:00
|
|
|
current_info->mpd.random =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
2005-10-11 01:37:46 +00:00
|
|
|
if (current_info->mpd.repeat == NULL)
|
2006-01-31 03:32:26 +00:00
|
|
|
current_info->mpd.repeat =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
2005-10-11 01:37:46 +00:00
|
|
|
if (current_info->mpd.track == NULL)
|
|
|
|
current_info->mpd.track = malloc(TEXT_BUFFER_SIZE);
|
2006-01-31 03:32:26 +00:00
|
|
|
if (current_info->mpd.status == NULL)
|
|
|
|
current_info->mpd.status =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.name == NULL)
|
|
|
|
current_info->mpd.name = malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.file == NULL)
|
|
|
|
current_info->mpd.file = malloc(TEXT_BUFFER_SIZE);
|
|
|
|
strncpy(current_info->mpd.name, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.file, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.artist, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.album, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.title, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.random, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.repeat, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.track, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.status, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
2005-07-20 00:30:40 +00:00
|
|
|
}
|
2005-07-28 04:48:27 +00:00
|
|
|
if (status->state == MPD_STATUS_STATE_PAUSE) {
|
2006-01-31 03:32:26 +00:00
|
|
|
if (current_info->mpd.status == NULL)
|
|
|
|
current_info->mpd.status =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
|
|
|
strncpy(current_info->mpd.status, "Paused",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
2005-07-20 00:30:40 +00:00
|
|
|
}
|
2005-07-28 04:48:27 +00:00
|
|
|
if (status->state == MPD_STATUS_STATE_UNKNOWN) {
|
2005-07-29 02:52:08 +00:00
|
|
|
current_info->mpd.bitrate = 0;
|
|
|
|
current_info->mpd.progress = 0;
|
|
|
|
current_info->mpd.elapsed = 0;
|
|
|
|
current_info->mpd.length = 0;
|
2005-09-04 03:43:18 +00:00
|
|
|
if (current_info->mpd.artist == NULL)
|
|
|
|
current_info->mpd.artist =
|
2006-01-31 03:32:26 +00:00
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
2005-09-04 03:43:18 +00:00
|
|
|
if (current_info->mpd.album == NULL)
|
|
|
|
current_info->mpd.album = malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.title == NULL)
|
|
|
|
current_info->mpd.title = malloc(TEXT_BUFFER_SIZE);
|
2005-10-11 01:37:46 +00:00
|
|
|
if (current_info->mpd.random == NULL)
|
2006-01-31 03:32:26 +00:00
|
|
|
current_info->mpd.random =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
2005-10-11 01:37:46 +00:00
|
|
|
if (current_info->mpd.repeat == NULL)
|
2006-01-31 03:32:26 +00:00
|
|
|
current_info->mpd.repeat =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
2005-10-11 01:37:46 +00:00
|
|
|
if (current_info->mpd.track == NULL)
|
|
|
|
current_info->mpd.track = malloc(TEXT_BUFFER_SIZE);
|
2006-01-31 03:32:26 +00:00
|
|
|
if (current_info->mpd.status == NULL)
|
|
|
|
current_info->mpd.status =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.name == NULL)
|
|
|
|
current_info->mpd.name = malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.file == NULL)
|
|
|
|
current_info->mpd.file = malloc(TEXT_BUFFER_SIZE);
|
|
|
|
strncpy(current_info->mpd.name, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.file, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.artist, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.album, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.title, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.random, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.repeat, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.track, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
strncpy(current_info->mpd.status, "Unknown",
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
2005-07-20 00:30:40 +00:00
|
|
|
}
|
2005-07-28 04:48:27 +00:00
|
|
|
if (status->state == MPD_STATUS_STATE_PLAY ||
|
2006-01-31 03:32:26 +00:00
|
|
|
status->state == MPD_STATUS_STATE_PAUSE) {
|
2005-07-20 00:30:40 +00:00
|
|
|
current_info->mpd.bitrate = status->bitRate;
|
2005-07-28 04:48:27 +00:00
|
|
|
current_info->mpd.progress =
|
2006-01-31 03:32:26 +00:00
|
|
|
(float) status->elapsedTime / status->totalTime;
|
2005-07-28 04:48:27 +00:00
|
|
|
current_info->mpd.elapsed = status->elapsedTime;
|
|
|
|
current_info->mpd.length = status->totalTime;
|
2006-01-31 03:32:26 +00:00
|
|
|
if (current_info->mpd.random == NULL)
|
|
|
|
current_info->mpd.random =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.repeat == NULL)
|
|
|
|
current_info->mpd.repeat =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (status->random == 0) {
|
|
|
|
strcpy(current_info->mpd.random, "Off");
|
|
|
|
} else if (status->random == 1) {
|
|
|
|
strcpy(current_info->mpd.random, "On");
|
|
|
|
} else {
|
|
|
|
strcpy(current_info->mpd.random, "Unknown");
|
|
|
|
}
|
|
|
|
if (status->repeat == 0) {
|
|
|
|
strcpy(current_info->mpd.repeat, "Off");
|
|
|
|
} else if (status->repeat == 1) {
|
|
|
|
strcpy(current_info->mpd.repeat, "On");
|
|
|
|
} else {
|
|
|
|
strcpy(current_info->mpd.repeat, "Unknown");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (current_info->conn->error) {
|
2005-07-20 00:30:40 +00:00
|
|
|
//fprintf(stderr, "%s\n", current_info->conn->errorStr);
|
2006-01-31 03:32:26 +00:00
|
|
|
mpd_closeConnection(current_info->conn);
|
|
|
|
return;
|
|
|
|
}
|
2005-07-20 00:30:40 +00:00
|
|
|
|
2006-01-31 03:32:26 +00:00
|
|
|
mpd_nextListOkCommand(current_info->conn);
|
2005-07-20 00:30:40 +00:00
|
|
|
|
2006-01-31 03:32:26 +00:00
|
|
|
while ((entity = mpd_getNextInfoEntity(current_info->conn))) {
|
|
|
|
mpd_Song *song = entity->info.song;
|
|
|
|
if (entity->type != MPD_INFO_ENTITY_TYPE_SONG) {
|
|
|
|
mpd_freeInfoEntity(entity);
|
|
|
|
continue;
|
|
|
|
}
|
2005-07-20 00:30:40 +00:00
|
|
|
|
2006-01-31 03:32:26 +00:00
|
|
|
if (current_info->mpd.artist == NULL)
|
|
|
|
current_info->mpd.artist =
|
|
|
|
malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.album == NULL)
|
|
|
|
current_info->mpd.album = malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.title == NULL)
|
|
|
|
current_info->mpd.title = malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.track == NULL)
|
|
|
|
current_info->mpd.track = malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.name == NULL)
|
|
|
|
current_info->mpd.name = malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (current_info->mpd.file == NULL)
|
|
|
|
current_info->mpd.file = malloc(TEXT_BUFFER_SIZE);
|
|
|
|
if (song->artist) {
|
|
|
|
strncpy(current_info->mpd.artist, song->artist,
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
} else {
|
|
|
|
strcpy(current_info->mpd.artist, "Unknown");
|
|
|
|
}
|
|
|
|
if (song->album) {
|
|
|
|
strncpy(current_info->mpd.album, song->album,
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
} else {
|
|
|
|
strcpy(current_info->mpd.album, "Unknown");
|
|
|
|
}
|
|
|
|
if (song->title) {
|
|
|
|
strncpy(current_info->mpd.title, song->title,
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
} else {
|
|
|
|
strcpy(current_info->mpd.title, "Unknown");
|
|
|
|
}
|
|
|
|
if (song->track) {
|
|
|
|
strncpy(current_info->mpd.track, song->track,
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
} else {
|
|
|
|
strcpy(current_info->mpd.track, "Unknown");
|
|
|
|
}
|
|
|
|
if (song->name) {
|
|
|
|
strncpy(current_info->mpd.name, song->name,
|
|
|
|
TEXT_BUFFER_SIZE - 1);
|
|
|
|
} else {
|
|
|
|
strcpy(current_info->mpd.name, "Unknown");
|
|
|
|
}
|
|
|
|
if (song->file) {
|
|
|
|
strncpy(current_info->mpd.file,
|
|
|
|
song->file, TEXT_BUFFER_SIZE - 1);
|
|
|
|
} else {
|
|
|
|
strcpy(current_info->mpd.file, "Unknown");
|
|
|
|
}
|
|
|
|
if (entity != NULL) {
|
|
|
|
mpd_freeInfoEntity(entity);
|
|
|
|
entity = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (entity != NULL) {
|
|
|
|
mpd_freeInfoEntity(entity);
|
|
|
|
entity = NULL;
|
|
|
|
}
|
2005-07-28 04:48:27 +00:00
|
|
|
|
2006-01-31 03:32:26 +00:00
|
|
|
if (current_info->conn->error) {
|
2005-07-20 00:30:40 +00:00
|
|
|
//fprintf(stderr, "%s\n", current_info->conn->errorStr);
|
2006-01-31 03:32:26 +00:00
|
|
|
mpd_closeConnection(current_info->conn);
|
|
|
|
return;
|
|
|
|
}
|
2005-07-20 00:30:40 +00:00
|
|
|
|
2006-01-31 03:32:26 +00:00
|
|
|
mpd_finishCommand(current_info->conn);
|
|
|
|
if (current_info->conn->error) {
|
2005-07-20 00:30:40 +00:00
|
|
|
//fprintf(stderr, "%s\n", current_info->conn->errorStr);
|
2006-01-31 03:32:26 +00:00
|
|
|
mpd_closeConnection(current_info->conn);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
mpd_freeStatus(status);
|
|
|
|
mpd_closeConnection(current_info->conn);
|
|
|
|
}
|