Merge master.
[dcpomatic.git] / src / lib / server_finder.h
index 04a7786cf4442a255268660a93a9673626f4dcc8..202bee8f920d9610bd82c50b6951ea701199ed25 100644 (file)
 #include <boost/signals2.hpp>
 #include "server.h"
 
-class ServerFinder
+class ServerFinder : public ExceptionStore
 {
 public:
        void connect (boost::function<void (ServerDescription)>);
 
        static ServerFinder* instance ();
 
+       void disable () {
+               _disabled = true;
+       }
+
 private:
        ServerFinder ();
 
        void broadcast_thread ();
        void listen_thread ();
 
+       bool server_found (std::string) const;
+
        boost::signals2::signal<void (ServerDescription)> ServerFound;
+
+       bool _disabled;
        
        /** Thread to periodically issue broadcasts to find encoding servers */
        boost::thread* _broadcast_thread;
@@ -41,7 +49,7 @@ private:
        boost::thread* _listen_thread;
 
        std::list<ServerDescription> _servers;
-       boost::mutex _mutex;
+       mutable boost::mutex _mutex;
 
        static ServerFinder* _instance;
 };