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])
VLC_ADD_PLUGINS([fixed32tos16 s16tofixed32 u8tofixed32])
VLC_ADD_PLUGINS([trivial_resampler ugly_resampler])
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([wav araw subtitle vobsub adpcm a52sys dtssys au ty voc xa nuv])
VLC_ADD_PLUGINS([access_directory access_file access_udp access_tcp])
......
......@@ -138,11 +138,9 @@ struct vlc_list_t
/* Used by VLC_AddTarget() */
#define PLAYLIST_INSERT 0x0001
#define PLAYLIST_REPLACE 0x0002
#define PLAYLIST_APPEND 0x0004
#define PLAYLIST_GO 0x0008
#define PLAYLIST_CHECK_INSERT 0x0010
#define PLAYLIST_PREPARSE 0x0020
#define PLAYLIST_APPEND 0x0002
#define PLAYLIST_GO 0x0004
#define PLAYLIST_PREPARSE 0x0008
#define PLAYLIST_END -666
......
......@@ -24,6 +24,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/**
* \file
* This file is a collection of common definitions and types
......@@ -203,6 +204,7 @@ typedef struct vlc_t vlc_t;
typedef struct variable_t variable_t;
typedef struct date_t date_t;
typedef struct hashtable_entry_t hashtable_entry_t;
typedef struct gc_object_t gc_object_t ;
/* Messages */
typedef struct msg_bank_t msg_bank_t;
......@@ -525,6 +527,44 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */
#define VLC_OBJECT( x ) \
((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
*****************************************************************************/
......
......@@ -72,6 +72,10 @@
* Input thread configuration
*****************************************************************************/
#define DEFAULT_INPUT_ACTIVITY 1
#define DIRECTORY_ACTIVITY 100
#define TRANSCODE_ACTIVITY 10
/* Used in ErrorThread */
#define INPUT_IDLE_SLEEP ((mtime_t)(0.100*CLOCK_FREQ))
......
......@@ -26,6 +26,11 @@
#ifndef _VLC__INPUT_H
#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
*****************************************************************************/
......@@ -44,29 +49,32 @@ struct info_category_t
struct input_item_t
{
VLC_GC_MEMBERS
int i_id; /**< Identifier of the item */
char *psz_name; /**< text describing 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 */
char **ppsz_options; /**< Array of input options */
mtime_t i_duration; /**< A hint about the duration of this
* item, in milliseconds*/
mtime_t i_duration; /**< Duration in milliseconds*/
int i_id; /**< Identifier of the item */
uint8_t i_type; /**< Type (file, disc, ...) */
int i_categories; /**< Number of info categories */
info_category_t **pp_categories; /**< Pointer to the first info category */
int i_es; /**< Number of es format descriptions */
es_format_t **es; /**< Pointer to an array of es formats */
vlc_bool_t b_fixed_name; /**< Can the interface change the name ?*/
es_format_t **es; /**< Es formats */
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
......@@ -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 )
{
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_uri = 0;
p_i->i_es = 0;
p_i->es = 0;
p_i->i_options = 0;
p_i->ppsz_options = 0;
p_i->i_categories = 0 ;
p_i->pp_categories = 0;
p_i->es = 0;
p_i->i_type = ITEM_TYPE_UNKNOWN;
p_i->b_fixed_name = VLC_TRUE;
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->lock );
......@@ -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 )
{
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 )
p_i->psz_name = 0;
p_i->psz_uri = 0;
if( p_i->p_meta ) vlc_meta_Delete( p_i->p_meta );
while( p_i->i_options )
{
p_i->i_options--;
......@@ -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(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)
*****************************************************************************/
......
......@@ -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,
unsigned int i_counter, float *value )
{
int i_ret;
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;
return i_ret;
}
......
......@@ -42,140 +42,120 @@
#define VLC_META_NOW_PLAYING N_("Now Playing")
#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_DESCRIPTION N_("Codec Description")
struct vlc_meta_t
{
/* meta name/value pairs */
int i_meta;
char **name;
char **value;
char *psz_title;
char *psz_author;
char *psz_artist;
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 */
int i_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 )
{
vlc_meta_t *m = (vlc_meta_t*)malloc( sizeof( vlc_meta_t ) );
m->i_meta = 0;
m->name = NULL;
m->value = NULL;
m->i_track= 0;
m->track = NULL;
if( !m ) return NULL;
m->psz_title = NULL;
m->psz_author = NULL;
m->psz_artist = NULL;
m->psz_genre = NULL;
m->psz_copyright = 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;
}
static inline void vlc_meta_Delete( vlc_meta_t *m )
{
int i;
for( i = 0; i < m->i_meta; i++ )
{
free( m->name[i] );
free( m->value[i] );
}
if( m->name ) free( m->name );
if( m->value ) free( m->value );
free( m->psz_title );
free( m->psz_author );
free( m->psz_artist );
free( m->psz_genre );
free( m->psz_copyright );
free( m->psz_album );
free( m->psz_tracknum );
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 );
}
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 )
{
int i, j;
for( i = 0; i < src->i_meta; i++ )
{
/* Check if dst contains the entry */
for( j = 0; j < dst->i_meta; j++ )
{
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;
}
if( !dst || !src ) return;
#define COPY_FIELD( a ) \
if( src->psz_ ## a ) { \
if( dst->psz_ ## a ) free( dst->psz_## a ); \
dst->psz_##a = strdup( src->psz_##a ); \
}
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
......@@ -23,7 +23,7 @@
/**
* \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 * ) );
VLC_EXPORT( vlc_list_t *, __vlc_list_find, ( vlc_object_t *, int, int ) );
VLC_EXPORT( void, vlc_list_release, ( vlc_list_t * ) );
VLC_EXPORT( vlc_t *, vlc_current_object, ( int ) );
/*}@*/
#define vlc_object_create(a,b) \
......@@ -129,4 +130,3 @@ VLC_EXPORT( vlc_t *, vlc_current_object, ( int ) );
#define vlc_list_find(a,b,c) \
__vlc_list_find( VLC_OBJECT(a),b,c)
......@@ -21,6 +21,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef _VLC_PLAYLIST_H_
#define _VLC_PLAYLIST_H_
/**
* \file
* This file contain structures and function prototypes related
......@@ -40,12 +43,7 @@ struct playlist_export_t
{
char *psz_filename;
FILE *p_file;
};
struct item_parent_t
{
int i_view;
playlist_item_t *p_parent;
playlist_item_t *p_root;
};
/**
......@@ -54,70 +52,31 @@ struct item_parent_t
*/
struct playlist_item_t
{
input_item_t input; /**< input item descriptor */
input_item_t *p_input; /**< input item descriptor */
/* Tree specific fields */
int i_children; /**< Number of children
-1 if not a node */
playlist_item_t **pp_children; /**< Children nodes/items */
int i_parents; /**< Number of parents */
struct item_parent_t **pp_parents; /**< Parents */
int i_serial; /**< Has this node been updated ? */
uint8_t i_flags; /**< Flags */
playlist_item_t *p_parent; /**< Item parent */
int i_nb_played; /**< How many times was this item played ? */
int i_id; /**< Playlist item specific id */
/* LEGACY FIELDS */
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 */
uint8_t i_flags; /**< Flags */
};
#define PLAYLIST_SAVE_FLAG 0x01 /**< Must it be saved */
#define PLAYLIST_SKIP_FLAG 0x02 /**< Must playlist skip after it ? */
#define PLAYLIST_ENA_FLAG 0x04 /**< Is it enabled ? */
#define PLAYLIST_DEL_FLAG 0x08 /**< Autodelete ? */
#define PLAYLIST_DBL_FLAG 0x04 /**< Is it disabled ? */
#define PLAYLIST_RO_FLAG 0x10 /**< Write-enabled ? */
#define PLAYLIST_REMOVE_FLAG 0x20 /**< Remove this item at the end */
/**
* 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
#define PLAYLIST_EXPANDED_FLAG 0x40 /**< Expanded node */
/**
* 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
......@@ -136,7 +95,7 @@ struct playlist_preparse_t
VLC_COMMON_MEMBERS
vlc_mutex_t lock;
int i_waiting;
int *pi_waiting;
input_item_t **pp_waiting;
};
......@@ -151,7 +110,6 @@ struct playlist_t
These members are uniq to playlist_t
*/
/*@{*/
int i_index; /**< current index into the playlist */
int i_enabled; /**< How many items are enabled ? */
int i_size; /**< total size of the list */
......@@ -160,65 +118,59 @@ struct playlist_t
int i_all_size; /**< size of list of items and nodes */
playlist_item_t ** pp_all_items; /**< array of pointers to the
* playlist items and nodes */
int i_last_playlist_id; /**< Last id to an item */
int i_views; /**< Number of views */
playlist_view_t ** pp_views; /**< array of pointers to the
* playlist views */
int i_input_items;
input_item_t ** pp_input_items;
input_thread_t * p_input; /**< the input thread ascosiated
* with the current item */
int i_last_input_id ;
mtime_t request_date; /**< Used for profiling */
input_thread_t * p_input; /**< the input thread associated
* with the current item */
int i_last_id; /**< Last id to an item */
int i_sort; /**< Last sorting applied to the playlist */
int i_order; /**< Last ordering applied to the playlist */
playlist_item_t * p_general; /**< Keep a pointer on the "general"
category */
playlist_item_t * p_root_category;
playlist_item_t * p_root_onelevel;
playlist_item_t * p_local_category; /** < "Playlist" in CATEGORY view */
playlist_item_t * p_ml_category; /** < "Library" in CATEGORY view */
playlist_item_t * p_local_onelevel; /** < "Playlist" in ONELEVEL view */
playlist_item_t * p_ml_onelevel; /** < "Library" in ONELEVEL iew */
services_discovery_t **pp_sds;
int i_sds;
vlc_bool_t b_go_next; /*< Go further than the parent node ? */
struct {
/* Current status */
/* Current status. These fields are readonly, only the playlist
* main loop can touch it*/
playlist_status_t i_status; /**< Current status of playlist */
/* R/O fields, don't touch if you aren't the playlist thread */
/* Use a request */
playlist_item_t * p_item; /**< Currently playing/active item */
playlist_item_t * p_node; /**< Current node to play from */
int i_view; /**< Current view */
} status;
struct {
/* Request */
/* Playlist thread uses this info to calculate the next position */
int i_view; /**< requested view id */
/* Request. Use this to give orders to the playlist main loop */
int i_status; /**< requested playlist status */
playlist_item_t * p_node; /**< requested node to play from */
playlist_item_t * p_item; /**< requested item to play in the node */
int i_skip; /**< Number of items to skip */
int i_goto; /**< Direct index to go to (non-view)*/
vlc_bool_t b_request; /**< Set to true by the requester
vlc_bool_t b_request;/**< Set to true by the requester
The playlist sets it back to false
when processing the request */
vlc_mutex_t lock; /**< Lock to protect request */
} request;
playlist_preparse_t *p_preparse;
playlist_preparse_t *p_preparse; /**< Preparser object */
vlc_mutex_t gc_lock; /**< Lock to protect the garbage collection */
// The following members are about user interaction
// The playlist manages the user interaction to avoid creating another
// thread
interaction_t *p_interaction;
global_stats_t *p_stats;
// Playlist-unrelated fields
interaction_t *p_interaction; /**< Interaction manager */
global_stats_t *p_stats; /**< Global statistics */
/*@}*/
};
......@@ -249,10 +201,27 @@ struct playlist_add_t
* Prototypes
*****************************************************************************/
/* Global thread */
#define playlist_ThreadCreate(a) __playlist_ThreadCreate(VLC_OBJECT(a))
playlist_t *__playlist_ThreadCreate ( vlc_object_t * );
int playlist_ThreadDestroy ( playlist_t * );
/* Helpers */
#define PL_LOCK vlc_mutex_lock( &p_playlist->object_lock );
#define PL_UNLOCK vlc_mutex_unlock( &p_playlist->object_lock );
/* Creation/Deletion */
#define playlist_Create(a) __playlist_Create(VLC_OBJECT(a))
playlist_t * __playlist_Create ( vlc_object_t * );
int playlist_Destroy ( playlist_t * );
playlist_t *playlist_Create ( vlc_object_t * );
void playlist_Destroy ( playlist_t * );
/* Engine */
void playlist_MainLoop( playlist_t * );
void playlist_LastLoop( playlist_t * );
void playlist_PreparseLoop( playlist_preparse_t * );
/* Control */
playlist_item_t * playlist_NextItem ( playlist_t * );
int playlist_PlayItem ( playlist_t *, playlist_item_t * );
/* Playlist control */
#define playlist_Play(p) playlist_LockControl(p,PLAYLIST_PLAY )
......@@ -261,13 +230,12 @@ int playlist_Destroy ( playlist_t * );
#define playlist_Next(p) playlist_LockControl(p,PLAYLIST_SKIP, 1)
#define playlist_Prev(p) playlist_LockControl(p,PLAYLIST_SKIP, -1)
#define playlist_Skip(p,i) playlist_LockControl(p,PLAYLIST_SKIP, i)
#define playlist_Goto(p,i) playlist_LockControl(p,PLAYLIST_GOTO, i)
VLC_EXPORT( int, playlist_Control, ( playlist_t *, int, ... ) );
VLC_EXPORT( int, playlist_LockControl, ( playli