diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 30 | ||||
-rw-r--r-- | include/contentDirectory.h | 1 | ||||
-rw-r--r-- | include/server.h | 11 | ||||
-rw-r--r-- | include/service.h | 1 | ||||
-rw-r--r-- | include/tools.h | 3 | ||||
-rw-r--r-- | include/webserver.h | 10 |
6 files changed, 20 insertions, 36 deletions
diff --git a/include/config.h b/include/config.h index b149316..187e46f 100644 --- a/include/config.h +++ b/include/config.h @@ -32,13 +32,7 @@ struct cConfig { * debugging. */ bool expertSettings; - /** - * Use the internal web server - * - * If this is true, the internal web server is used for streaming of files. - * Otherwise an external URL is used. - */ - bool useInternalWebserver; + /** * Web server root directory * @@ -46,12 +40,14 @@ struct cConfig { * is empty, the default directory (plugins configuration folder) is used. */ string webServerRoot; + /** * Web server port * * This is the port where the web server is listening on. */ uint16_t webServerPort; + /** * External web server URL * @@ -59,6 +55,10 @@ struct cConfig { * empty, the default presentation URL, which is /index.html is used. */ string presentationURL; + + bool useLive; + uint16_t livePort; + /** * Maximum size of SOAP messages * @@ -81,22 +81,9 @@ struct cConfig { * it will be generated. */ string deviceUUID; + void GenerateNewDeviceUUID(); /** - * Service URL - * - * This is the URL to the services and service descriptors of that services. - */ - string serviceURL; - - /** - * Static content URL - * - * This is the URL to the static content of the server. They must be located within the - * network of the server. - */ - string staticContentURL; - /** * Bind the server to an IP address * * If this is true, the media server is bound to the specified IP address, @@ -106,6 +93,7 @@ struct cConfig { string address; string interface; + /** * The media server listening port * diff --git a/include/contentDirectory.h b/include/contentDirectory.h index c2edffc..92544a0 100644 --- a/include/contentDirectory.h +++ b/include/contentDirectory.h @@ -33,6 +33,7 @@ public: virtual void SetError(Upnp_Action_Request* request, int error); virtual void Init(cMediaServer* server, UpnpDevice_Handle deviceHandle); + virtual void Stop(); private: int GetSearchCapabilities(Upnp_Action_Request* Request); int GetSortCapabilities(Upnp_Action_Request* Request); diff --git a/include/server.h b/include/server.h index 349239c..3f24725 100644 --- a/include/server.h +++ b/include/server.h @@ -24,7 +24,7 @@ class cMediaServer { public: struct Description { - Description(string, string, string , string, string, string , string, string); + Description(string, string, string , string, string, string , string, string, string); string friendlyName; string manufacturer; string manufacturerURL; @@ -33,6 +33,7 @@ public: string modelNumber; string modelURL; string serialNumber; + string descriptionFile; }; struct ServerIcon { @@ -50,8 +51,6 @@ public: bool Start(); bool Stop(); - bool IsRunning() const; - static cMediaServer* GetInstance(); void SetConfiguration(upnp::cConfig newConfig); @@ -75,11 +74,6 @@ public: static void RegisterService(cUPnPService* service); private: - class RuntimeException : public std::exception { - public: - virtual const char* what() const throw(); - }; - cMediaServer(); string GetDeviceDescriptionUrl() const; @@ -95,7 +89,6 @@ private: UpnpDevice_Handle mDeviceHandle; int mAnnounceMaxAge; size_t mMaxContentLength; - bool mIsRunning; cWebserver* mWebserver; cMediaManager* mMediaManager; diff --git a/include/service.h b/include/service.h index 07d3551..1ed4e91 100644 --- a/include/service.h +++ b/include/service.h @@ -33,6 +33,7 @@ public: virtual ~cUPnPService(); virtual void Init(cMediaServer* server, UpnpDevice_Handle deviceHandle); + virtual void Stop(); virtual int Subscribe( Upnp_Subscription_Request* Request ///< Information about the subscription diff --git a/include/tools.h b/include/tools.h index bd82cd4..e322adc 100644 --- a/include/tools.h +++ b/include/tools.h @@ -106,12 +106,13 @@ char* substr(const char* str, unsigned int offset, unsigned int length); namespace upnp { typedef std::list<std::string> StringList; + typedef std::vector<std::string> StringVector; typedef std::map<std::string, uint32_t> IdList; namespace tools { string GetAddressByInterface(string Interface); string GetNetworkInterfaceByIndex(int Index, bool skipLoop); - vector<string> GetNetworkInterfaces(bool skipLoop); + StringVector GetNetworkInterfaces(bool skipLoop); string ToString(long number); diff --git a/include/webserver.h b/include/webserver.h index 240d4d6..39ca8df 100644 --- a/include/webserver.h +++ b/include/webserver.h @@ -22,8 +22,8 @@ namespace upnp { cWebserver(std::string address); virtual ~cWebserver(); - void SetWebserverRootDir(std::string rootDirectory, std::string staticContentUrl, std::string presentationUrl); - void SetServiceUrl(std::string descriptionUrl, std::string controlUrl); + void SetWebserverRootDir(std::string rootDirectory); + void SetPresentationUrl(std::string presentationUrl); void SetListenerPort(uint16_t port); @@ -47,14 +47,14 @@ namespace upnp { std::string mListenerAddress; uint16_t mListenerPort; - std::string mServiceUrl; - std::string mControlUrl; - std::string mStaticContentUrl; std::string mPresentationUrl; + std::string mStaticContentUrl; + std::string mServiceUrl; class cWSThread : public cThread { public: cWSThread(cWebserver& webServer); + void Stop(); virtual void Action(void); private: cWebserver& mWebserver; |