|
Lines 219-231
Link Here
|
| 219 |
static void |
218 |
static void |
| 220 |
si_ui_statusicon_cb_hook_tchange ( gpointer plentry_gp , gpointer prevs_gp ) |
219 |
si_ui_statusicon_cb_hook_tchange ( gpointer plentry_gp , gpointer prevs_gp ) |
| 221 |
{ |
220 |
{ |
| 222 |
/* NOTE: this is quite intricated, but it works nicely and it's still |
|
|
| 223 |
much better than polling; wonder if it can be simplified with some |
| 224 |
help from the core player */ |
| 225 |
si_hook_tchange_prevs_t *prevs = prevs_gp; |
221 |
si_hook_tchange_prevs_t *prevs = prevs_gp; |
| 226 |
PlaylistEntry *pl_entry = plentry_gp; |
222 |
PlaylistEntry *pl_entry = plentry_gp; |
| 227 |
if ( ( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(prevs->evbox) , "popup_active" )) == 1 ) && |
223 |
gboolean upd_pop = FALSE; |
| 228 |
( plentry_gp != NULL ) ) |
224 |
|
|
|
225 |
if ( pl_entry != NULL ) |
| 229 |
{ |
226 |
{ |
| 230 |
if ( ( prevs->title != NULL ) && ( prevs->filename != NULL ) ) |
227 |
if ( ( prevs->title != NULL ) && ( prevs->filename != NULL ) ) |
| 231 |
{ |
228 |
{ |
|
Lines 235-244
Link Here
|
| 235 |
if ( ( pl_entry->title != NULL ) && |
232 |
if ( ( pl_entry->title != NULL ) && |
| 236 |
( strcmp(pl_entry->title,prevs->title) ) ) |
233 |
( strcmp(pl_entry->title,prevs->title) ) ) |
| 237 |
{ |
234 |
{ |
| 238 |
si_ui_statusicon_popup_hide( prevs->evbox ); |
|
|
| 239 |
si_ui_statusicon_popup_timer_start( prevs->evbox ); |
| 240 |
g_free( prevs->title ); |
235 |
g_free( prevs->title ); |
| 241 |
prevs->title = g_strdup(pl_entry->title); |
236 |
prevs->title = g_strdup(pl_entry->title); |
|
|
237 |
upd_pop = TRUE; |
| 242 |
} |
238 |
} |
| 243 |
} |
239 |
} |
| 244 |
else |
240 |
else |
|
Lines 246-253
Link Here
|
| 246 |
g_free(prevs->filename); |
242 |
g_free(prevs->filename); |
| 247 |
prevs->filename = g_strdup(pl_entry->filename); |
243 |
prevs->filename = g_strdup(pl_entry->filename); |
| 248 |
/* if filename changes, reset title as well */ |
244 |
/* if filename changes, reset title as well */ |
| 249 |
if ( prevs->title != NULL ) |
245 |
g_free(prevs->title); |
| 250 |
g_free(prevs->title); |
|
|
| 251 |
prevs->title = g_strdup(pl_entry->title); |
246 |
prevs->title = g_strdup(pl_entry->title); |
| 252 |
} |
247 |
} |
| 253 |
} |
248 |
} |
|
Lines 261-270
Link Here
|
| 261 |
prevs->filename = g_strdup(pl_entry->filename); |
256 |
prevs->filename = g_strdup(pl_entry->filename); |
| 262 |
} |
257 |
} |
| 263 |
} |
258 |
} |
| 264 |
else if ( ( prevs->title != NULL ) && ( strcmp(pl_entry->title,prevs->title) ) ) |
259 |
|
|
|
260 |
if ( ( upd_pop == TRUE ) && |
| 261 |
( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(prevs->evbox) , "popup_active" )) == 1 ) ) |
| 265 |
{ |
262 |
{ |
| 266 |
g_free(prevs->title); |
263 |
si_ui_statusicon_popup_hide( prevs->evbox ); |
| 267 |
prevs->title = g_strdup(pl_entry->title); |
264 |
si_ui_statusicon_popup_timer_start( prevs->evbox ); |
| 268 |
} |
265 |
} |
| 269 |
} |
266 |
} |