changes type of NetworkDeviceModel.artworkUrl from QUrl to string
fixing artwork loading in table view since there code assumed a string
is returned. This matches other places where thumbnail/artwork urls are
returned as strings
This C++ listener is actually a wrapper over a media tree listener, not
a media source listener.
This allows to make NetworkMediaModel independent of media sources, so
that it can be reused with only a media tree not linked to a media
source.
NetworkDeviceModel, which still requires a media source, stores it in
its listener callbacks implementation (ListenerCb).
For each model (NetworkDeviceModel and NetworkMediaModel), every
NetworkSourceListener instance were created with the same
SourceListenercb instance:
+------------------+
| SourceListenerCb |-----------------------------.
+------------------+ |
^ |
| implements |
+--------------------+ |
| NetworkDeviceModel | |
+--------------------+ |
| m_listeners |
+---+ +-----------------------+ |
| ---------------| NetworkSourceListener |-|
+---+ +-----------------------+ |
| ---------- +-----------------------+ |
+---+ `----| NetworkSourceListener |-|
| -------... +-----------------------+ .
+---+ .
| | .
+---+
To prepare storing additional data for each registration, use one
SourceListenerCb instance per listener:
+------------------+
| SourceListenerCb |
+------------------+
^
implements |
+--------------------+ |
| NetworkDeviceModel | |
+--------------------+ |
| m_listeners |
+---+ +-----------------------+ +--------------+ |
| ------------| NetworkSourceListener |--| MyListenerCb |-|
+---+ +-----------------------+ +--------------+ |
| ---------- +-----------------------+ +--------------+ |
+---+ `-| NetworkSourceListener |--| MyListenerCb |-|
| -------... +-----------------------+ +--------------+ .
+---+ .
| | .
+---+
In practice, this will allow the SourceListenerCb (to be renamed to
MediaTreeListenerCb) to only use a media tree (not a media source), and
let the caller store an additional associated media source usable
from the callbacks implementation.
As a drawback, the MyListenerCb instance must be owned by the listener
(to avoid additional complexity on the client side), but then this
forces the client to always create a separate class for the listener
callbacks, even when not necessary (i.e. making NetworkMediaModel
"implement" SourceListenerCb is not possible anymore).
Alternatives considered:
1. keep SourceListenerCb as is, but make NetworkSourceListener virtual
(inheritable), so that the additional media source could be stored
there. As a drawback, the SourceListenerCb methods would need to get
the NetworkSourceListener instance as parameter (so yet another
indirection). And having both the listener and the callbacks virtual
seems odd.
2. merge SourceListenerCb into NetworkSourceListener, so that the
client can just inherit and store additional private data in the
same class. But this requires more changes from the existing code
base.
this will allow to unload the interface module without unloading Qt in a
further patch.
the new structure is still a vlc object as we use it notably for logging
capacity and to interact with vlc variables
this fixes issues when we get the callback from a node after we changes view
and end up displaying the content of a folder within the device view
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
device uri was added with a trailling / but the comparison
for removal was done without it
the trailling / is no longer required
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
using the input item discovered by the Media Tree may provide more properties
than using the mrl, such as attached subtitles.
NetworkMediaModel and NetworkDeviceModel now expose an
addToPlaylist and addAndPlay method like the media library
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
* MLNetworkDeviceModel allows to list available devices
* MLNetworkMediaModel allows to browse a media tree
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>