Hello,<br><br>I remember someone said that the separation between flat and tree playlist remained because some modules were not compatible with tree playlist. I think keeping this separation complicates many algorithms concerning the playlist and I see it as a big step forward to remove this separation. Does anybody know of a case where tree structure would still be a problem?<br>
<br>In my opinion we could simply implement a "flatten down" function and wherever a flat representation of a tree of items is needed, it could be flattened in one step. And I certainly don't see a big profit in having a flat and a tree representation at the same time, as synchronizing them is quite a problem and even impossible in some cases (moving and adding items in flat structure doesn't have a uniquely matching and equivalent action in tree structure - regarding the item position). I also think that from an end-user's point of view, they either want a flat or a tree representation of a group of items and they can be offered the "flatten" operation through GUI as well.<br>
<br>The core of the change would be to have only one "playlist_item_t *p_root" field in playlist_t structure and under it only one node for playlist, media library and services discoveries each.<br>"grep"-ing the vlc repository for "p_root_onelevel", "p_root_category", "p_local_onelevel", "p_local_category", "p_ml_onelevel" or "p_ml_category" which are fields of public playlist_t structure returns only a dozen of different files, so I guess the amount of code affected by the change need not be too huge.<br>
<br>If somebody agrees about the benefit in doing this change, I would like to hear advice about how to make the transition smooth, meaning that the code dependent on the basic change in playlist_t could be modified chunk by chunk and not yet adjusted code would still work during the process.<br>
My idea is to add the new p_root field <i>besides</i> p_root_onelevel and p_root_category, and modifying the core playlist functions to always keep the structures under <i>p_root</i> and <i>p_root_category</i> a copy of each other. Next we implement the flatten function. Then we go to modify the relevant code in vlc/modules/ to only reference <i>playlist_t :: p_root</i> and use the flatten function where flat representation is needed. Only in the end we change the src/playlist code to forget about p_root_onelevel and p_root_category.<br>
<br>Any thoughts very welcome, please.<br><br>Best regards,<br>Jakob<br>