comparison src/audacious/tuple_formatter.c @ 3349:01a241d35146 trunk

add tuple_formatter_make_title_string(). it is a wrapper function to tuple_formatter_process_construct() to make title string. it falls back to the file name if the formatted string is blank or unavailable.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Mon, 13 Aug 2007 19:45:52 +0900
parents c23513d0ee17
children 678ea77b6b1f
comparison
equal deleted inserted replaced
3348:2a081105513c 3349:01a241d35146
507 initialized = TRUE; 507 initialized = TRUE;
508 } 508 }
509 509
510 return tuple_formatter_process_construct(tuple, string); 510 return tuple_formatter_process_construct(tuple, string);
511 } 511 }
512
513 /* wrapper function for making title string. it falls back to filename
514 * if process_string returns NULL or a blank string. */
515 gchar *
516 tuple_formatter_make_title_string(Tuple *tuple, const gchar *string)
517 {
518 gchar *rv;
519
520 g_return_val_if_fail(tuple != NULL, NULL);
521
522 rv = tuple_formatter_process_construct(tuple, string);
523
524 if(!rv || !strcmp(rv, "")) {
525 g_free(rv);
526 rv = g_strdup(tuple_get_string(tuple, "file-name"));
527 }
528
529 return rv;
530 }