Logging improvements to allow prettier displays in the server GUI.
[dcpomatic.git] / src / lib / font.h
index 7009555c44a1b297fdee256fa00159ea570588fb..ca7650cc1b68d43406e2c8f27dd27e68762ea760 100644 (file)
 
 #include <libcxml/cxml.h>
 #include <boost/optional.hpp>
+#include <boost/signals2.hpp>
 #include <boost/filesystem.hpp>
 #include <string>
 
 class Font
 {
 public:
-       Font (std::string id_)
-               : id (id_) {}
+       Font (std::string id)
+               : _id (id) {}
 
        Font (cxml::NodePtr node);
 
        void as_xml (xmlpp::Node* node);
-       
-       /** Font ID */
-       std::string id;
-       boost::optional<boost::filesystem::path> file;
+
+       std::string id () const {
+               return _id;
+       }
+
+       boost::optional<boost::filesystem::path> file () const {
+               return _file;
+       }
+
+       void set_file (boost::filesystem::path file) {
+               _file = file;
+               Changed ();
+       }
+
+       boost::signals2::signal<void()> Changed;
+
+private:
+       /** Font ID, used to describe it in the subtitle content */
+       std::string _id;
+       boost::optional<boost::filesystem::path> _file;
 };
 
 bool