X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fratio.h;h=31ff0935896c4f40a1e82a37e4852263d0055a13;hb=a31cfda11a8e3260cdf267be056cb9b4f4b158dd;hp=42f29458ab883deead8b9ea4f826d3eefa6da5d1;hpb=29377b18a8cef724c8e2de2316a66ceae89a2e9a;p=dcpomatic.git diff --git a/src/lib/ratio.h b/src/lib/ratio.h index 42f29458a..31ff09358 100644 --- a/src/lib/ratio.h +++ b/src/lib/ratio.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,14 +18,20 @@ */ + #ifndef DCPOMATIC_RATIO_H #define DCPOMATIC_RATIO_H + #include #include #include -class Ratio : public boost::noncopyable + +/** @class Ratio + * @brief Description of an image ratio. + */ +class Ratio { public: Ratio (float ratio, std::string id, std::string in, boost::optional cn, std::string d) @@ -46,6 +52,10 @@ public: std::string container_nickname () const; + bool used_for_container () const { + return static_cast(_container_nickname); + } + std::string isdcf_name () const { return _isdcf_name; } @@ -59,9 +69,7 @@ public: static Ratio const * from_ratio (float r); static Ratio const * nearest_from_ratio (float r); - static std::vector all () { - return _ratios; - } + static std::vector all (); static std::vector containers (); @@ -75,7 +83,8 @@ private: boost::optional _container_nickname; std::string _isdcf_name; - static std::vector _ratios; + static std::vector _ratios; }; + #endif