summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-07-20 15:20:56 +0100
committerCarl Hetherington <cth@carlh.net>2018-07-20 15:20:56 +0100
commitf82bdaa6ffe1a9e62a010de405f8bbb7ea392f00 (patch)
tree8eb15d2df9cd0bed17684d79ba481d453e344eaf /src/lib
parentb6746acdc852bb33a386cff6109e03d1791cb310 (diff)
Add advanced configuration option to allow any container ratio,
specifically because the GDC SX-2001 will only play 25fps DCPs with a 16:9 ratio (not Flat). https://www.dcpomatic.com/forum/viewtopic.php?f=2&t=1119&p=4470
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.cc4
-rw-r--r--src/lib/config.h13
-rw-r--r--src/lib/ratio.cc15
3 files changed, 30 insertions, 2 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 56ab16db7..7e2cdabf6 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -94,6 +94,7 @@ Config::set_defaults ()
_tms_password = "";
_cinema_sound_processor = CinemaSoundProcessor::from_id (N_("dolby_cp750"));
_allow_any_dcp_frame_rate = false;
+ _allow_any_container = false;
_language = optional<string> ();
_default_still_length = 10;
_default_container = Ratio::from_id ("185");
@@ -343,6 +344,7 @@ try
_maximum_j2k_bandwidth = f.optional_number_child<int> ("MaximumJ2KBandwidth").get_value_or (250000000);
_allow_any_dcp_frame_rate = f.optional_bool_child ("AllowAnyDCPFrameRate").get_value_or (false);
+ _allow_any_container = f.optional_bool_child ("AllowAnyContainer").get_value_or (false);
_log_types = f.optional_number_child<int> ("LogTypes").get_value_or (LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR);
_analyse_ebur128 = f.optional_bool_child("AnalyseEBUR128").get_value_or (true);
@@ -677,6 +679,8 @@ Config::write_config () const
root->add_child("MaximumJ2KBandwidth")->add_child_text (raw_convert<string> (_maximum_j2k_bandwidth));
/* [XML] AllowAnyDCPFrameRate 1 to allow users to specify any frame rate when creating DCPs, 0 to limit the GUI to standard rates */
root->add_child("AllowAnyDCPFrameRate")->add_child_text (_allow_any_dcp_frame_rate ? "1" : "0");
+ /* [XML] AllowAnyContainer 1 to allow users to user any container ratio for their DCP, 0 to limit the GUI to standard containers */
+ root->add_child("AllowAnyContainer")->add_child_text (_allow_any_container ? "1" : "0");
/* [XML] LogTypes Types of logging to write; a bitfield where 1 is general notes, 2 warnings, 4 errors, 8 debug information related
to encoding, 16 debug information related to encoding, 32 debug information for timing purposes, 64 debug information related
to sending email.
diff --git a/src/lib/config.h b/src/lib/config.h
index 4c24e816b..dbe6a9c21 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -148,6 +148,10 @@ public:
return _allow_any_dcp_frame_rate;
}
+ bool allow_any_container () const {
+ return _allow_any_container;
+ }
+
ISDCFMetadata default_isdcf_metadata () const {
return _default_isdcf_metadata;
}
@@ -488,6 +492,10 @@ public:
maybe_set (_allow_any_dcp_frame_rate, a);
}
+ void set_allow_any_container (bool a) {
+ maybe_set (_allow_any_container, a);
+ }
+
void set_default_isdcf_metadata (ISDCFMetadata d) {
maybe_set (_default_isdcf_metadata, d);
}
@@ -857,6 +865,11 @@ private:
std::list<int> _allowed_dcp_frame_rates;
/** Allow any video frame rate for the DCP; if true, overrides _allowed_dcp_frame_rates */
bool _allow_any_dcp_frame_rate;
+ /** Allow any container ratio, not just the standard ones. GDC SX-2001 will not play Flat
+ DCPs at 25fps but will play 16:9, so this is very useful for some users.
+ https://www.dcpomatic.com/forum/viewtopic.php?f=2&t=1119&p=4468
+ */
+ bool _allow_any_container;
/** Default ISDCF metadata for newly-created Films */
ISDCFMetadata _default_isdcf_metadata;
boost::optional<std::string> _language;
diff --git a/src/lib/ratio.cc b/src/lib/ratio.cc
index eae12b061..8a86ced59 100644
--- a/src/lib/ratio.cc
+++ b/src/lib/ratio.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -20,6 +20,7 @@
#include "ratio.h"
#include "util.h"
+#include "config.h"
#include <dcp/types.h>
#include <cfloat>
@@ -102,6 +103,10 @@ Ratio::nearest_from_ratio (float r)
vector<Ratio const *>
Ratio::containers ()
{
+ if (Config::instance()->allow_any_container()) {
+ return _ratios;
+ }
+
vector<Ratio const *> r;
r.push_back (Ratio::from_id ("185"));
r.push_back (Ratio::from_id ("239"));
@@ -112,6 +117,12 @@ Ratio::containers ()
string
Ratio::container_nickname () const
{
- DCPOMATIC_ASSERT (_container_nickname);
+ if (!_container_nickname) {
+ /* Fall back to the image nickname; this just for when non-standard container
+ ratios are enabled.
+ */
+ return _image_nickname;
+ }
+
return *_container_nickname;
}