]> git.sesse.net Git - vlc/commitdiff
src/control: Implement libvlc_media_list_view_children_at_index.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 19 Nov 2007 13:48:23 +0000 (13:48 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 19 Nov 2007 13:48:23 +0000 (13:48 +0000)
include/vlc/libvlc.h
src/control/flat_media_list_view.c
src/control/libvlc_internal.h
src/control/media_list_view.c

index 86ae5600a582ced490e150bf366b7a1cdd8bd2b3..49fd590ac03d39d3e1869205e3864b22f39ed1d5 100644 (file)
@@ -555,6 +555,12 @@ VLC_PUBLIC_API libvlc_media_descriptor_t *
                                            int index,
                                            libvlc_exception_t * p_e );
 
+VLC_PUBLIC_API libvlc_media_list_view_t *
+    libvlc_media_list_view_children_at_index(  libvlc_media_list_view_t * p_mlv,
+                                           int index,
+                                           libvlc_exception_t * p_e );
+
+
 VLC_PUBLIC_API int
     libvlc_media_list_view_index_of_item(  libvlc_media_list_view_t * p_mlv,
                                            libvlc_media_descriptor_t * p_md,
index 32cc36f5e30e41feab60da44e4015ef5b5066d4a..d493ac7c12bf1f8072e54c89f63b8967f7a4df60 100644 (file)
@@ -73,6 +73,18 @@ flat_media_list_view_item_at_index( libvlc_media_list_view_t * p_mlv,
     return p_md;
 }
 
+/**************************************************************************
+ *       flat_media_list_view_item_at_index  (private)
+ * (called by flat_media_list_view_item_at_index)
+ **************************************************************************/
+static libvlc_media_list_view_t *
+flat_media_list_view_children_at_index( libvlc_media_list_view_t * p_mlv,
+                                        int index,
+                                        libvlc_exception_t * p_e )
+{
+    return NULL;
+}
+
 /**************************************************************************
  *       flat_media_list_view_release (private)
  * (called by media_list_view_release)
@@ -104,6 +116,7 @@ libvlc_media_list_flat_view( libvlc_media_list_t * p_mlist,
     p_mlv = libvlc_media_list_view_new( p_mlist,
                                         flat_media_list_view_count,
                                         flat_media_list_view_item_at_index,
+                                        flat_media_list_view_children_at_index,
                                         flat_media_list_view_release,
                                         p_this_view_data,
                                         p_e );
index 45e898f5f118ad34169c5bb608bb3776004bf6b8..79d230e26c7ac8439a011b1472af5eaf007791e0 100644 (file)
@@ -117,12 +117,18 @@ struct libvlc_media_list_t
 
 typedef void (*libvlc_media_list_view_release_func_t)( libvlc_media_list_view_t * p_mlv ) ;
 
-typedef int (*libvlc_media_list_view_count_func_t)( struct libvlc_media_list_view_t * p_mlv,
+typedef int (*libvlc_media_list_view_count_func_t)( libvlc_media_list_view_t * p_mlv,
         libvlc_exception_t * ) ;
 
 typedef libvlc_media_descriptor_t *
         (*libvlc_media_list_view_item_at_index_func_t)(
-                struct libvlc_media_list_view_t * p_mlv,
+                libvlc_media_list_view_t * p_mlv,
+                int index,
+                libvlc_exception_t * ) ;
+
+typedef libvlc_media_list_view_t *
+        (*libvlc_media_list_view_children_at_index_func_t)(
+                libvlc_media_list_view_t * p_mlv,
                 int index,
                 libvlc_exception_t * ) ;
 
@@ -139,8 +145,9 @@ struct libvlc_media_list_view_t
     struct libvlc_media_list_view_private_t * p_this_view_data;
 
     /* Accessors */
-    libvlc_media_list_view_count_func_t         pf_count;
-    libvlc_media_list_view_item_at_index_func_t pf_item_at_index;
+    libvlc_media_list_view_count_func_t              pf_count;
+    libvlc_media_list_view_item_at_index_func_t      pf_item_at_index;
+    libvlc_media_list_view_children_at_index_func_t  pf_children_at_index;
 
     libvlc_media_list_view_release_func_t       pf_release;
 
@@ -290,6 +297,7 @@ VLC_EXPORT ( libvlc_media_list_view_t *, libvlc_media_list_view_new,
                           ( libvlc_media_list_t * p_mlist,
                             libvlc_media_list_view_count_func_t pf_count,
                             libvlc_media_list_view_item_at_index_func_t pf_item_at_index,
+                            libvlc_media_list_view_children_at_index_func_t pf_children_at_index,
                             libvlc_media_list_view_release_func_t pf_release,
                             void * this_view_data,
                             libvlc_exception_t * p_e ) );
index da45a43e1e903298d273e71304b4051f09e1ffa8..c562a151e71aca87ea398a629b1f3733448c2d6b 100644 (file)
@@ -104,6 +104,7 @@ libvlc_media_list_view_t *
 libvlc_media_list_view_new( libvlc_media_list_t * p_mlist,
                             libvlc_media_list_view_count_func_t pf_count,
                             libvlc_media_list_view_item_at_index_func_t pf_item_at_index,
+                            libvlc_media_list_view_children_at_index_func_t pf_children_at_index,
                             libvlc_media_list_view_release_func_t pf_release,
                             void * this_view_data,
                             libvlc_exception_t * p_e )
@@ -120,9 +121,10 @@ libvlc_media_list_view_new( libvlc_media_list_t * p_mlist,
     libvlc_media_list_retain( p_mlist );
     p_mlv->p_mlist = p_mlist;
 
-    p_mlv->pf_count         = pf_count;
-    p_mlv->pf_item_at_index = pf_item_at_index;
-    p_mlv->pf_release       = pf_release;
+    p_mlv->pf_count             = pf_count;
+    p_mlv->pf_item_at_index     = pf_item_at_index;
+    p_mlv->pf_children_at_index = pf_children_at_index;
+    p_mlv->pf_release           = pf_release;
 
     p_mlv->p_this_view_data = this_view_data;
 
@@ -225,4 +227,5 @@ libvlc_media_list_view_release( libvlc_media_list_view_t * p_mlv )
 
 MEDIA_LIST_VIEW_FUNCTION( count, int, 0 )
 MEDIA_LIST_VIEW_FUNCTION( item_at_index, libvlc_media_descriptor_t *, NULL, int arg1 )
+MEDIA_LIST_VIEW_FUNCTION( children_at_index, libvlc_media_list_view_t *, NULL, int arg1 )