diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-05-31 02:40:50 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-06-17 00:04:03 +0200 |
| commit | dce8911cbc577f9f8f272d78c455e708c0b47aa9 (patch) | |
| tree | 7884dc6b40bd88c3bef6e4b354799c7044e32756 /src/lib | |
| parent | ec06811bae7ed4fc6bd80c3154fd473028ee8e13 (diff) | |
Support cropping of content on playback (#3041).
This is to allow, for example, pillarboxed 1.78:1 DCPs to be played nicely
on 1.78:1 projectors. DCP-o-matic can now crop the pillarboxing before
display, rather than putting the pillarboxed 1.85:1 onto a 1.78:1 monitor,
thereby adding letterboxing.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/config.cc | 6 | ||||
| -rw-r--r-- | src/lib/config.h | 18 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index d8402e2ec..5f3f2f6fe 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -614,6 +614,8 @@ try _player_restricted_menus = f.optional_bool_child("PlayerRestrictedMenus").get_value_or(false); _playlist_editor_restricted_menus = f.optional_bool_child("PlaylistEditorRestrictedMenus").get_value_or(false); + _player_crop_output_ratio = f.optional_number_child<float>("PlayerCropOutputRatio"); + _image_display = f.optional_number_child<int>("ImageDisplay").get_value_or(0); auto vc = f.optional_string_child("VideoViewType"); if (vc && *vc == "opengl") { @@ -1081,6 +1083,10 @@ Config::write_config() const cxml::add_text_child(root, "PlaylistEditorRestrictedMenus", "1"); } + if (_player_crop_output_ratio) { + cxml::add_text_child(root, "PlayerCropOutputRatio", fmt::to_string(*_player_crop_output_ratio)); + } + /* [XML] ImageDisplay Screen number to put image on in dual-screen player mode. */ cxml::add_text_child(root, "ImageDisplay", fmt::to_string(_image_display)); switch (_video_view_type) { diff --git a/src/lib/config.h b/src/lib/config.h index 9f6d1c743..2bc700e86 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -554,6 +554,10 @@ public: return _playlist_editor_restricted_menus; } + boost::optional<float> player_crop_output_ratio() const { + return _player_crop_output_ratio; + } + int image_display() const { return _image_display; } @@ -1101,6 +1105,19 @@ public: maybe_set(_player_mode, m); } + void set_player_crop_output_ratio(float ratio) { + maybe_set(_player_crop_output_ratio, ratio); + } + + void unset_player_crop_output_ratio() { + if (!_player_crop_output_ratio) { + return; + } + + _player_crop_output_ratio = boost::none; + changed(OTHER); + } + void set_image_display(int n) { maybe_set(_image_display, n); } @@ -1459,6 +1476,7 @@ private: PlayerMode _player_mode; bool _player_restricted_menus = false; bool _playlist_editor_restricted_menus = false; + boost::optional<float> _player_crop_output_ratio; int _image_display; VideoViewType _video_view_type; bool _respect_kdm_validity_periods; |
