1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-18 02:55:12 +00:00

Merge back bmpx WIP, committed by mistake.

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@687 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Roman Bogorodskiy 2006-08-12 05:28:27 +00:00
parent bce19ecc84
commit d21378f258

View File

@ -57,15 +57,7 @@ void update_bmpx()
ERR("BMPx error 3: %s\n", error->message); ERR("BMPx error 3: %s\n", error->message);
goto fail; goto fail;
} }
if (current_track == -1) {
printf("Here!!!\n");
goto fail;
}
printf("Here!!! ct = %d\n", current_track);
if (dbus_g_proxy_call(remote_object, "GetMetadataForListItem", &error, if (dbus_g_proxy_call(remote_object, "GetMetadataForListItem", &error,
G_TYPE_INT, G_TYPE_INT,
current_track, current_track,
@ -73,36 +65,24 @@ void update_bmpx()
DBUS_TYPE_G_STRING_VALUE_HASHTABLE, DBUS_TYPE_G_STRING_VALUE_HASHTABLE,
&metadata, &metadata,
G_TYPE_INVALID)) { G_TYPE_INVALID)) {
gchar *tmp_title, *tmp_artist, *tmp_album; if (current_info->bmpx.title) {
tmp_title = current_info->bmpx.title; free(current_info->bmpx.title);
tmp_artist = current_info->bmpx.artist; current_info->bmpx.title = 0;
tmp_album = current_info->bmpx.album;
/* if (current_info->bmpx.title) {
g_free(current_info->bmpx.title);
current_info->bmpx.title = NULL;
} }
if (current_info->bmpx.artist) { if (current_info->bmpx.artist) {
g_free(current_info->bmpx.artist); free(current_info->bmpx.artist);
current_info->bmpx.artist = NULL; current_info->bmpx.artist = 0;
} }
if (current_info->bmpx.album) { if (current_info->bmpx.album) {
g_free(current_info->bmpx.album); free(current_info->bmpx.album);
current_info->bmpx.album = NULL; current_info->bmpx.album = 0;
}*/ }
current_info->bmpx.title = g_value_dup_string(g_hash_table_lookup(metadata, "title")); current_info->bmpx.title = g_value_dup_string(g_hash_table_lookup(metadata, "title"));
current_info->bmpx.artist = g_value_dup_string(g_hash_table_lookup(metadata, "artist")); current_info->bmpx.artist = g_value_dup_string(g_hash_table_lookup(metadata, "artist"));
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")); current_info->bmpx.uri = g_value_get_string(g_hash_table_lookup(metadata, "location"));
if (tmp_title != NULL)
g_free(tmp_title);
if (tmp_artist != NULL)
g_free(tmp_artist);
if (tmp_album != NULL)
g_free(tmp_album);
} else { } else {
ERR("BMPx error 4: %s\n", error->message); ERR("BMPx error 4: %s\n", error->message);
goto fail; goto fail;