|
|
static void | static void |
si_ui_statusicon_cb_hook_tchange ( gpointer plentry_gp , gpointer prevs_gp ) | si_ui_statusicon_cb_hook_tchange ( gpointer plentry_gp , gpointer prevs_gp ) |
{ | { |
/* NOTE: this is quite intricated, but it works nicely and it's still |
|
much better than polling; wonder if it can be simplified with some |
|
help from the core player */ |
|
si_hook_tchange_prevs_t *prevs = prevs_gp; | si_hook_tchange_prevs_t *prevs = prevs_gp; |
PlaylistEntry *pl_entry = plentry_gp; | PlaylistEntry *pl_entry = plentry_gp; |
if ( ( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(prevs->evbox) , "popup_active" )) == 1 ) && |
gboolean upd_pop = FALSE; |
( plentry_gp != NULL ) ) |
|
|
if ( pl_entry != NULL ) |
{ | { |
if ( ( prevs->title != NULL ) && ( prevs->filename != NULL ) ) | if ( ( prevs->title != NULL ) && ( prevs->filename != NULL ) ) |
{ | { |
|
|
if ( ( pl_entry->title != NULL ) && | if ( ( pl_entry->title != NULL ) && |
( strcmp(pl_entry->title,prevs->title) ) ) | ( strcmp(pl_entry->title,prevs->title) ) ) |
{ | { |
si_ui_statusicon_popup_hide( prevs->evbox ); |
|
si_ui_statusicon_popup_timer_start( prevs->evbox ); |
|
g_free( prevs->title ); | g_free( prevs->title ); |
prevs->title = g_strdup(pl_entry->title); | prevs->title = g_strdup(pl_entry->title); |
|
upd_pop = TRUE; |
} | } |
} | } |
else | else |
|
|
g_free(prevs->filename); | g_free(prevs->filename); |
prevs->filename = g_strdup(pl_entry->filename); | prevs->filename = g_strdup(pl_entry->filename); |
/* if filename changes, reset title as well */ | /* if filename changes, reset title as well */ |
if ( prevs->title != NULL ) |
g_free(prevs->title); |
g_free(prevs->title); |
|
prevs->title = g_strdup(pl_entry->title); | prevs->title = g_strdup(pl_entry->title); |
} | } |
} | } |
|
|
prevs->filename = g_strdup(pl_entry->filename); | prevs->filename = g_strdup(pl_entry->filename); |
} | } |
} | } |
else if ( ( prevs->title != NULL ) && ( strcmp(pl_entry->title,prevs->title) ) ) |
|
|
if ( ( upd_pop == TRUE ) && |
|
( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(prevs->evbox) , "popup_active" )) == 1 ) ) |
{ | { |
g_free(prevs->title); |
si_ui_statusicon_popup_hide( prevs->evbox ); |
prevs->title = g_strdup(pl_entry->title); |
si_ui_statusicon_popup_timer_start( prevs->evbox ); |
} | } |
} | } |