]> git.sesse.net Git - vlc/blobdiff - include/vlc_playlist.h
* ALL:
[vlc] / include / vlc_playlist.h
index 6597b1122267d2a321d714af8faf19a059748143..f7f644bdca9ded658be002a08f0a0f3922f3483f 100644 (file)
@@ -2,7 +2,7 @@
  * vlc_playlist.h : Playlist functions
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
- * $Id: vlc_playlist.h,v 1.5 2002/11/12 21:20:36 gbazin Exp $
+ * $Id: vlc_playlist.h,v 1.9 2003/03/17 17:10:21 hartman Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -27,6 +27,7 @@
 struct playlist_item_t
 {
     char *     psz_name;
+    char *     psz_uri; 
     int        i_type;   /* unused yet */
     int        i_status; /* unused yet */
     vlc_bool_t b_autodeletion;
@@ -52,6 +53,13 @@ struct playlist_t
     input_thread_t *      p_input;
 };
 
+/*****************************************************************************
+ * Playlist status
+ *****************************************************************************/
+#define PLAYLIST_STOPPED 0
+#define PLAYLIST_RUNNING 1
+#define PLAYLIST_PAUSED  2
+
 /*****************************************************************************
  * Prototypes
  *****************************************************************************/
@@ -69,5 +77,30 @@ void           playlist_Destroy  ( playlist_t * );
 VLC_EXPORT( void, playlist_Command, ( playlist_t *, int, int ) );
 
 VLC_EXPORT( int,  playlist_Add,    ( playlist_t *, const char *, int, int ) );
+VLC_EXPORT( int,  playlist_AddItem, ( playlist_t *, playlist_item_t *, int, int ) );
 VLC_EXPORT( int,  playlist_Delete, ( playlist_t *, int ) );
+VLC_EXPORT( int,  playlist_Move, ( playlist_t *, int, int ) );
+VLC_EXPORT( int,  playlist_LoadFile, ( playlist_t *, const char * ) );
+VLC_EXPORT( int,  playlist_SaveFile, ( playlist_t *, const char * ) );
+
+static inline vlc_bool_t playlist_IsPlaying( playlist_t * p_playlist )
+{
+    vlc_bool_t b_playing;
+
+    vlc_mutex_lock( &p_playlist->object_lock );
+    b_playing = p_playlist->i_status == PLAYLIST_RUNNING; 
+    vlc_mutex_unlock( &p_playlist->object_lock );
+
+    return( b_playing );
+}
+
+static inline vlc_bool_t playlist_IsEmpty( playlist_t * p_playlist )
+{
+    vlc_bool_t b_empty;
+
+    vlc_mutex_lock( &p_playlist->object_lock );
+    b_empty = p_playlist->i_size == 0;
+    vlc_mutex_unlock( &p_playlist->object_lock );
 
+    return( b_empty );
+}