diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-02-18 17:42:58 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-02-18 17:42:58 +0000 |
| commit | d8a19dca28268e3ac92f117d00c1064c0b06515c (patch) | |
| tree | c3a9d9d6b25689c828578300c46361444bb72c1b /src/lib/content.h | |
| parent | 1b81ba7c24e7f117d1960021d7e28c8f0147009f (diff) | |
Various improvements to the content properties dialogue (including #791).
Diffstat (limited to 'src/lib/content.h')
| -rw-r--r-- | src/lib/content.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/lib/content.h b/src/lib/content.h index 283889485..d87ae13d7 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -27,6 +27,7 @@ #include "types.h" #include "signaller.h" #include "dcpomatic_time.h" +#include "raw_convert.h" #include <libcxml/cxml.h> #include <boost/filesystem.hpp> #include <boost/signals2.hpp> @@ -91,8 +92,6 @@ public: */ virtual std::list<DCPTime> reel_split_points () const; - std::list<std::pair<std::string, std::string> > properties () const; - boost::shared_ptr<Content> clone () const; void set_path (boost::filesystem::path); @@ -162,11 +161,31 @@ public: boost::shared_ptr<const Film> film () const; + class UserProperty + { + public: + template <class T> + UserProperty (std::string category_, std::string key_, T value_, std::string unit_ = "") + : category (category_) + , key (key_) + , value (raw_convert<std::string> (value_)) + , unit (unit_) + {} + + std::string category; + std::string key; + std::string value; + std::string unit; + }; + + std::list<UserProperty> user_properties () const; + boost::signals2::signal<void (boost::weak_ptr<Content>, int, bool)> Changed; protected: void signal_changed (int); - virtual void add_properties (std::list<std::pair<std::string, std::string> > &) const {} + + virtual void add_properties (std::list<UserProperty> &) const {} boost::weak_ptr<const Film> _film; |
