diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-16 17:01:46 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-16 17:01:46 +0100 |
| commit | c37e655cd083a83c69215a1d3fa85db06a490102 (patch) | |
| tree | b4b6e1d42ad139bc671e4c842057ecc050eed5b5 /src/lib | |
| parent | 4861afbaab9c3710152d80f15c7a239c26deb74b (diff) | |
Add default scaling setting to preferences (#384).
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/config.cc | 9 | ||||
| -rw-r--r-- | src/lib/config.h | 10 | ||||
| -rw-r--r-- | src/lib/video_content.cc | 6 |
3 files changed, 22 insertions, 3 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index 24f9242ec..0588f01da 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -63,6 +63,7 @@ Config::Config () , _sound_processor (SoundProcessor::from_id (N_("dolby_cp750"))) , _allow_any_dcp_frame_rate (false) , _default_still_length (10) + , _default_scale (Ratio::from_id ("185")) , _default_container (Ratio::from_id ("185")) , _default_dcp_content_type (DCPContentType::from_isdcf_name ("TST")) , _default_j2k_bandwidth (100000000) @@ -133,6 +134,11 @@ Config::read () _language = f.optional_string_child ("Language"); + c = f.optional_string_child ("DefaultScale"); + if (c) { + _default_scale = Ratio::from_id (c.get ()); + } + c = f.optional_string_child ("DefaultContainer"); if (c) { _default_container = Ratio::from_id (c.get ()); @@ -341,6 +347,9 @@ Config::write () const if (_language) { root->add_child("Language")->add_child_text (_language.get()); } + if (_default_scale) { + root->add_child("DefaultScale")->add_child_text (_default_scale->id ()); + } if (_default_container) { root->add_child("DefaultContainer")->add_child_text (_default_container->id ()); } diff --git a/src/lib/config.h b/src/lib/config.h index 85e419a0a..44936172c 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -133,6 +133,10 @@ public: return _default_still_length; } + Ratio const * default_scale () const { + return _default_scale; + } + Ratio const * default_container () const { return _default_container; } @@ -282,6 +286,11 @@ public: changed (); } + void set_default_scale (Ratio const * s) { + _default_scale = s; + changed (); + } + void set_default_container (Ratio const * c) { _default_container = c; changed (); @@ -413,6 +422,7 @@ private: ISDCFMetadata _default_isdcf_metadata; boost::optional<std::string> _language; int _default_still_length; + Ratio const * _default_scale; Ratio const * _default_container; DCPContentType const * _default_dcp_content_type; libdcp::XMLMetadata _dcp_metadata; diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index 02cc1f810..15e1ca791 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -61,7 +61,7 @@ VideoContent::VideoContent (shared_ptr<const Film> f) , _original_video_frame_rate (0) , _video_frame_rate (0) , _video_frame_type (VIDEO_FRAME_TYPE_2D) - , _scale (Ratio::from_id ("185")) + , _scale (Config::instance()->default_scale ()) { setup_default_colour_conversion (); } @@ -72,7 +72,7 @@ VideoContent::VideoContent (shared_ptr<const Film> f, Time s, VideoContent::Fram , _original_video_frame_rate (0) , _video_frame_rate (0) , _video_frame_type (VIDEO_FRAME_TYPE_2D) - , _scale (Ratio::from_id ("185")) + , _scale (Config::instance()->default_scale ()) { setup_default_colour_conversion (); } @@ -83,7 +83,7 @@ VideoContent::VideoContent (shared_ptr<const Film> f, boost::filesystem::path p) , _original_video_frame_rate (0) , _video_frame_rate (0) , _video_frame_type (VIDEO_FRAME_TYPE_2D) - , _scale (Ratio::from_id ("185")) + , _scale (Config::instance()->default_scale ()) { setup_default_colour_conversion (); } |
