* gtk_playlist.c : Interface for the playlist dialog
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: playlist.c,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * $Id: playlist.c,v 1.9 2004/01/05 13:07:03 zorglub Exp $
*
* Authors: Pierre Baillet <oct@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
gchar * p_protocol;
gchar * p_temp;
gchar * p_next;
- gchar * p_string = p_data->data ;
+ gchar * p_string = (gchar *)p_data->data;
GList * p_files = NULL;
GtkCList * p_clist;
gint GtkCompareItems( gconstpointer a, gconstpointer b )
{
- return b - a;
+ return (ptrdiff_t) ( (int *)b - (int *)a );
}
*/
int GtkAppendList( playlist_t * p_playlist, int i_pos, GList * p_list )
{
- guint i_dummy;
- guint i_length;
+ int i_dummy;
+ int i_length;
i_length = g_list_length( p_list );
the item where they are suppose to go but, hey
this works :P (btw, you are really nasty too) */
g_list_nth_data( p_list, i_dummy ),
+ g_list_nth_data( p_list, i_dummy ),
i_dummy == 0 ? PLAYLIST_INSERT | PLAYLIST_GO : PLAYLIST_INSERT,
i_pos == PLAYLIST_END ? PLAYLIST_END : ( i_pos + i_dummy ) );
}
vlc_mutex_lock( &p_playlist->object_lock );
for( i_dummy = p_playlist->i_size ; i_dummy-- ; )
{
+ char psz_duration[MSTRTIME_MAX_SIZE];
+ mtime_t dur = p_playlist->pp_items[i_dummy]->i_duration;
+ if ( dur != -1 )
+ {
+ secstotimestr( psz_duration, dur/1000000 );
+ }
+ else
+ {
+ memcpy( psz_duration ,"no info",sizeof("no info" ));
+ }
ppsz_text[0] = p_playlist->pp_items[i_dummy]->psz_name;
- ppsz_text[1] = "no info";
+ ppsz_text[1] = strdup( psz_duration );
gtk_clist_insert( p_clist, 0, ppsz_text );
}
vlc_mutex_unlock( &p_playlist->object_lock );