summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7070837)
raw | patch | inline | side by side (parent: 7070837)
author | Kalle Wallin <kaw@linux.se> | |
Thu, 24 Jun 2004 14:26:53 +0000 (14:26 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Thu, 24 Jun 2004 14:26:53 +0000 (14:26 +0000) |
src/main.c | patch | blob | history | |
src/mpdclient.h | patch | blob | history |
diff --git a/src/main.c b/src/main.c
index f2a0e3d29a729e2016a7a5b035dceaf51c558ce4..f42a2b01c7f221514181a28b2639a6e6e9c3892e 100644 (file)
--- a/src/main.c
+++ b/src/main.c
exit_and_cleanup(void)
{
screen_exit();
+ set_xterm_title("");
printf("\n");
if( mpd )
{
}
/* set xterm title */
-#ifdef DEBUG
- options->enable_xterm_title = 1;
set_xterm_title(PACKAGE " version " VERSION);
-#endif
/* install exit function */
atexit(exit_and_cleanup);
mpd->connection->version[1],
mpd->connection->version[2]);
- if( !MPD_VERSION(mpd, 0,11,0) )
+ /* quit if mpd is pre 0.11.0 - song id not supported by mpd */
+ if( MPD_VERSION_LT(mpd, 0,11,0) )
{
- fprintf(stderr, "MPD version %d.%d.%d is to old (0.11.0 needed).\n",
+ fprintf(stderr,
+ _("Error: MPD version %d.%d.%d is to old (0.11.0 needed).\n"),
mpd->connection->version[0],
mpd->connection->version[1],
mpd->connection->version[2]);
diff --git a/src/mpdclient.h b/src/mpdclient.h
index bb8771f65a8bf8ab67b5a2ce7114026543250b60..016d1ba1b1fa54a564251a68015fe658e101a0ee 100644 (file)
--- a/src/mpdclient.h
+++ b/src/mpdclient.h
#define MPDCLIENT_H
#include "libmpdclient.h"
-#define MPD_VERSION(c,x,y,z) (c->connection->version[0]*10000+c->connection->version[1]*100+c->connection->version[2] >= \
- x*10000+y*100+z)
+#define MPD_VERSION_EQ(c,x,y,z) (c->connection->version[0] == x && \
+ c->connection->version[1] == y && \
+ c->connection->version[2] == z )
+
+#define MPD_VERSION_LT(c,x,y,z) ( c->connection->version[0]<x || \
+ (c->connection->version[0]==x && c->connection->version[1]<y) || \
+ (c->connection->version[0]==x && c->connection->version[1]==y && \
+ c->connection->version[2]<z) )
+
+
/****************************************************************************/
/* Playlist */