Switch to unified view

a/src/mediaserver/cdplugins/cdplugin.hxx b/src/mediaserver/cdplugins/cdplugin.hxx
...
...
25
class ConfSimple;
25
class ConfSimple;
26
26
27
/// Service/Environment interface for media server modules
27
/// Service/Environment interface for media server modules
28
class CDPluginServices {
28
class CDPluginServices {
29
public:
29
public:
30
    /// For modules which use the common microhttpd server
30
    /// Returns something like "/tidal" (no end slash)
31
    /// (tidal/qobuz/gmusic). Returns something like "/tidal" (no end
32
    /// slash), which must be inserted at the top of the track URLs
33
    /// paths so that an HTTP request can be processed-for /
34
    /// dispatched-to the right plugin.
31
    virtual std::string getpathprefix(CDPlugin *) = 0;
35
    virtual std::string getpathprefix(CDPlugin *) = 0;
36
    /// Returns the plugin to which belongs the parameter path, based
37
    /// on the path prefix above.
38
    virtual CDPlugin *getpluginforpath(const std::string& path) = 0;
32
39
33
    /// Returns the plugin to which belongs the parameter path, based
40
    /// Retrieve the "friendly name" for the media server, for display purposes
34
    /// on the path prefix above
41
    virtual std::string getfname() = 0;
35
    virtual CDPlugin *getpluginforpath(const std::string& path) = 0;
36
    
42
    
37
    /// Retrieve the IP address and port for the libupnp server. URLs
43
    /// IP address for the server.
38
    /// intended to be served this way (by adding a vdir) should use
44
    ///
39
    /// these as host/port
45
    /// This is the host address / network interface used by libupnp,
46
    /// which can only support one. All generated URLs should be for
47
    /// this address as this is the only one guaranteed to be
48
    /// accessible from clients (in case this server has several
49
    /// interfaces). 
40
    virtual std::string getupnpaddr(CDPlugin *) = 0;
50
    virtual std::string getupnpaddr(CDPlugin *) = 0;
51
    
52
    /// IP port used by the libupnp HTTP server.
53
    ///
54
    /// URLs intended to be served this way (by adding a vdir) should
55
    /// use this for the port value. No module does this at present so
56
    /// that this call is not used. The microhttpd instance (serves
57
    /// for the tidal/qobuz/gmusic plugins) uses port 49149 by
58
    /// default. The value can be changed with the "plgmicrohttpport"
59
    /// configuration variable. The local mediaserver (uprcl) uses
60
    /// neither the libupnp HTTP server nor microhttpd, but an internal
61
    /// Python server instance, on port 9090 by default (can be
62
    /// changed with the "uprclhostport" configuration variable).
41
    virtual int getupnpport(CDPlugin *) = 0;
63
    virtual int getupnpport(CDPlugin *) = 0;
42
64
43
    /// Add a virtual directory and set file operation interface. path
65
    /// Add a virtual directory and set file operation interface. path
44
    /// must be equal or begin with the pathprefix.
66
    /// must be equal or begin with the pathprefix. Not used at all at present.
45
    virtual bool setfileops(CDPlugin *, const std::string& path,
67
    virtual bool setfileops(CDPlugin *, const std::string& path,
46
                            UPnPProvider::VirtualDir::FileOps ops)= 0;
68
                            UPnPProvider::VirtualDir::FileOps ops)= 0;
47
69
48
    /// Get a pointer to the the main configuration file contents.
70
    /// Get a pointer to the the main configuration file contents.
49
    virtual ConfSimple *getconfig(CDPlugin *)= 0;
71
    virtual bool config_get(const std::string& nm, std::string& val) = 0;
50
51
    /// This calls plg->getname() and returns something like
52
    /// datadir/nm/nm-app.py. Can't see why this is in contentdirectory
53
    /// since it seems very specific to plgwithslave...
54
    virtual std::string getexecpath(CDPlugin *)= 0;
55
};
72
};
56
73
57
/// Interface to media server modules
74
/// Interface to media server modules
58
///
75
///
59
/// The main operations, Browse and Search, return content as UpSong
76
/// The main operations, Browse and Search, return content as UpSong