/*****************************************************************************
* vlc_playlist.h : Playlist functions
*****************************************************************************
- * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
- * $Id: vlc_playlist.h,v 1.19 2004/01/05 12:59:43 zorglub Exp $
+ * Copyright (C) 1999-2004 VideoLAN
+ * $Id: vlc_playlist.h,v 1.25 2004/01/23 10:48:08 zorglub Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
item_info_t **pp_infos; /**< Pointer to an array of infos */
};
+/**
+ * playlist export helper structure
+ */
+struct playlist_export_t
+{
+ char *psz_filename;
+ FILE *p_file;
+};
+
/**
* playlist item
* \see playlist_t
char * psz_name; /**< text describing this item */
char * psz_uri; /**< mrl of this item */
mtime_t i_duration; /**< A hint about the duration of this
- * item, in miliseconds*/
+ * item, in milliseconds*/
int i_categories; /**< Number of info categories */
item_info_category_t **pp_categories;
/**< Pointer to the first info category */
input_thread_t * p_input; /**< the input thread ascosiated
* 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 */
/*@}*/
};
-#define SORT_TITLE 0
-#define SORT_AUTHOR 1
-#define SORT_GROUP 2
-#define SORT_RANDOM 3
+#define SORT_ID 0
+#define SORT_TITLE 1
+#define SORT_AUTHOR 2
+#define SORT_GROUP 3
+#define SORT_RANDOM 4
+#define SORT_DURATION 5
-#define SORT_NORMAL 0
-#define SORT_REVERSE 1
+#define ORDER_NORMAL 0
+#define ORDER_REVERSE 1
#define PLAYLIST_TYPE_MANUAL 1
#define PLAYLIST_TYPE_SAP 2
/* Item functions */
VLC_EXPORT( int, playlist_Add, ( playlist_t *, const char *, const char *, int, int ) );
+VLC_EXPORT( int, playlist_AddWDuration, ( playlist_t *, const char *, const char *, int, int, mtime_t ) );
/* For internal use. Do not use this one anymore */
VLC_EXPORT( int, playlist_AddItem, ( playlist_t *, playlist_item_t *, int, int ) );
+VLC_EXPORT( int, playlist_Clear, ( playlist_t * ) );
VLC_EXPORT( int, playlist_Delete, ( playlist_t *, int ) );
VLC_EXPORT( int, playlist_Disable, ( playlist_t *, int ) );
VLC_EXPORT( int, playlist_Enable, ( playlist_t *, int ) );
/* Basic item informations accessors */
VLC_EXPORT( int, playlist_SetGroup, (playlist_t *, int, int ) );
VLC_EXPORT( int, playlist_SetName, (playlist_t *, int, char * ) );
-VLC_EXPORT( int, playlist_SetDuration, (playlist_t *, int, int ) );
+VLC_EXPORT( int, playlist_SetDuration, (playlist_t *, int, mtime_t ) );
/* Item search functions */
VLC_EXPORT( int, playlist_GetPositionById, (playlist_t *, int) );
VLC_EXPORT( int, playlist_AddItemOption, (playlist_item_t *, const char *, ...) );
/* Playlist sorting */
+#define playlist_SortID(p, i) playlist_Sort( p, SORT_ID, i)
#define playlist_SortTitle(p, i) playlist_Sort( p, SORT_TITLE, i)
#define playlist_SortAuthor(p, i) playlist_Sort( p, SORT_AUTHOR, i)
#define playlist_SortGroup(p, i) playlist_Sort( p, SORT_GROUP, i)
VLC_EXPORT( int, playlist_Move, ( playlist_t *, int, int ) );
/* Load/Save */
-VLC_EXPORT( int, playlist_LoadFile, ( playlist_t *, const char * ) );
-VLC_EXPORT( int, playlist_SaveFile, ( playlist_t *, const char * ) );
+VLC_EXPORT( int, playlist_Import, ( playlist_t *, const char * ) );
+VLC_EXPORT( int, playlist_Export, ( playlist_t *, const char *, const char * ) );
/**
* tell if a playlist is currently playing.