]> git.sesse.net Git - vlc/blobdiff - include/vlc_playlist.h
* vlc_common: changed TAB_APPEND. I have to do this because the old way
[vlc] / include / vlc_playlist.h
index e268aa550d7571f2466e56ac48105ff905bf99b5..9d80b914dde237e926b5ffff6152cc1e37e9fce0 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * 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>
  *
@@ -56,6 +56,15 @@ struct item_info_category_t
     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
@@ -65,7 +74,7 @@ struct playlist_item_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 */
@@ -120,16 +129,20 @@ struct playlist_t
     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
@@ -154,8 +167,10 @@ VLC_EXPORT( void, playlist_Command, ( playlist_t *, playlist_command_t, int ) );
 
 /* 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 ) );
@@ -165,7 +180,7 @@ VLC_EXPORT( int,  playlist_EnableGroup, ( 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) );
@@ -196,6 +211,7 @@ VLC_EXPORT( int, playlist_AddOption, (playlist_t *, int, const char *, ...) );
 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)
@@ -203,8 +219,8 @@ VLC_EXPORT( int,  playlist_Sort, ( playlist_t *, int, int) );
 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.