Removed or privatized playlist functions.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 16 Feb 2009 19:50:31 +0000 (20:50 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 16 Feb 2009 20:13:18 +0000 (21:13 +0100)
include/vlc_playlist.h
modules/gui/wince/playlist.cpp
modules/services_discovery/upnp_intel.cpp
src/control/playlist.c
src/libvlccore.sym
src/playlist/engine.c
src/playlist/item.c
src/playlist/playlist_internal.h
src/playlist/tree.c

index c30a09b..12521b7 100644 (file)
@@ -274,9 +274,7 @@ VLC_EXPORT( int, playlist_AskForArtEnqueue, (playlist_t *, input_item_t *, bool
 VLC_EXPORT( int,  playlist_TreeMove, ( playlist_t *, playlist_item_t *, playlist_item_t *, int ) );
 VLC_EXPORT( int,  playlist_RecursiveNodeSort, ( playlist_t *, playlist_item_t *,int, int ) );
 
-VLC_EXPORT( int,  playlist_CurrentId, ( playlist_t * ) );
 VLC_EXPORT( playlist_item_t *,  playlist_CurrentPlayingItem, ( playlist_t * ) );
-VLC_EXPORT( bool,  playlist_IsPlaying, ( playlist_t * ) );
 VLC_EXPORT( int,   playlist_Status, ( playlist_t * ) );
 
 /**
@@ -318,9 +316,6 @@ VLC_EXPORT( int,  playlist_AddExt, ( playlist_t *, const char *, const char *, i
 VLC_EXPORT( int, playlist_AddInput, ( playlist_t *, input_item_t *, int, int, bool, bool ) );
 VLC_EXPORT( int, playlist_BothAddInput, ( playlist_t *, input_item_t *,playlist_item_t *,int , int, int*, int*, bool ) );
 
-/********************** Misc item operations **********************/
-VLC_EXPORT( playlist_item_t*, playlist_ItemToNode, (playlist_t *,playlist_item_t *, bool) );
-
 /********************************** Item search *************************/
 VLC_EXPORT( playlist_item_t *, playlist_ItemGetById, (playlist_t *, int ) );
 VLC_EXPORT( playlist_item_t *, playlist_ItemGetByInput, (playlist_t *,input_item_t * ) );
@@ -331,8 +326,6 @@ VLC_EXPORT( int, playlist_LiveSearchUpdate, (playlist_t *, playlist_item_t *, co
 /********************************************************
  * Tree management
  ********************************************************/
-VLC_EXPORT( int, playlist_NodeChildrenCount, (playlist_t *,playlist_item_t* ) );
-
 /* Node management */
 VLC_EXPORT( playlist_item_t *, playlist_NodeCreate, ( playlist_t *, const char *, playlist_item_t * p_parent, int i_flags, input_item_t * ) );
 VLC_EXPORT( int, playlist_NodeAppend, (playlist_t *,playlist_item_t*,playlist_item_t *) );
@@ -340,8 +333,7 @@ VLC_EXPORT( int, playlist_NodeInsert, (playlist_t *,playlist_item_t*,playlist_it
 VLC_EXPORT( int, playlist_NodeRemoveItem, (playlist_t *,playlist_item_t*,playlist_item_t *) );
 VLC_EXPORT( playlist_item_t *, playlist_ChildSearchName, (playlist_item_t*, const char* ) );
 VLC_EXPORT( int, playlist_NodeDelete, ( playlist_t *, playlist_item_t *, bool , bool ) );
-VLC_EXPORT( int, playlist_NodeEmpty, ( playlist_t *, playlist_item_t *, bool ) );
-VLC_EXPORT( void, playlist_NodesPairCreate, (playlist_t *, const char *, playlist_item_t **, playlist_item_t **, bool ) );
+
 VLC_EXPORT( playlist_item_t *, playlist_GetPreferredNode, ( playlist_t *p_playlist, playlist_item_t *p_node ) );
 VLC_EXPORT( playlist_item_t *, playlist_GetNextLeaf, ( playlist_t *p_playlist, playlist_item_t *p_root, playlist_item_t *p_item, bool b_ena, bool b_unplayed ) );
 VLC_EXPORT( playlist_item_t *, playlist_GetPrevLeaf, ( playlist_t *p_playlist, playlist_item_t *p_root, playlist_item_t *p_item, bool b_ena, bool b_unplayed ) );
index 1441117..bd0ff58 100644 (file)
@@ -631,9 +631,8 @@ void Playlist::Rebuild()
     playlist_item_t * p_root = p_playlist->p_local_onelevel;
     playlist_item_t * p_child = NULL;
 
-    for( int i = 0; i < playlist_NodeChildrenCount( p_playlist, p_root ); i++ )
+    while( ( p_child = playlist_GetNextLeaf( p_playlist, p_root, p_child, FALSE, FALSE ) ) )
     {
-        p_child = playlist_GetNextLeaf( p_playlist, p_root, p_child, FALSE, FALSE);
         LVITEM lv;
         lv.mask = LVIF_TEXT;
         lv.pszText = _T("");
index fdae66a..f64a74b 100644 (file)
@@ -653,14 +653,6 @@ void MediaServer::fetchContents()
     Container* root = new Container( 0, "0", getFriendlyName() );
     _fetchContents( root );
 
-   // if ( _contents )
-   // {
-   //     PL_LOCK;
-   //     playlist_NodeEmpty( p_playlist, _playlistNode, true );
-   //     PL_UNLOCK;
-   //     delete _contents;
-   // }
-
     _contents = root;
     _contents->setInputItem( _inputItem );
 
index 80baa5e..1d0787a 100644 (file)
@@ -215,7 +215,7 @@ int libvlc_playlist_isplaying( libvlc_instance_t *p_instance,
     VLC_UNUSED(p_e);
 
     assert( PL );
-    return playlist_IsPlaying( PL );
+    return playlist_Status( PL ) == PLAYLIST_RUNNING;
 }
 
 int libvlc_playlist_items_count( libvlc_instance_t *p_instance,
@@ -233,7 +233,10 @@ int libvlc_playlist_get_current_index ( libvlc_instance_t *p_instance,
     VLC_UNUSED(p_e);
 
     assert( PL );
-    return playlist_CurrentId( PL );
+    playlist_item_t *p_item = playlist_CurrentPlayingItem( PL );
+    if( !p_item )
+        return -1;
+    return p_item->i_id;
 }
 
 void libvlc_playlist_lock( libvlc_instance_t *p_instance )
index e4f9c09..45497fc 100644 (file)
@@ -281,7 +281,6 @@ playlist_BothAddInput
 playlist_ChildSearchName
 playlist_Clear
 playlist_Control
-playlist_CurrentId
 playlist_CurrentInput
 playlist_CurrentPlayingItem
 playlist_DeleteFromInput
@@ -291,22 +290,17 @@ playlist_GetNextLeaf
 playlist_GetPreferredNode
 playlist_GetPrevLeaf
 playlist_Import
-playlist_IsPlaying
 playlist_IsServicesDiscoveryLoaded
 playlist_ItemGetById
 playlist_ItemGetByInput
 playlist_ItemGetByInputId
-playlist_ItemToNode
 playlist_LiveSearchUpdate
 playlist_Lock
 playlist_NodeAppend
-playlist_NodeChildrenCount
 playlist_NodeCreate
 playlist_NodeDelete
-playlist_NodeEmpty
 playlist_NodeInsert
 playlist_NodeRemoveItem
-playlist_NodesPairCreate
 playlist_PreparseEnqueue
 playlist_RecursiveNodeSort
 playlist_ServicesDiscoveryAdd
index b6f82ed..8b8b792 100644 (file)
@@ -302,18 +302,6 @@ static void VariablesInit( playlist_t *p_playlist )
     var_Create( p_playlist, "album-art", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
 }
 
-int playlist_CurrentId( playlist_t * p_playlist )
-{
-    return pl_priv(p_playlist)->status.p_item->i_id;
-
-}
-
-bool playlist_IsPlaying( playlist_t * p_playlist )
-{
-    return ( pl_priv(p_playlist)->status.i_status == PLAYLIST_RUNNING &&
-            !(pl_priv(p_playlist)->request.b_request && pl_priv(p_playlist)->request.i_status == PLAYLIST_STOPPED) );
-}
-
 playlist_item_t * playlist_CurrentPlayingItem( playlist_t * p_playlist )
 {
     return pl_priv(p_playlist)->status.p_item;
@@ -323,3 +311,4 @@ int playlist_Status( playlist_t * p_playlist )
 {
     return pl_priv(p_playlist)->status.i_status;
 }
+
index 29142f5..e8179b1 100644 (file)
@@ -38,6 +38,8 @@ static void ChangeToNode( playlist_t *p_playlist, playlist_item_t *p_item );
 static int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item,
                         bool b_stop );
 
+static playlist_item_t *ItemToNode( playlist_t *, playlist_item_t *, bool );
+
 /*****************************************************************************
  * An input item has gained a subitem (Event Callback)
  *****************************************************************************/
@@ -86,7 +88,7 @@ static void input_item_subitem_added( const vlc_event_t * p_event,
         /* If this item is already a node don't transform it */
         if( p_item_in_category->i_children == -1 )
         {
-            p_item_in_category = playlist_ItemToNode( p_playlist,
+            p_item_in_category = ItemToNode( p_playlist,
                     p_item_in_category, pl_Locked );
             p_item_in_category->p_input->i_type = ITEM_TYPE_PLAYLIST;
         }
@@ -547,9 +549,9 @@ playlist_item_t * playlist_NodeAddInput( playlist_t *p_playlist,
  * \param b_locked TRUE if the playlist is locked
  * \return the item transform in a node
  */
-playlist_item_t *playlist_ItemToNode( playlist_t *p_playlist,
-                                      playlist_item_t *p_item,
-                                      bool b_locked )
+static playlist_item_t *ItemToNode( playlist_t *p_playlist,
+                                    playlist_item_t *p_item,
+                                    bool b_locked )
 {
 
     playlist_item_t *p_item_in_category;
index bf159f4..a50c074 100644 (file)
@@ -141,6 +141,11 @@ int playlist_DeleteFromInputInParent( playlist_t *, int, playlist_item_t *, bool
 int playlist_DeleteFromItemId( playlist_t*, int );
 int playlist_ItemRelease( playlist_item_t * );
 
+
+void playlist_NodesPairCreate( playlist_t *, const char *, playlist_item_t **, playlist_item_t **, bool );
+int playlist_NodeEmpty( playlist_t *, playlist_item_t *, bool );
+
+
 /**
  * @}
  */
index ed16eb9..3e12300 100644 (file)
@@ -239,35 +239,6 @@ int playlist_NodeRemoveItem( playlist_t *p_playlist,
    return VLC_SUCCESS;
 }
 
-
-/**
- * Count the children of a node
- *
- * \param p_playlist the playlist
- * \param p_node the node
- * \return the number of children
- */
-int playlist_NodeChildrenCount( playlist_t *p_playlist, playlist_item_t*p_node)
-{
-    PL_ASSERT_LOCKED;
-    int i;
-    int i_nb = 0;
-
-    if( p_node->i_children == -1 )
-        return 0;
-
-    i_nb = p_node->i_children;
-    for( i=0 ; i< p_node->i_children;i++ )
-    {
-        if( p_node->pp_children[i]->i_children == -1 )
-            break;
-        else
-            i_nb += playlist_NodeChildrenCount( p_playlist,
-                                                p_node->pp_children[i] );
-    }
-    return i_nb;
-}
-
 /**
  * Search a child of a node by its name
  *