A new core playlist for VLC 4

A new core playlist for VLC 4

For example, we can use a vector of s as follow:

Internally, the playlist uses a vector of playlist items:

UI frameworks typically use list models to bind items to a list view component. To understand why, let’s consider a typical sequence of calls executed by a view on its model, from the UI thread:

If we implemented and by delegating to the playlist, we would have to lock each call individually:

Note that locking and unlocking from the UI thread for every playlist item is not a good idea for responsiveness, but this is a minor issue here. In other words, resolve conflicts: find the items if they had been moved, ignore the items not found for removal…

For that purpose, in addition to functions modifying the content directly, the playlist exposes functions to request “desynchronized” changes, which automatically resolve conflicts and generate an appropriate sequence of events to notify the clients of the actual changes.

Source: blog.rom1v.com