diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-06-28 16:17:39 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-06-29 11:26:56 +0100 |
| commit | 29377b18a8cef724c8e2de2316a66ceae89a2e9a (patch) | |
| tree | 10bf8a39b26282274382e1d74aefa1603f10711e /src/lib/ratio.cc | |
| parent | cb845fc94ce2015138ddecb6c5a94e722361642a (diff) | |
Offer only flat/scope/full-frame as container choices and differentiate
the names from the UI for content ratios.
Diffstat (limited to 'src/lib/ratio.cc')
| -rw-r--r-- | src/lib/ratio.cc | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/src/lib/ratio.cc b/src/lib/ratio.cc index 82602d2f2..60384892d 100644 --- a/src/lib/ratio.cc +++ b/src/lib/ratio.cc @@ -27,22 +27,23 @@ using std::string; using std::vector; +using boost::optional; vector<Ratio const *> Ratio::_ratios; void Ratio::setup_ratios () { - _ratios.push_back (new Ratio (float(1290) / 1080, "119", _("1.19"), "119")); - _ratios.push_back (new Ratio (float(1440) / 1080, "133", _("4:3"), "133")); - _ratios.push_back (new Ratio (float(1485) / 1080, "138", _("Academy"), "137")); - _ratios.push_back (new Ratio (float(1544) / 1080, "143", _("IMAX"), "143")); - _ratios.push_back (new Ratio (float(1800) / 1080, "166", _("1.66"), "166")); - _ratios.push_back (new Ratio (float(1920) / 1080, "178", _("16:9"), "178")); - _ratios.push_back (new Ratio (float(1998) / 1080, "185", _("Flat"), "F")); - _ratios.push_back (new Ratio (float(2048) / 872, "235", _("2.35"), "S")); - _ratios.push_back (new Ratio (float(2048) / 858, "239", _("Scope"), "S")); - _ratios.push_back (new Ratio (float(2048) / 1080, "full-frame", _("Full frame"), "C")); + _ratios.push_back (new Ratio (float(1290) / 1080, "119", _("1.19"), optional<string>(), "119")); + _ratios.push_back (new Ratio (float(1440) / 1080, "133", _("1.33 (4:3)"), optional<string>(), "133")); + _ratios.push_back (new Ratio (float(1485) / 1080, "138", _("1.38 (Academy)"), optional<string>(), "137")); + _ratios.push_back (new Ratio (float(1544) / 1080, "143", _("1.43 (IMAX)"), optional<string>(), "143")); + _ratios.push_back (new Ratio (float(1800) / 1080, "166", _("1.66"), optional<string>(), "166")); + _ratios.push_back (new Ratio (float(1920) / 1080, "178", _("1.78 (16:9 or HD)"), optional<string>(), "178")); + _ratios.push_back (new Ratio (float(1998) / 1080, "185", _("1.85 (Flat)"), string(_("DCI Flat")), "F")); + _ratios.push_back (new Ratio (float(2048) / 872, "235", _("2.35"), optional<string>(), "S")); + _ratios.push_back (new Ratio (float(2048) / 858, "239", _("2.39 (Scope)"), string(_("DCI Scope")), "S")); + _ratios.push_back (new Ratio (float(2048) / 1080, "full-frame", _("1.90 (Full frame)"), string(_("Full frame")), "C")); } Ratio const * @@ -97,3 +98,20 @@ Ratio::nearest_from_ratio (float r) return nearest; } + +vector<Ratio const *> +Ratio::containers () +{ + vector<Ratio const *> r; + r.push_back (Ratio::from_id ("185")); + r.push_back (Ratio::from_id ("239")); + r.push_back (Ratio::from_id ("full-frame")); + return r; +} + +string +Ratio::container_nickname () const +{ + DCPOMATIC_ASSERT (_container_nickname); + return *_container_nickname; +} |
