[vlc-devel] [RFC] LibVLC media_list_enumerator

Damien Fouilleul Damien.Fouilleul at laposte.net
Thu Sep 6 00:04:04 CEST 2007


Pierre d'Herbemont wrote:
> Hello,
>
> Damien suggested me to implement some enumerators object to parse the  
> media_list.
>
> For instance we want to see the media_list has a:
> - tree of media
> - flat view of all media and sub media
> - tree of the media who are nodes.
>
> So for each media_list viewing method we'll have a different enumerator.
>
> The basic type would be:
>
> libvlc_media_list_enumerator /* items are media_descriptor */
> 	_new (internal)
>          _retain
>          _release
>
> /* Reading */
> 	/* With the built in counter */
>          _reset
>          _next
>          _prev
>
> 	/* With an index */
>          _item_at_index
>          _index_of_item
>
>   
typically enumerators/iterators don't provide indexing type ability, 
because the query behind the enumerator may not easily provide that sort 
of operation (without using an array internally), but if you think that 
this does not add any code complexity, then go for it. Typically, if an 
enumerator requires a complex state machine or maintain some sort of 
array internally, then we may be better of getting an array rather than 
an enumerator
> /* Editing */
> 	_insert_item
> 	_remove_item
> 	_replace_item
>
>   
some iterators may be read only due to the internal query driving them 
(.ie sort by artist and enumerate), this should be optional or in a subclass


> 	_remove_item_at_index
>          _insert_item_at_index
> 	_replace_item_at_index
>
>   
ditto

> In the media_list the following would be added:
>
> libvlc_media_list
> 	_all_media_enumerator
> 	_node_enumerator
> 	_enumerator
>
>   
what is the difference b/w all all_media_enumerator and enumerator, does 
one exclude nodes ?

> If you have questions don't hesitate, or don't understand a name  
> don't hesitate.
>
> Pierre.
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>   





More information about the vlc-devel mailing list