Commit ed0b72e3 authored by Clément Stenac's avatar Clément Stenac

Merge back branch 0.8.6-playlist-vlm to trunk.

What is currently broken:
 * Some playlist demuxers (shout, dvb and pls)
 * DAAP
 * BeOS playlist
 * GPE playlist, I suppose

What has some trouble:
 * Meta handling in several demuxers (most notably TS)
 * Skins2 playlist (doesn't refresh correctly)
 * OS X playlist (see bigben's latest commits)
parent 806edd25
...@@ -1121,7 +1121,7 @@ VLC_ADD_PLUGINS([deinterlace invert adjust transform distort motionblur rv32]) ...@@ -1121,7 +1121,7 @@ VLC_ADD_PLUGINS([deinterlace invert adjust transform distort motionblur rv32])
VLC_ADD_PLUGINS([fixed32tos16 s16tofixed32 u8tofixed32]) VLC_ADD_PLUGINS([fixed32tos16 s16tofixed32 u8tofixed32])
VLC_ADD_PLUGINS([trivial_resampler ugly_resampler]) VLC_ADD_PLUGINS([trivial_resampler ugly_resampler])
VLC_ADD_PLUGINS([trivial_channel_mixer trivial_mixer]) VLC_ADD_PLUGINS([trivial_channel_mixer trivial_mixer])
VLC_ADD_PLUGINS([playlist export sgimb m3u nsc xtag]) VLC_ADD_PLUGINS([playlist export sgimb nsc xtag])
VLC_ADD_PLUGINS([i420_rgb rawvideo blend scale image logo magnify]) VLC_ADD_PLUGINS([i420_rgb rawvideo blend scale image logo magnify])
VLC_ADD_PLUGINS([wav araw subtitle vobsub adpcm a52sys dtssys au ty voc xa nuv]) VLC_ADD_PLUGINS([wav araw subtitle vobsub adpcm a52sys dtssys au ty voc xa nuv])
VLC_ADD_PLUGINS([access_directory access_file access_udp access_tcp]) VLC_ADD_PLUGINS([access_directory access_file access_udp access_tcp])
......
...@@ -138,11 +138,9 @@ struct vlc_list_t ...@@ -138,11 +138,9 @@ struct vlc_list_t
/* Used by VLC_AddTarget() */ /* Used by VLC_AddTarget() */
#define PLAYLIST_INSERT 0x0001 #define PLAYLIST_INSERT 0x0001
#define PLAYLIST_REPLACE 0x0002 #define PLAYLIST_APPEND 0x0002
#define PLAYLIST_APPEND 0x0004 #define PLAYLIST_GO 0x0004
#define PLAYLIST_GO 0x0008 #define PLAYLIST_PREPARSE 0x0008
#define PLAYLIST_CHECK_INSERT 0x0010
#define PLAYLIST_PREPARSE 0x0020
#define PLAYLIST_END -666 #define PLAYLIST_END -666
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
/** /**
* \file * \file
* This file is a collection of common definitions and types * This file is a collection of common definitions and types
...@@ -203,6 +204,7 @@ typedef struct vlc_t vlc_t; ...@@ -203,6 +204,7 @@ typedef struct vlc_t vlc_t;
typedef struct variable_t variable_t; typedef struct variable_t variable_t;
typedef struct date_t date_t; typedef struct date_t date_t;
typedef struct hashtable_entry_t hashtable_entry_t; typedef struct hashtable_entry_t hashtable_entry_t;
typedef struct gc_object_t gc_object_t ;
/* Messages */ /* Messages */
typedef struct msg_bank_t msg_bank_t; typedef struct msg_bank_t msg_bank_t;
...@@ -525,6 +527,44 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */ ...@@ -525,6 +527,44 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */
#define VLC_OBJECT( x ) \ #define VLC_OBJECT( x ) \
((vlc_object_t *)(x))+0*(x)->be_sure_to_add_VLC_COMMON_MEMBERS_to_struct ((vlc_object_t *)(x))+0*(x)->be_sure_to_add_VLC_COMMON_MEMBERS_to_struct
#define VLC_GC_MEMBERS \
/** \name VLC_GC_MEMBERS \
* these members are common to all objects that wish to be garbage-collected \
*/ \
/**@{*/ \
int i_gc_refcount; \
void (*pf_destructor) ( gc_object_t * ); \
void *p_destructor_arg; \
/**@}*/
struct gc_object_t
{
VLC_GC_MEMBERS
};
static inline void __vlc_gc_incref( gc_object_t * p_gc )
{
p_gc->i_gc_refcount ++;
};
static inline void __vlc_gc_decref( gc_object_t *p_gc )
{
p_gc->i_gc_refcount -- ;
if( p_gc->i_gc_refcount == 0 )
{
p_gc->pf_destructor( p_gc );
/* Do not use the p_gc pointer from now on ! */
}
}
#define vlc_gc_incref( a ) __vlc_gc_incref( (gc_object_t *)a )
#define vlc_gc_decref( a ) __vlc_gc_decref( (gc_object_t *)a )
#define vlc_gc_init( a,b,c ) { ((gc_object_t *)a)->i_gc_refcount = 0; \
((gc_object_t *)a)->pf_destructor = b; \
((gc_object_t *)a)->p_destructor_arg = c; }
/***************************************************************************** /*****************************************************************************
* Macros and inline functions * Macros and inline functions
*****************************************************************************/ *****************************************************************************/
......
...@@ -72,6 +72,10 @@ ...@@ -72,6 +72,10 @@
* Input thread configuration * Input thread configuration
*****************************************************************************/ *****************************************************************************/
#define DEFAULT_INPUT_ACTIVITY 1
#define DIRECTORY_ACTIVITY 100
#define TRANSCODE_ACTIVITY 10
/* Used in ErrorThread */ /* Used in ErrorThread */
#define INPUT_IDLE_SLEEP ((mtime_t)(0.100*CLOCK_FREQ)) #define INPUT_IDLE_SLEEP ((mtime_t)(0.100*CLOCK_FREQ))
......
...@@ -26,6 +26,11 @@ ...@@ -26,6 +26,11 @@
#ifndef _VLC__INPUT_H #ifndef _VLC__INPUT_H
#define _VLC__INPUT_H 1 #define _VLC__INPUT_H 1
#include <vlc_playlist.h>
#include <vlc_meta.h>
struct vlc_meta_t;
/***************************************************************************** /*****************************************************************************
* input_item_t: Describes an input and is used to spawn input_thread_t objects * input_item_t: Describes an input and is used to spawn input_thread_t objects
*****************************************************************************/ *****************************************************************************/
...@@ -44,29 +49,32 @@ struct info_category_t ...@@ -44,29 +49,32 @@ struct info_category_t
struct input_item_t struct input_item_t
{ {
VLC_GC_MEMBERS
int i_id; /**< Identifier of the item */
char *psz_name; /**< text describing this item */ char *psz_name; /**< text describing this item */
char *psz_uri; /**< mrl of this item */ char *psz_uri; /**< mrl of this item */
vlc_bool_t b_fixed_name; /**< Can the interface change the name ?*/
int i_options; /**< Number of input options */ int i_options; /**< Number of input options */
char **ppsz_options; /**< Array of input options */ char **ppsz_options; /**< Array of input options */
mtime_t i_duration; /**< A hint about the duration of this mtime_t i_duration; /**< Duration in milliseconds*/
* item, in milliseconds*/
int i_id; /**< Identifier of the item */
uint8_t i_type; /**< Type (file, disc, ...) */ uint8_t i_type; /**< Type (file, disc, ...) */
int i_categories; /**< Number of info categories */ int i_categories; /**< Number of info categories */
info_category_t **pp_categories; /**< Pointer to the first info category */ info_category_t **pp_categories; /**< Pointer to the first info category */
int i_es; /**< Number of es format descriptions */ int i_es; /**< Number of es format descriptions */
es_format_t **es; /**< Pointer to an array of es formats */ es_format_t **es; /**< Es formats */
vlc_bool_t b_fixed_name; /**< Can the interface change the name ?*/
input_stats_t *p_stats; /**< Statistics */ input_stats_t *p_stats; /**< Statistics */
int i_nb_played; /**< Number of times played */
vlc_meta_t *p_meta;
vlc_mutex_t lock; /**< Item cannot be changed without this lock */ vlc_mutex_t lock; /**< Lock for the item */
}; };
#define ITEM_TYPE_UNKNOWN 0 #define ITEM_TYPE_UNKNOWN 0
...@@ -83,18 +91,19 @@ struct input_item_t ...@@ -83,18 +91,19 @@ struct input_item_t
static inline void vlc_input_item_Init( vlc_object_t *p_o, input_item_t *p_i ) static inline void vlc_input_item_Init( vlc_object_t *p_o, input_item_t *p_i )
{ {
memset( p_i, 0, sizeof(input_item_t) ); memset( p_i, 0, sizeof(input_item_t) );
p_i->i_options = 0;
p_i->i_es = 0;
p_i->i_categories = 0 ;
p_i->psz_name = 0; p_i->psz_name = 0;
p_i->psz_uri = 0; p_i->psz_uri = 0;
p_i->i_es = 0;
p_i->es = 0;
p_i->i_options = 0;
p_i->ppsz_options = 0; p_i->ppsz_options = 0;
p_i->i_categories = 0 ;
p_i->pp_categories = 0; p_i->pp_categories = 0;
p_i->es = 0;
p_i->i_type = ITEM_TYPE_UNKNOWN; p_i->i_type = ITEM_TYPE_UNKNOWN;
p_i->b_fixed_name = VLC_TRUE; p_i->b_fixed_name = VLC_TRUE;
p_i->p_stats = (input_stats_t*) malloc( sizeof( input_stats_t ) ); p_i->p_stats = (input_stats_t*) malloc( sizeof( input_stats_t ) );
p_i->p_meta = NULL;
vlc_mutex_init( p_o, &p_i->p_stats->lock ); vlc_mutex_init( p_o, &p_i->p_stats->lock );
vlc_mutex_init( p_o, &p_i->lock ); vlc_mutex_init( p_o, &p_i->lock );
...@@ -115,6 +124,8 @@ static inline void vlc_input_item_CopyOptions( input_item_t *p_parent, ...@@ -115,6 +124,8 @@ static inline void vlc_input_item_CopyOptions( input_item_t *p_parent,
} }
} }
VLC_EXPORT( void, vlc_input_item_AddOption, ( input_item_t *p_input, const char *psz_option ) );
static inline void vlc_input_item_Clean( input_item_t *p_i ) static inline void vlc_input_item_Clean( input_item_t *p_i )
{ {
if( p_i->psz_name ) free( p_i->psz_name ); if( p_i->psz_name ) free( p_i->psz_name );
...@@ -123,6 +134,8 @@ static inline void vlc_input_item_Clean( input_item_t *p_i ) ...@@ -123,6 +134,8 @@ static inline void vlc_input_item_Clean( input_item_t *p_i )
p_i->psz_name = 0; p_i->psz_name = 0;
p_i->psz_uri = 0; p_i->psz_uri = 0;
if( p_i->p_meta ) vlc_meta_Delete( p_i->p_meta );
while( p_i->i_options ) while( p_i->i_options )
{ {
p_i->i_options--; p_i->i_options--;
...@@ -168,6 +181,14 @@ static inline void vlc_input_item_Clean( input_item_t *p_i ) ...@@ -168,6 +181,14 @@ static inline void vlc_input_item_Clean( input_item_t *p_i )
VLC_EXPORT( char *, vlc_input_item_GetInfo, ( input_item_t *p_i, const char *psz_cat,const char *psz_name ) ); VLC_EXPORT( char *, vlc_input_item_GetInfo, ( input_item_t *p_i, const char *psz_cat,const char *psz_name ) );
VLC_EXPORT(int, vlc_input_item_AddInfo, ( input_item_t *p_i, const char *psz_cat, const char *psz_name, const char *psz_format, ... ) ); VLC_EXPORT(int, vlc_input_item_AddInfo, ( input_item_t *p_i, const char *psz_cat, const char *psz_name, const char *psz_format, ... ) );
#define input_ItemNew( a,b,c ) input_ItemNewExt( a, b, c, 0, NULL, -1 )
#define input_ItemNewExt(a,b,c,d,e,f) __input_ItemNewExt( VLC_OBJECT(a),b,c,d,e,f)
VLC_EXPORT( input_item_t *, __input_ItemNewExt, (vlc_object_t *, const char *, const char*, int, const char **, int) );
VLC_EXPORT( input_item_t *, input_ItemNewWithType, ( vlc_object_t *, const char *, const char *e, int, const char **, int, int ) );
VLC_EXPORT( input_item_t *, input_ItemGetById, (playlist_t *, int ) );
/***************************************************************************** /*****************************************************************************
* Seek point: (generalisation of chapters) * Seek point: (generalisation of chapters)
*****************************************************************************/ *****************************************************************************/
......
...@@ -301,9 +301,8 @@ static inline int __stats_GetInteger( vlc_object_t *p_obj, int i_id, ...@@ -301,9 +301,8 @@ static inline int __stats_GetInteger( vlc_object_t *p_obj, int i_id,
static inline int __stats_GetFloat( vlc_object_t *p_obj, int i_id, static inline int __stats_GetFloat( vlc_object_t *p_obj, int i_id,
unsigned int i_counter, float *value ) unsigned int i_counter, float *value )
{ {
int i_ret;
vlc_value_t val;val.f_float = 0.0; vlc_value_t val;val.f_float = 0.0;
i_ret = __stats_Get( p_obj, i_id, i_counter, &val ); int i_ret = __stats_Get( p_obj, i_id, i_counter, &val );
*value = val.f_float; *value = val.f_float;
return i_ret; return i_ret;
} }
......
...@@ -42,140 +42,120 @@ ...@@ -42,140 +42,120 @@
#define VLC_META_NOW_PLAYING N_("Now Playing") #define VLC_META_NOW_PLAYING N_("Now Playing")
#define VLC_META_PUBLISHER N_("Publisher") #define VLC_META_PUBLISHER N_("Publisher")
#define VLC_META_CDDB_ARTIST N_("CDDB Artist")
#define VLC_META_CDDB_CATEGORY N_("CDDB Category")
#define VLC_META_CDDB_DISCID N_("CDDB Disc ID")
#define VLC_META_CDDB_EXT_DATA N_("CDDB Extended Data")
#define VLC_META_CDDB_GENRE N_("CDDB Genre")
#define VLC_META_CDDB_YEAR N_("CDDB Year")
#define VLC_META_CDDB_TITLE N_("CDDB Title")
#define VLC_META_CDTEXT_ARRANGER N_("CD-Text Arranger")
#define VLC_META_CDTEXT_COMPOSER N_("CD-Text Composer")
#define VLC_META_CDTEXT_DISCID N_("CD-Text Disc ID")
#define VLC_META_CDTEXT_GENRE N_("CD-Text Genre")
#define VLC_META_CDTEXT_MESSAGE N_("CD-Text Message")
#define VLC_META_CDTEXT_SONGWRITER N_("CD-Text Songwriter")
#define VLC_META_CDTEXT_PERFORMER N_("CD-Text Performer")
#define VLC_META_CDTEXT_TITLE N_("CD-Text Title")
#define VLC_META_ISO_APPLICATION_ID N_("ISO-9660 Application ID")
#define VLC_META_ISO_PREPARER N_("ISO-9660 Preparer")
#define VLC_META_ISO_PUBLISHER N_("ISO-9660 Publisher")
#define VLC_META_ISO_VOLUME N_("ISO-9660 Volume")
#define VLC_META_ISO_VOLUMESET N_("ISO-9660 Volume Set")
#define VLC_META_CODEC_NAME N_("Codec Name") #define VLC_META_CODEC_NAME N_("Codec Name")
#define VLC_META_CODEC_DESCRIPTION N_("Codec Description") #define VLC_META_CODEC_DESCRIPTION N_("Codec Description")
struct vlc_meta_t struct vlc_meta_t
{ {
/* meta name/value pairs */ char *psz_title;
int i_meta; char *psz_author;
char **name; char *psz_artist;
char **value; char *psz_genre;
char *psz_copyright;
char *psz_album;
char *psz_tracknum;
char *psz_description;
char *psz_rating;
char *psz_date;
char *psz_setting;
char *psz_url;
char *psz_language;
char *psz_nowplaying;
char *psz_publisher;
#if 0
/* track meta information */ /* track meta information */
int i_track; int i_track;
vlc_meta_t **track; vlc_meta_t **track;
#endif
}; };
#define vlc_meta_Set( meta,var,val ) { \
if( meta->psz_##var ) free( meta->psz_##var ); \
meta->psz_##var = strdup( val ); }
#define vlc_meta_SetTitle( meta, b ) vlc_meta_Set( meta, title, b );
#define vlc_meta_SetArtist( meta, b ) vlc_meta_Set( meta, artist, b );
#define vlc_meta_SetAuthor( meta, b ) vlc_meta_Set( meta, author, b );
#define vlc_meta_SetGenre( meta, b ) vlc_meta_Set( meta, genre, b );
#define vlc_meta_SetCopyright( meta, b ) vlc_meta_Set( meta, copyright, b );
#define vlc_meta_SetAlbum( meta, b ) vlc_meta_Set( meta, album, b );
#define vlc_meta_SetTracknum( meta, b ) vlc_meta_Set( meta, tracknum, b );
#define vlc_meta_SetDescription( meta, b ) vlc_meta_Set( meta, description, b );
#define vlc_meta_SetRating( meta, b ) vlc_meta_Set( meta, rating, b );
#define vlc_meta_SetDate( meta, b ) vlc_meta_Set( meta, date, b );
#define vlc_meta_SetSetting( meta, b ) vlc_meta_Set( meta, setting, b );
#define vlc_meta_SetURL( meta, b ) vlc_meta_Set( meta, url, b );
#define vlc_meta_SetLanguage( meta, b ) vlc_meta_Set( meta, language, b );
#define vlc_meta_SetNowPlaying( meta, b ) vlc_meta_Set( meta, nowplaying, b );
#define vlc_meta_SetPublisher( meta, b ) vlc_meta_Set( meta, publisher, b );
static inline vlc_meta_t *vlc_meta_New( void ) static inline vlc_meta_t *vlc_meta_New( void )
{ {
vlc_meta_t *m = (vlc_meta_t*)malloc( sizeof( vlc_meta_t ) ); vlc_meta_t *m = (vlc_meta_t*)malloc( sizeof( vlc_meta_t ) );
if( !m ) return NULL;
m->i_meta = 0; m->psz_title = NULL;
m->name = NULL; m->psz_author = NULL;
m->value = NULL; m->psz_artist = NULL;
m->psz_genre = NULL;
m->i_track= 0; m->psz_copyright = NULL;
m->track = NULL; m->psz_album = NULL;
m->psz_tracknum = NULL;
m->psz_description = NULL;
m->psz_rating = NULL;
m->psz_date = NULL;
m->psz_setting = NULL;
m->psz_url = NULL;
m->psz_language = NULL;
m->psz_nowplaying = NULL;
m->psz_publisher = NULL;
return m; return m;
} }
static inline void vlc_meta_Delete( vlc_meta_t *m ) static inline void vlc_meta_Delete( vlc_meta_t *m )
{ {
int i; free( m->psz_title );
for( i = 0; i < m->i_meta; i++ ) free( m->psz_author );
{ free( m->psz_artist );
free( m->name[i] ); free( m->psz_genre );
free( m->value[i] ); free( m->psz_copyright );
} free( m->psz_album );
if( m->name ) free( m->name ); free( m->psz_tracknum );
if( m->value ) free( m->value ); free( m->psz_description );
free( m->psz_rating );
free( m->psz_date );
free( m->psz_setting );
free( m->psz_url );
free( m->psz_language );
free( m->psz_nowplaying );
free( m->psz_publisher );
for( i = 0; i < m->i_track; i++ )
{
vlc_meta_Delete( m->track[i] );
}
if( m->track ) free( m->track );
free( m ); free( m );
} }
static inline void vlc_meta_Add( vlc_meta_t *m,
const char *name, const char *value )
{
m->name = (char**)realloc( m->name, sizeof(char*) * ( m->i_meta + 1 ) );
m->name[m->i_meta] = strdup( name );
m->value = (char**)realloc( m->value, sizeof(char*) * ( m->i_meta + 1 ) );
m->value[m->i_meta] = strdup( value );
m->i_meta++;
}
static inline vlc_meta_t *vlc_meta_Duplicate( vlc_meta_t *src )
{
vlc_meta_t *dst = vlc_meta_New();
int i;
for( i = 0; i < src->i_meta; i++ )
{
vlc_meta_Add( dst, src->name[i], src->value[i] );
}
for( i = 0; i < src->i_track; i++ )
{
vlc_meta_t *tk = vlc_meta_Duplicate( src->track[i] );
dst->track = (vlc_meta_t**)realloc( dst->track, sizeof( vlc_meta_t* ) * (dst->i_track+1) );
dst->track[dst->i_track++] = tk;
}
return dst;
}
static inline void vlc_meta_Merge( vlc_meta_t *dst, vlc_meta_t *src ) static inline void vlc_meta_Merge( vlc_meta_t *dst, vlc_meta_t *src )
{ {
int i, j; if( !dst || !src ) return;
for( i = 0; i < src->i_meta; i++ ) #define COPY_FIELD( a ) \
{ if( src->psz_ ## a ) { \
/* Check if dst contains the entry */ if( dst->psz_ ## a ) free( dst->psz_## a ); \
for( j = 0; j < dst->i_meta; j++ ) dst->psz_##a = strdup( src->psz_##a ); \
{
if( !strcmp( src->name[i], dst->name[j] ) ) break;
}
if( j < dst->i_meta )
{
if( dst->value[j] ) free( dst->value[j] );
dst->value[j] = strdup( src->value[i] );
}
else vlc_meta_Add( dst, src->name[i], src->value[i] );
}
}
static inline char *vlc_meta_GetValue( vlc_meta_t *m, const char *name )
{
int i;
for( i = 0; i < m->i_meta; i++ )
{
if( !strcmp( m->name[i], name ) )
{
char *value = NULL;
if( m->value[i] ) value = strdup( m->value[i] );
return value;
}
} }
return NULL; COPY_FIELD( title );
COPY_FIELD( author );
COPY_FIELD( artist );
COPY_FIELD( genre );
COPY_FIELD( copyright );
COPY_FIELD( album );
COPY_FIELD( tracknum );
COPY_FIELD( description );
COPY_FIELD( rating );
COPY_FIELD( date );
COPY_FIELD( setting );
COPY_FIELD( url );
COPY_FIELD( language );
COPY_FIELD( nowplaying );
COPY_FIELD( publisher );
} }
/** \todo Track meta */
#endif #endif
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/** /**
* \file * \file
* This file defines the vlc_object_t structure and object types * This file defines the vlc_object_t structure and object types.
*/ */
/** /**
...@@ -100,6 +100,7 @@ VLC_EXPORT( void, __vlc_object_release, ( vlc_object_t * ) ); ...@@ -100,6 +100,7 @@ VLC_EXPORT( void, __vlc_object_release, ( vlc_object_t * ) );
VLC_EXPORT( vlc_list_t *, __vlc_list_find, ( vlc_object_t *, int, int ) ); VLC_EXPORT( vlc_list_t *, __vlc_list_find, ( vlc_object_t *, int, int ) );
VLC_EXPORT( void, vlc_list_release, ( vlc_list_t * ) ); VLC_EXPORT( void, vlc_list_release, ( vlc_list_t * ) );
VLC_EXPORT( vlc_t *, vlc_current_object, ( int ) ); VLC_EXPORT( vlc_t *, vlc_current_object, ( int ) );
/*}@*/ /*}@*/
#define vlc_object_create(a,b) \ #define vlc_object_create(a,b) \
...@@ -129,4 +130,3 @@ VLC_EXPORT( vlc_t *, vlc_current_object, ( int ) ); ...@@ -129,4 +130,3 @@ VLC_EXPORT( vlc_t *, vlc_current_object, ( int ) );
#define vlc_list_find(a,b,c) \ #define vlc_list_find(a,b,c) \
__vlc_list_find( VLC_OBJECT(a),b,c) __vlc_list_find( VLC_OBJECT(a),b,c)
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef _VLC_PLAYLIST_H_
#define _VLC_PLAYLIST_H_
/** /**
* \file * \file
* This file contain structures and function prototypes related * This file contain structures and function prototypes related
...@@ -40,12 +43,7 @@ struct playlist_export_t ...@@ -40,12 +43,7 @@ struct playlist_export_t
{ {
char *psz_filename; char *psz_filename;
FILE *p_file; FILE *p_file;
}; playlist_item_t *p_root;
struct item_parent_t
{
int i_view;
playlist_item_t *p_parent;
}; };
/** /**
...@@ -54,70 +52,31 @@ struct item_parent_t ...@@ -54,70 +52,31 @@ struct item_parent_t
*/ */
struct playlist_item_t struct playlist_item_t
{ {
input_item_t input; /**< input item descriptor */ input_item_t *p_input; /**< input item descriptor */
/* Tree specific fields */ /* Tree specific fields */
int i_children; /**< Number of children int i_children; /**< Number of children
-1 if not a node */ -1 if not a node */
playlist_item_t **pp_children; /**< Children nodes/items */ playlist_item_t **pp_children; /**< Children nodes/items */
int i_parents; /**< Number of parents */ playlist_item_t *p_parent; /**< Item parent */
struct item_parent_t **pp_parents; /**< Parents */
int i_serial; /**< Has this node been updated ? */
uint8_t i_flags; /**< Flags */
int i_nb_played; /**< How many times was this item played ? */ int i_id; /**< Playlist item specific id */
/* LEGACY FIELDS */ uint8_t i_flags; /**< Flags */
vlc_bool_t b_autodeletion; /**< Indicates whther this item is to
* be deleted after playback. True mean
* that this item is to be deleted
* after playback, false otherwise */
vlc_bool_t b_enabled; /**< Indicates whether this item is to be
* played or skipped */
/* END LEGACY FIELDS */
}; };
#define PLAYLIST_SAVE_FLAG 0x01 /**< Must it be saved */ #define PLAYLIST_SAVE_FLAG 0x01 /**< Must it be saved */
#define PLAYLIST_SKIP_FLAG 0x02 /**< Must playlist skip after it ? */ #define PLAYLIST_SKIP_FLAG 0x02 /**< Must playlist skip after it ? */
#define PLAYLIST_ENA_FLAG 0x04 /**< Is it enabled ? */ #define PLAYLIST_DBL_FLAG 0x04 /**< Is it disabled ? */
#define PLAYLIST_DEL_FLAG 0x08 /**< Autodelete ? */
#define PLAYLIST_RO_FLAG 0x10 /**< Write-enabled ? */ #define PLAYLIST_RO_FLAG 0x10 /**< Write-enabled ? */
#define PLAYLIST_REMOVE_FLAG 0x20 /**< Remove this item at the end */ #define PLAYLIST_REMOVE_FLAG 0x20 /**< Remove this item at the end */
#define PLAYLIST_EXPANDED_FLAG 0x40 /**< Expanded node */
/**
* playlist view
* \see playlist_t
*/
struct playlist_view_t
{
char * psz_name; /**< View name */
int i_id; /**< Identifier for the view */
playlist_item_t * p_root; /**< Root node */
};
/**
* predefined views
*
*/
#define VIEW_CATEGORY 1
#define VIEW_SIMPLE 2
#define VIEW_ALL 3
#define VIEW_FIRST_SORTED 4
#define VIEW_S_AUTHOR 4
#define VIEW_S_GENRE 5
#define VIEW_S_ALBUM 6
#define VIEW_LAST_SORTED 10
#define VIEW_FIRST_CUSTOM 100
/** /**
* Playlist status * Playlist status
*/ */
typedef enum { PLAYLIST_STOPPED,PLAYLIST_RUNNING,PLAYLIST_PAUSED } playlist_status_t; typedef enum
{ PLAYLIST_STOPPED,PLAYLIST_RUNNING,PLAYLIST_PAUSED } playlist_status_t;
struct services_discovery_t struct services_discovery_t
...@@ -136,7 +95,7 @@ struct playlist_preparse_t ...@@ -136,7 +95,7 @@ struct playlist_preparse_t
VLC_COMMON_MEMBERS VLC_COMMON_MEMBERS
vlc_mutex_t lock; vlc_mutex_t lock;
int i_waiting; int i_waiting;
int *pi_waiting; input_item_t **pp_waiting;