X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fformat.h;h=cc7502893149a800a9ea432bec5ff277c6e54016;hb=6bc12a2eeb9c84a539688f2f7eb876e3ea278a9f;hp=2118237a406525e99295765270d4133e3cf98e87;hpb=110d7d4e111c2db31489296587d855328c5d8b34;p=dcpomatic.git diff --git a/src/lib/format.h b/src/lib/format.h index 2118237a4..cc7502893 100644 --- a/src/lib/format.h +++ b/src/lib/format.h @@ -31,11 +31,12 @@ class Film; class Format { public: - Format (Size dcp, std::string id, std::string n, std::string d) + Format (libdcp::Size dcp, std::string id, std::string n, std::string d, std::string e) : _dcp_size (dcp) , _id (id) , _nickname (n) , _dci_name (d) + , _description (e) {} /** @return the aspect ratio multiplied by 100 @@ -46,13 +47,16 @@ public: /** @return the ratio as a floating point number */ virtual float ratio_as_float (boost::shared_ptr f) const = 0; - int dcp_padding (boost::shared_ptr f) const; + /** @return the ratio of the container (including any padding) as a floating point number */ + float container_ratio_as_float () const; + + int dcp_padding (boost::shared_ptr) const; /** @return size in pixels of the images that we should * put in a DCP for this ratio. This size will not correspond * to the ratio when we are doing things like 16:9 in a Flat frame. */ - Size dcp_size () const { + libdcp::Size dcp_size () const { return _dcp_size; } @@ -72,6 +76,10 @@ public: return _dci_name; } + std::string description () const { + return _description; + } + std::string as_metadata () const; static Format const * from_nickname (std::string n); @@ -81,16 +89,17 @@ public: static void setup_formats (); protected: - /** Size in pixels of the images that we should + /** libdcp::Size in pixels of the images that we should * put in a DCP for this ratio. This size will not correspond * to the ratio when we are doing things like 16:9 in a Flat frame. */ - Size _dcp_size; + libdcp::Size _dcp_size; /** id for use in metadata */ std::string _id; /** nickname (e.g. Flat, Scope) */ std::string _nickname; std::string _dci_name; + std::string _description; private: /** all available formats */ @@ -104,7 +113,7 @@ private: class FixedFormat : public Format { public: - FixedFormat (int, Size, std::string, std::string, std::string); + FixedFormat (int, libdcp::Size, std::string, std::string, std::string, std::string); int ratio_as_integer (boost::shared_ptr) const { return _ratio; @@ -125,7 +134,7 @@ private: class VariableFormat : public Format { public: - VariableFormat (Size, std::string, std::string, std::string); + VariableFormat (libdcp::Size, std::string, std::string, std::string, std::string); int ratio_as_integer (boost::shared_ptr f) const; float ratio_as_float (boost::shared_ptr f) const;