Commit 632cfd1d authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

control: Implement and export media_list_view_children_for_item()

parent 6368b52d
...@@ -616,6 +616,11 @@ VLC_PUBLIC_API libvlc_media_list_view_t * ...@@ -616,6 +616,11 @@ VLC_PUBLIC_API libvlc_media_list_view_t *
int index, int index,
libvlc_exception_t * p_e ); libvlc_exception_t * p_e );
VLC_PUBLIC_API libvlc_media_list_view_t *
libvlc_media_list_view_children_for_item( libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_md,
libvlc_exception_t * p_e );
VLC_PUBLIC_API int VLC_PUBLIC_API int
libvlc_media_list_view_index_of_item( libvlc_media_list_view_t * p_mlv, libvlc_media_list_view_index_of_item( libvlc_media_list_view_t * p_mlv,
......
...@@ -113,6 +113,7 @@ flat_media_list_view_children_at_index( libvlc_media_list_view_t * p_mlv, ...@@ -113,6 +113,7 @@ flat_media_list_view_children_at_index( libvlc_media_list_view_t * p_mlv,
int index, int index,
libvlc_exception_t * p_e ) libvlc_exception_t * p_e )
{ {
(void)p_mlv; (void)index; (void)p_e;
return NULL; return NULL;
} }
...@@ -174,6 +175,7 @@ libvlc_media_list_flat_view( libvlc_media_list_t * p_mlist, ...@@ -174,6 +175,7 @@ libvlc_media_list_flat_view( libvlc_media_list_t * p_mlist,
flat_media_list_view_count, flat_media_list_view_count,
flat_media_list_view_item_at_index, flat_media_list_view_item_at_index,
flat_media_list_view_children_at_index, flat_media_list_view_children_at_index,
libvlc_media_list_flat_view,
flat_media_list_view_release, flat_media_list_view_release,
p_this_view_data, p_this_view_data,
p_e ); p_e );
......
...@@ -168,6 +168,7 @@ libvlc_media_list_hierarchical_view( libvlc_media_list_t * p_mlist, ...@@ -168,6 +168,7 @@ libvlc_media_list_hierarchical_view( libvlc_media_list_t * p_mlist,
hierarch_media_list_view_count, hierarch_media_list_view_count,
hierarch_media_list_view_item_at_index, hierarch_media_list_view_item_at_index,
hierarch_media_list_view_children_at_index, hierarch_media_list_view_children_at_index,
libvlc_media_list_hierarchical_view,
hierarch_media_list_view_release, hierarch_media_list_view_release,
NULL, NULL,
p_e ); p_e );
......
...@@ -287,6 +287,7 @@ libvlc_media_list_hierarchical_node_view( libvlc_media_list_t * p_mlist, ...@@ -287,6 +287,7 @@ libvlc_media_list_hierarchical_node_view( libvlc_media_list_t * p_mlist,
hierarch_node_media_list_view_count, hierarch_node_media_list_view_count,
hierarch_node_media_list_view_item_at_index, hierarch_node_media_list_view_item_at_index,
hierarch_node_media_list_view_children_at_index, hierarch_node_media_list_view_children_at_index,
libvlc_media_list_hierarchical_node_view,
hierarch_node_media_list_view_release, hierarch_node_media_list_view_release,
NULL, NULL,
p_e ); p_e );
......
...@@ -124,6 +124,7 @@ struct libvlc_media_list_t ...@@ -124,6 +124,7 @@ struct libvlc_media_list_t
vlc_bool_t b_read_only; vlc_bool_t b_read_only;
}; };
typedef libvlc_media_list_view_t * (*libvlc_media_list_view_constructor_func_t)( libvlc_media_list_t * p_mlist, libvlc_exception_t * p_e ) ;
typedef void (*libvlc_media_list_view_release_func_t)( libvlc_media_list_view_t * p_mlv ) ; 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)( libvlc_media_list_view_t * p_mlv, typedef int (*libvlc_media_list_view_count_func_t)( libvlc_media_list_view_t * p_mlv,
...@@ -158,6 +159,7 @@ struct libvlc_media_list_view_t ...@@ -158,6 +159,7 @@ struct libvlc_media_list_view_t
libvlc_media_list_view_item_at_index_func_t pf_item_at_index; 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_children_at_index_func_t pf_children_at_index;
libvlc_media_list_view_constructor_func_t pf_constructor;
libvlc_media_list_view_release_func_t pf_release; libvlc_media_list_view_release_func_t pf_release;
/* Notification callback */ /* Notification callback */
...@@ -326,6 +328,7 @@ VLC_EXPORT ( libvlc_media_list_view_t *, libvlc_media_list_view_new, ...@@ -326,6 +328,7 @@ VLC_EXPORT ( libvlc_media_list_view_t *, libvlc_media_list_view_new,
libvlc_media_list_view_count_func_t pf_count, 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_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_children_at_index_func_t pf_children_at_index,
libvlc_media_list_view_constructor_func_t pf_constructor,
libvlc_media_list_view_release_func_t pf_release, libvlc_media_list_view_release_func_t pf_release,
void * this_view_data, void * this_view_data,
libvlc_exception_t * p_e ) ); libvlc_exception_t * p_e ) );
......
...@@ -294,6 +294,7 @@ libvlc_media_list_view_new( libvlc_media_list_t * p_mlist, ...@@ -294,6 +294,7 @@ libvlc_media_list_view_new( libvlc_media_list_t * p_mlist,
libvlc_media_list_view_count_func_t pf_count, 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_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_children_at_index_func_t pf_children_at_index,
libvlc_media_list_view_constructor_func_t pf_constructor,
libvlc_media_list_view_release_func_t pf_release, libvlc_media_list_view_release_func_t pf_release,
void * this_view_data, void * this_view_data,
libvlc_exception_t * p_e ) libvlc_exception_t * p_e )
...@@ -322,6 +323,7 @@ libvlc_media_list_view_new( libvlc_media_list_t * p_mlist, ...@@ -322,6 +323,7 @@ libvlc_media_list_view_new( libvlc_media_list_t * p_mlist,
p_mlv->pf_count = pf_count; p_mlv->pf_count = pf_count;
p_mlv->pf_item_at_index = pf_item_at_index; p_mlv->pf_item_at_index = pf_item_at_index;
p_mlv->pf_children_at_index = pf_children_at_index; p_mlv->pf_children_at_index = pf_children_at_index;
p_mlv->pf_constructor = pf_constructor;
p_mlv->pf_release = pf_release; p_mlv->pf_release = pf_release;
p_mlv->p_this_view_data = this_view_data; p_mlv->p_this_view_data = this_view_data;
...@@ -424,6 +426,27 @@ libvlc_media_list_view_parent_media_list( libvlc_media_list_view_t * p_mlv, ...@@ -424,6 +426,27 @@ libvlc_media_list_view_parent_media_list( libvlc_media_list_view_t * p_mlv,
return p_mlist; return p_mlist;
} }
/**************************************************************************
* libvlc_media_list_view_children_for_item (Public)
**************************************************************************/
libvlc_media_list_view_t *
libvlc_media_list_view_children_for_item( libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_md,
libvlc_exception_t * p_e)
{
(void)p_e;
libvlc_media_list_t * p_mlist;
libvlc_media_list_view_t * ret;
p_mlist = libvlc_media_descriptor_subitems(p_md, p_e);
if(!p_mlist) return NULL;
ret = p_mlv->pf_constructor( p_mlist, p_e );
libvlc_media_list_release( p_mlist );
return ret;
}
/* Limited to four args, because it should be enough */ /* Limited to four args, because it should be enough */
#define AN_SELECT( collapser, dec1, dec2, dec3, dec4, p, ...) p #define AN_SELECT( collapser, dec1, dec2, dec3, dec4, p, ...) p
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment