Switch to unified view

a/src/mediaserver/contentdirectory.hxx b/src/mediaserver/contentdirectory.hxx
...
...
26
#include "cdplugins/cdplugin.hxx"
26
#include "cdplugins/cdplugin.hxx"
27
#include "mediaserver.hxx"
27
#include "mediaserver.hxx"
28
28
29
using namespace UPnPP;
29
using namespace UPnPP;
30
30
31
// Content Directory service
32
//
33
// The actual work is done by separate plugins (CDPlugin interface),
34
// depending of where the data comes from (streaming service, e.g,
35
// Tidal, Qobuz, or local file store - uprcl). There is currently a
36
// single implementation of CDPlugin (PlgWithSlave) for which most of
37
// the differentiated work is done by a Python subprocess specific to
38
// the backend.
39
//
40
// The CDPluginServices interface provides some service callbacks to
41
// the implementations.
42
//
43
// The class is responsible for generating the root directory,
44
// according to what services are enabled. For deeper directories, the
45
// dispatch to the right service is performed according to the first
46
// element in the object ID (e.g. $qobuz$).
47
//
48
// Accordingly, the media access also depends on the type of backend,
49
// and some media URIs are also formed in order to be dispatchable
50
// (e.g. http://xxx/qobuz/...). Some also point directly to a server
51
// implemented by the plugin. Depending on the service, either
52
// redirection or proxying is used to supply the data stream.
53
//
54
// We also have a special operation mode where the browsing is done by
55
// the CP and we are only used for accessing the streams (see
56
// constructor comment).
31
class ContentDirectory : public UPnPProvider::UpnpService,
57
class ContentDirectory : public UPnPProvider::UpnpService,
32
                         public CDPluginServices {
58
                         public CDPluginServices {
33
public:
59
public:
34
    // Enabled==false : used for ohcredentials, no services locally
60
35
    // enabled, force some initializations
61
    // Constructor.
62
    // 
63
    // Enabled==false: means that no content directory service is
64
    // actually needed. No service will be enabled, but we perform
65
    // some initializations. This is used in conjunction with
66
    // OHCredentials. The Control Point (typ. Kazoo) does the
67
    // browsing, and sends tidal://xx or qobuz://xx URIs to
68
    // OHPlaylist. The URI contain the service trackid, and are
69
    // translated by OHPlaylist/OHCredentials into the form which is
70
    // generated when this class does the browsing. The data access is
71
    // then performed as if the URIs had been generated by us.
36
    ContentDirectory(MediaServer *dev, bool enabled);
72
    ContentDirectory(MediaServer *dev, bool enabled);
73
37
    ~ContentDirectory();
74
    ~ContentDirectory();
38
75
39
    /// Return plugin based on path prefix
76
    /// Return plugin based on path prefix
40
    CDPlugin *getpluginforpath(const std::string& path);
77
    CDPlugin *getpluginforpath(const std::string& path);
41
78
42
    /// Retrieve the IP address and port for the libupnp server. URLs
79
    /// Retrieve the IP address and port for the libupnp server. URLs
43
    /// intended to be served this way (by adding a vdir) should use
80
    /// intended to be served this way (by adding a vdir) should use
44
    /// these as host/port
81
    /// these as host/port
45
    virtual std::string getupnpaddr(CDPlugin *);
82
    virtual std::string getupnpaddr(CDPlugin *);
46
    virtual int getupnpport(CDPlugin *);
83
    virtual int getupnpport(CDPlugin *);
47
48
    /// Add a virtual directory and set file operation interface. path
49
    /// must be equal or begin with the pathprefix.
50
    virtual bool setfileops(CDPlugin *, const std::string& path,
51
                            UPnPProvider::VirtualDir::FileOps ops);
52
84
53
    virtual std::string getfname();
85
    virtual std::string getfname();
54
86
55
    /// Check if the configuration indicates that the media server
87
    /// Check if the configuration indicates that the media server
56
    /// needs to be started.
88
    /// needs to be started.