Mercurial > pidgin-audacious
comparison pidgin-audacious.c @ 8:8af1f090ba9a
branch merge
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Sat, 01 Mar 2008 03:18:22 +0900 |
parents | feb13e877029 76f3cd9915c5 |
children | d5702f04b19c |
comparison
equal
deleted
inserted
replaced
7:feb13e877029 | 8:8af1f090ba9a |
---|---|
76 AUDACIOUS_DBUS_PATH, | 76 AUDACIOUS_DBUS_PATH, |
77 AUDACIOUS_DBUS_INTERFACE); | 77 AUDACIOUS_DBUS_INTERFACE); |
78 | 78 |
79 g_clear_error(&error); | 79 g_clear_error(&error); |
80 return session; | 80 return session; |
81 #if 0 | |
82 if (audacious_remote_is_running(session)) { | |
83 return session; | |
84 } | |
85 else { | |
86 return NULL; | |
87 } | |
88 #endif | |
89 } | 81 } |
90 | 82 |
91 static gboolean | 83 static gboolean |
92 watchdog_func(void) | 84 watchdog_func(void) |
93 { | 85 { |
94 gint playpos = 0; | 86 gint playpos = 0; |
95 gchar *song = NULL, *tmp = NULL; | 87 gchar *song = NULL, *tmp = NULL; |
96 // DBusGProxy *session = get_dbus_proxy(); | |
97 | 88 |
98 gboolean rv = TRUE; | 89 gboolean rv = TRUE; |
99 size_t dummy; | 90 size_t dummy; |
100 | 91 |
101 aud_debug("session = %p\n", session); | 92 aud_debug("session = %p\n", session); |
290 | 281 |
291 /* generate key for hash table*/ | 282 /* generate key for hash table*/ |
292 key = g_strdup_printf("%s %s", account->username, account->protocol_id); | 283 key = g_strdup_printf("%s %s", account->username, account->protocol_id); |
293 | 284 |
294 /* retrieve current alias */ | 285 /* retrieve current alias */ |
295 // current = purple_url_decode(purple_account_get_alias(account)); | |
296 current = purple_account_get_alias(account); | 286 current = purple_account_get_alias(account); |
297 if(current == NULL || strlen(current) == 0) { | 287 if(current == NULL || strlen(current) == 0) { |
298 aud_error("couldn't get current alias\n"); | 288 aud_error("couldn't get current alias\n"); |
299 g_free(key); | 289 g_free(key); |
300 return; | 290 return; |
305 pushed = g_hash_table_lookup(pushed_alias, key); | 295 pushed = g_hash_table_lookup(pushed_alias, key); |
306 | 296 |
307 /* if current alias differs from pushed_alias or contains token, replace seed with current. */ | 297 /* if current alias differs from pushed_alias or contains token, replace seed with current. */ |
308 if( (pushed && g_ascii_strcasecmp(current, pushed)) || strstr(current, SONG_TOKEN) ) { | 298 if( (pushed && g_ascii_strcasecmp(current, pushed)) || strstr(current, SONG_TOKEN) ) { |
309 g_hash_table_replace(seed_alias, g_strdup(key), g_strdup(current)); | 299 g_hash_table_replace(seed_alias, g_strdup(key), g_strdup(current)); |
310 // g_hash_table_replace(pushed_alias, g_strdup(key), g_strdup(current)); //XXX should do? | |
311 } | 300 } |
312 | 301 |
313 /* construct new status message */ | 302 /* construct new status message */ |
314 seed = g_hash_table_lookup(seed_alias, key); | 303 seed = g_hash_table_lookup(seed_alias, key); |
315 g_return_if_fail(seed != NULL); | 304 g_return_if_fail(seed != NULL); |
489 0, /**< flags */ | 478 0, /**< flags */ |
490 NULL, /**< deps */ | 479 NULL, /**< deps */ |
491 PURPLE_PRIORITY_DEFAULT, /**< priority */ | 480 PURPLE_PRIORITY_DEFAULT, /**< priority */ |
492 PIDGINAUD_PLUGIN_ID, /**< id */ | 481 PIDGINAUD_PLUGIN_ID, /**< id */ |
493 "Pidgin-Audacious", /**< name */ | 482 "Pidgin-Audacious", /**< name */ |
494 "2.0.0d4", /**< version */ | 483 "2.0.0", /**< version */ |
495 "Automatically updates your Pidgin status info with the currently " | 484 "Automatically updates your Pidgin status info with the currently " |
496 "playing music in Audacious.", /** summary */ | 485 "playing music in Audacious.", /** summary */ |
497 "Automatically updates your Pidgin status info with the currently " | 486 "Automatically updates your Pidgin status info with the currently " |
498 "playing music in Audacious.", /** desc */ | 487 "playing music in Audacious.", /** desc */ |
499 "Yoshiki Yazawa (yaz@honeyplanet.jp)", /**< author */ | 488 "Yoshiki Yazawa (yaz@honeyplanet.jp)", /**< author */ |