<br><br>
<div class="gmail_quote">On Tue, Feb 2, 2010 at 5:50 PM, Pierre d'Herbemont <span dir="ltr"><<a href="mailto:pdherbemont@free.fr">pdherbemont@free.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">On Tue, Feb 2, 2010 at 5:33 PM, Jakob Leben <<a href="mailto:jakob.leben@gmail.com">jakob.leben@gmail.com</a>> wrote:<br><br>> Look, how can you avoid the various node manipulation functions, when it is<br>
> the modules that have to construct an input item tree? Only they know how to<br>> construct it, that is why they are there.<br><br></div>This can be done with input_item_New() and input_item_AddSubitem().<br>And a Flush function. Much more robust, lighter, and compatible with<br>
what we had.</blockquote>
<div> </div>
<div>Are you suggesting to add a new Flush function, that will mean the end of adding subitems?</div>
<div>In the patch I posted previously I had a different API that used input_item_BeingAddSubItems, then a series of input_item_AddSubitem, and in the end input_item_EndAddSubItems. The latter is then equivalent to your Flush function, if I understand you right. Fenrir commented on it, that it is not very well maintainable, because the Begin or End functions might be forgotten, when code is refactored. In response to that I made this API that needs modules to construct an input item tree and then notify about it in one single event. I think this is indeed more maintainable.</div>

<div> </div>
<div>Think of it like that: maybe playlist demuxers could indeed pass over a vlc_media_list_t or whatever it is called. input_item_node_t has the same function. And as I said recently, I think using a tree structure already at source of data is only good.</div>

<div> </div>
<div>Moreover, we could use the same API for more versatile services discovery, and it is a good ground as we can simply extend input_item_node_t if needed.</div>
<div> </div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">> For the moment, for judging the new API, think that input_item_AddSubitem<br>> calls are not there, because that will be removed. Or actually<br>> input_item_AddSubitem will be removed and the version 2 will come in its<br>
> place.<br><br></div>I got this. The naming is just wrong. First because of confusion with<br>the previous one, then because there is no flush notion what so ever.<br>You had to explain the difference to me, that prove that this was not<br>
rightly named.</blockquote>
<div> </div>
<div>First, the confusion was not ment to stay and was perceived by me as a minor hassle, because the state of having both functions there was for me very very temporary, only until a little bit more code is adjusted.</div>

<div> </div>
<div>Second since input_item_AddSubItemTree has a notion of flushing, then why doesn't input_item_AddSubItem? the name syntax is the same. And it only needs a notion of flushing --in relation-- to other input_item_node_XXX functions used in modules - which it does.</div>

<div>Well, maybe the word "Add" could be changed in --both-- functions to have even stronger flush notion.</div>
<div> </div>
<div> </div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">>>>>>> So here you could help me out. You could convert your<br>>>>>>> src/control/media.c to listen to vlc_InputItemSubItemTreeAdded event instead<br>>>>>>> and process the incoming tree structure. <<<<<<br>
<br></div>You see how much complexity it adds? I'd rather implement your API on<br>top of the previous one. I think what you've done is great, but the<br>module interface can be simplified.<br></blockquote>
<div>Well, I have already stated above couple of reasons for preferring my API.</div>
<div> </div>
<div>If you think making a small addition to src/control/media.c is too much work, I can swap input_intem_node_t for media_list (or whatever it is called) in my API, then there will be even less work to be done in src/control/media.c</div>

<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Thanks, I hope we'll move forward.<br>
<div>
<div></div>
<div class="h5"><br>Pierre.</div></div></blockquote>
<div> </div>
<div>Well, I am still very open for discussion and argumentation, I do want to listen and try to understand. I just haven't heard something that would overrule my arguments yet.</div>
<div> </div>
<div>I would also appreciate very much if others joined into discussion, so it is not just our two heads clashing between each other :)</div>
<div> </div>
<div>Cheers!</div>
<div> </div>
<div> </div></div>