1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 18:45:10 +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);
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,
G_TYPE_INT,
current_track,
@ -73,36 +65,24 @@ void update_bmpx()
DBUS_TYPE_G_STRING_VALUE_HASHTABLE,
&metadata,
G_TYPE_INVALID)) {
gchar *tmp_title, *tmp_artist, *tmp_album;
tmp_title = current_info->bmpx.title;
tmp_artist = current_info->bmpx.artist;
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.title) {
free(current_info->bmpx.title);
current_info->bmpx.title = 0;
}
if (current_info->bmpx.artist) {
g_free(current_info->bmpx.artist);
current_info->bmpx.artist = NULL;
free(current_info->bmpx.artist);
current_info->bmpx.artist = 0;
}
if (current_info->bmpx.album) {
g_free(current_info->bmpx.album);
current_info->bmpx.album = NULL;
}*/
free(current_info->bmpx.album);
current_info->bmpx.album = 0;
}
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.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.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"));
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 {
ERR("BMPx error 4: %s\n", error->message);
goto fail;