summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-10-13 23:47:33 +0200
committerCarl Hetherington <cth@carlh.net>2019-10-13 23:47:33 +0200
commita9dde34b8772ef8b985af067e2ff709be4e3cab6 (patch)
treeec6dad9b92f1e58359b139b35dd349cfdc7b1094 /src/lib
parent7c73ec405fdb55bd78d82d764999b5af6d81e973 (diff)
Hide the upmixers unless an "advanced" configuration option is ticked.v2.15.22
The upmixers are not of sufficient quality to always be an improvement, and anecdotally it seems that some users see them and hope one will be a silver bullet.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/audio_processor.cc17
-rw-r--r--src/lib/audio_processor.h2
-rw-r--r--src/lib/config.cc4
-rw-r--r--src/lib/config.h11
-rw-r--r--src/lib/film.cc8
5 files changed, 41 insertions, 1 deletions
diff --git a/src/lib/audio_processor.cc b/src/lib/audio_processor.cc
index 0d3f2b6d7..6cccbdc80 100644
--- a/src/lib/audio_processor.cc
+++ b/src/lib/audio_processor.cc
@@ -22,16 +22,21 @@
#include "mid_side_decoder.h"
#include "upmixer_a.h"
#include "upmixer_b.h"
+#include "config.h"
using std::string;
using std::list;
list<AudioProcessor const *> AudioProcessor::_all;
+list<AudioProcessor const *> AudioProcessor::_non_experimental;
void
AudioProcessor::setup_audio_processors ()
{
- _all.push_back (new MidSideDecoder ());
+ AudioProcessor* mid_side = new MidSideDecoder ();
+ _all.push_back (mid_side);
+ _non_experimental.push_back (mid_side);
+
_all.push_back (new UpmixerA (48000));
_all.push_back (new UpmixerB (48000));
}
@@ -49,6 +54,16 @@ AudioProcessor::from_id (string id)
}
list<AudioProcessor const *>
+AudioProcessor::visible ()
+{
+ if (Config::instance()->show_experimental_audio_processors()) {
+ return _all;
+ }
+
+ return _non_experimental;
+}
+
+list<AudioProcessor const *>
AudioProcessor::all ()
{
return _all;
diff --git a/src/lib/audio_processor.h b/src/lib/audio_processor.h
index e10df254c..78a3efb58 100644
--- a/src/lib/audio_processor.h
+++ b/src/lib/audio_processor.h
@@ -61,11 +61,13 @@ public:
virtual std::vector<std::string> input_names () const = 0;
static std::list<AudioProcessor const *> all ();
+ static std::list<AudioProcessor const *> visible ();
static void setup_audio_processors ();
static AudioProcessor const * from_id (std::string);
private:
static std::list<AudioProcessor const *> _all;
+ static std::list<AudioProcessor const *> _non_experimental;
};
#endif
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 1d2ef1e40..581620f83 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -94,6 +94,7 @@ Config::set_defaults ()
_tms_password = "";
_allow_any_dcp_frame_rate = false;
_allow_any_container = false;
+ _show_experimental_audio_processors = false;
_language = optional<string> ();
_default_still_length = 10;
_default_container = Ratio::from_id ("185");
@@ -384,6 +385,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);
+ _show_experimental_audio_processors = f.optional_bool_child ("ShowExperimentalAudioProcessors").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);
@@ -801,6 +803,8 @@ Config::write_config () const
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] ShowExperimentalAudioProcessors 1 to offer users the (experimental) audio upmixer processors, 0 to hide them */
+ root->add_child("ShowExperimentalAudioProcessors")->add_child_text (_show_experimental_audio_processors ? "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 9a57b1b48..ff7a0fe39 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -82,6 +82,7 @@ public:
PLAYER_PLAYLIST_DIRECTORY,
PLAYER_DEBUG_LOG,
HISTORY,
+ SHOW_EXPERIMENTAL_AUDIO_PROCESSORS,
#ifdef DCPOMATIC_VARIANT_SWAROOP
PLAYER_BACKGROUND_IMAGE,
#endif
@@ -157,6 +158,10 @@ public:
return _allow_any_container;
}
+ bool show_experimental_audio_processors () const {
+ return _show_experimental_audio_processors;
+ }
+
ISDCFMetadata default_isdcf_metadata () const {
return _default_isdcf_metadata;
}
@@ -620,6 +625,10 @@ public:
maybe_set (_allow_any_container, a);
}
+ void set_show_experimental_audio_processors (bool e) {
+ maybe_set (_show_experimental_audio_processors, e, SHOW_EXPERIMENTAL_AUDIO_PROCESSORS);
+ }
+
void set_default_isdcf_metadata (ISDCFMetadata d) {
maybe_set (_default_isdcf_metadata, d);
}
@@ -1177,6 +1186,8 @@ private:
https://www.dcpomatic.com/forum/viewtopic.php?f=2&t=1119&p=4468
*/
bool _allow_any_container;
+ /** Offer the upmixers in the audio processor settings */
+ bool _show_experimental_audio_processors;
/** Default ISDCF metadata for newly-created Films */
ISDCFMetadata _default_isdcf_metadata;
boost::optional<std::string> _language;
diff --git a/src/lib/film.cc b/src/lib/film.cc
index e85543b80..93459661b 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -93,6 +93,7 @@ using std::copy;
using std::back_inserter;
using std::map;
using std::exception;
+using std::find;
using boost::shared_ptr;
using boost::weak_ptr;
using boost::dynamic_pointer_cast;
@@ -542,6 +543,13 @@ Film::read_metadata (optional<boost::filesystem::path> path)
_audio_processor = 0;
}
+ if (_audio_processor && !Config::instance()->show_experimental_audio_processors()) {
+ list<AudioProcessor const *> ap = AudioProcessor::visible();
+ if (find(ap.begin(), ap.end(), _audio_processor) == ap.end()) {
+ Config::instance()->set_show_experimental_audio_processors(true);
+ }
+ }
+
_reel_type = static_cast<ReelType> (f.optional_number_child<int>("ReelType").get_value_or (static_cast<int>(REELTYPE_SINGLE)));
_reel_length = f.optional_number_child<int64_t>("ReelLength").get_value_or (2000000000);
_upload_after_make_dcp = f.optional_bool_child("UploadAfterMakeDCP").get_value_or (false);