[vlc-devel] [PATCH] Adding metadata support to web-plugin

Niles Bindel zaggal69 at gmail.com
Tue Sep 8 19:30:10 CEST 2009


Pierre,

>>This is a feature. The naming clearly indicates that this is only running on the current media list *indexes*.
>>I don't see why you would remove those.

These functions could be replaced with functions like first(),
next(media_item),  prev(media_item), and last().  If we had access to
Media items at the Javascript level they would contain a pointer
reference that could be looked up in the media list/pseudo tree for
removal.  Therefore, any Media item would be guaranteed to exist
unlike when using the indexes.  It also opens the door to adding
insert_after and insert_before functionality, without the problems of
having to manage the indexes at the client level when adding a
function like insert_at_index.

I'll grant that the indexes currently allow a fast way for finding the
items in the list, but as we discussed previously in another post,
this should probably be turned into a tree implementation with an
iterator anyway.  As such, a movement away from using indexes to
locate items in the list would be an appropriate first step in that
direction.


>     cannot add/remove them from the list.

> This is not true.

Perhaps I'm missing something, but other than adding/removing the
parent media item from the list, I don't see how you can remove/add a
specific sub-item from a media item in Javascript.


>>     The replacement functions could
>>    reference the media_t pointer directly instead of an index which would
>>    ensure that the referenced media_t is the actual item desired and not
>>    just the one located at that index.

>>-1

>>While this can be done easily in a client application using the existing API, what you want to add does not allow the other way >>around. This is a loss of functionality.

I assume you are referring to the uses of the item_at_index functions
to iterate through the media list.  Yes, removing these functions
would not allow you to do this.  However, the addition of a first(),
next(media_item),  prev(media_item), last() item functions would allow
for such functionality or a list/tree iterator.


Ultimately, what I'm trying to avoid here is bad index references in
Javascript or in any client of the API.  If javascript users want to
manage their own lists/trees of media items, they currently cannot do
that without referencing the indexes given by the browser API.  If we
allow direct access to media items, they can organize them in whatever
fashion they see fit and they don't have to manage whether or not an
index is currently valid or not.  Additionally, I believe that
removing the need to manage any sort of indexes at the javascript
level makes for a much simpler and intuitive API.

Regards,

Niles



More information about the vlc-devel mailing list