X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Ffilm.cc;h=d27b15a65e9af124ee7db2d23f8e864197abe7b2;hp=60b80d052689de056619a2dc8b967fba4f46f66b;hb=e13e5cd4cfda39b0a0b77ed8036e14e15f93ec2e;hpb=df30165f29beb41078b1a17894ee1ef5327abc20 diff --git a/src/lib/film.cc b/src/lib/film.cc index 60b80d052..d27b15a65 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1438,55 +1438,6 @@ Film::subtitle_language () const return all; } -/** Change the gains of the supplied AudioMapping to make it a default - * for this film. The defaults are guessed based on what processor (if any) - * is in use, the number of input channels and any filename supplied. - */ -void -Film::make_audio_mapping_default (AudioMapping& mapping, optional filename) const -{ - static string const regex[] = { - ".*[\\._-]L[\\._-].*", - ".*[\\._-]R[\\._-].*", - ".*[\\._-]C[\\._-].*", - ".*[\\._-]Lfe[\\._-].*", - ".*[\\._-]Ls[\\._-].*", - ".*[\\._-]Rs[\\._-].*" - }; - - static int const regexes = sizeof(regex) / sizeof(*regex); - - if (audio_processor ()) { - audio_processor()->make_audio_mapping_default (mapping); - } else { - mapping.make_zero (); - if (mapping.input_channels() == 1) { - bool guessed = false; - - /* See if we can guess where this stream should go */ - if (filename) { - for (int i = 0; i < regexes; ++i) { - boost::regex e (regex[i], boost::regex::icase); - if (boost::regex_match (filename->string(), e) && i < mapping.output_channels()) { - mapping.set (0, i, 1); - guessed = true; - } - } - } - - if (!guessed) { - /* If we have no idea, just put it on centre */ - mapping.set (0, static_cast (dcp::CENTRE), 1); - } - } else { - /* 1:1 mapping */ - for (int i = 0; i < min (mapping.input_channels(), mapping.output_channels()); ++i) { - mapping.set (i, i, 1); - } - } - } -} - /** @return The names of the channels that audio contents' outputs are passed into; * this is either the DCP or a AudioProcessor. */