diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-16 17:02:25 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-16 17:02:25 +0100 |
| commit | 1f82930e73679d6aec5223caa255f564339a1a2a (patch) | |
| tree | f65a262629f6f0fbe357efe6aded5f799bb7b757 /src/lib | |
| parent | fc56dc97103d00437843a31e1ef0c4915900ad1a (diff) | |
| parent | 5c6191a5a154e60ae8a1be8b09372be183c1a520 (diff) | |
Merge remote-tracking branch 'origin/master' into 1.0
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 71431ec0d..f2f25efe9 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -63,6 +63,7 @@ Config::Config () , _cinema_sound_processor (CinemaSoundProcessor::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) @@ -136,6 +137,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 ()); @@ -280,6 +286,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 66ff66214..03dd9c0fe 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -132,6 +132,10 @@ public: return _default_still_length; } + Ratio const * default_scale () const { + return _default_scale; + } + Ratio const * default_container () const { return _default_container; } @@ -281,6 +285,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 (); @@ -411,6 +420,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; dcp::XMLMetadata _dcp_metadata; diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index a2a4e6c6b..a8590ce55 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -63,7 +63,7 @@ VideoContent::VideoContent (shared_ptr<const Film> f) , _video_length (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 (); } @@ -73,7 +73,7 @@ VideoContent::VideoContent (shared_ptr<const Film> f, DCPTime s, ContentTime len , _video_length (len) , _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) , _video_length (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 (); } |
