1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-25 04:06:03 +00:00

- Fix BMPx support. BMPx 0.14.0 or newer is required now

- Add forgotten headers for imap stuff to fix build on FreeBSD


git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@629 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Roman Bogorodskiy 2006-05-12 12:41:18 +00:00
parent adbacc9f25
commit ff1404dab2
3 changed files with 14 additions and 18 deletions

View File

@ -266,13 +266,9 @@ AC_ARG_ENABLE(bmpx,
AM_CONDITIONAL(BUILD_BMPX, test x$want_bmpx = xyes) AM_CONDITIONAL(BUILD_BMPX, test x$want_bmpx = xyes)
if test x$want_bmpx = xyes; then if test x$want_bmpx = xyes; then
PKG_CHECK_MODULES([DBUS], [dbus-1 >= 0.35 dbus-glib-1 >= 0.35]) PKG_CHECK_MODULES([BMPX], [bmp-2.0 >= 0.14.0])
CFLAGS="$CFLAGS $DBUS_CFLAGS" CFLAGS="$CFLAGS $BMPX_CFLAGS"
LIBS="$LIBS $DBUS_LIBS" LIBS="$LIBS $BMPX_LIBS"
AC_CHECK_HEADERS([bmpx/dbus.h], [], [BMPX_MISSING=yes])
if test "x$BMPX_MISSING" = xyes; then
AC_MSG_ERROR([bmpx doesn't seem to be installed, or the headers aren't available])
fi
AC_DEFINE(BMPX, 1, [Define if you want BMPx support]) AC_DEFINE(BMPX, 1, [Define if you want BMPx support])
fi fi

View File

@ -5,7 +5,7 @@
* $Id$ * $Id$
*/ */
#include <bmpx/dbus.h> #include <bmp/dbus.h>
#include <dbus/dbus-glib.h> #include <dbus/dbus-glib.h>
#include <stdio.h> #include <stdio.h>
@ -24,7 +24,7 @@ void update_bmpx()
{ {
GError *error = NULL; GError *error = NULL;
struct information *current_info = &info; struct information *current_info = &info;
gchar *uri; gint current_track;
GHashTable *metadata; GHashTable *metadata;
if (connected == 0) { if (connected == 0) {
@ -39,7 +39,7 @@ void update_bmpx()
remote_object = dbus_g_proxy_new_for_name(bus, remote_object = dbus_g_proxy_new_for_name(bus,
BMP_DBUS_SERVICE, BMP_DBUS_SERVICE,
BMP_DBUS_PATH_SYSTEMCONTROL, BMP_DBUS_PATH,
BMP_DBUS_INTERFACE); BMP_DBUS_INTERFACE);
if (!remote_object) { if (!remote_object) {
ERR("BMPx error 2: %s\n", error->message); ERR("BMPx error 2: %s\n", error->message);
@ -50,18 +50,17 @@ void update_bmpx()
} }
if (connected == 1) { if (connected == 1) {
if (dbus_g_proxy_call(remote_object, "GetCurrentUri", &error, if (dbus_g_proxy_call(remote_object, "GetCurrentTrack", &error,
G_TYPE_INVALID, G_TYPE_INVALID,
G_TYPE_STRING, &uri, G_TYPE_INVALID)) { G_TYPE_INT, &current_track, G_TYPE_INVALID)) {
current_info->bmpx.uri = uri;
} else { } else {
ERR("BMPx error 3: %s\n", error->message); ERR("BMPx error 3: %s\n", error->message);
goto fail; goto fail;
} }
if (dbus_g_proxy_call(remote_object, "GetMetadataForUri", &error, if (dbus_g_proxy_call(remote_object, "GetMetadataForListItem", &error,
G_TYPE_STRING, G_TYPE_INT,
uri, current_track,
G_TYPE_INVALID, G_TYPE_INVALID,
DBUS_TYPE_G_STRING_VALUE_HASHTABLE, DBUS_TYPE_G_STRING_VALUE_HASHTABLE,
&metadata, &metadata,
@ -83,13 +82,12 @@ void update_bmpx()
current_info->bmpx.album = g_value_dup_string(g_hash_table_lookup(metadata, "album")); current_info->bmpx.album = g_value_dup_string(g_hash_table_lookup(metadata, "album"));
current_info->bmpx.bitrate = g_value_get_int(g_hash_table_lookup(metadata, "bitrate")); current_info->bmpx.bitrate = g_value_get_int(g_hash_table_lookup(metadata, "bitrate"));
current_info->bmpx.track = g_value_get_int(g_hash_table_lookup(metadata, "track-number")); current_info->bmpx.track = g_value_get_int(g_hash_table_lookup(metadata, "track-number"));
current_info->bmpx.uri = g_value_get_string(g_hash_table_lookup(metadata, "location"));
} else { } else {
ERR("BMPx error 4: %s\n", error->message); ERR("BMPx error 4: %s\n", error->message);
goto fail; goto fail;
} }
if (uri)
free(uri);
g_hash_table_destroy(metadata); g_hash_table_destroy(metadata);
} else { } else {
fail: fail:

View File

@ -29,6 +29,8 @@
#endif /* X11 */ #endif /* X11 */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <netinet/in.h>
#include <netdb.h>
#define CONFIG_FILE "$HOME/.conkyrc" #define CONFIG_FILE "$HOME/.conkyrc"
#define MAIL_FILE "$MAIL" #define MAIL_FILE "$MAIL"