diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-07-06 23:23:26 +0200 |
|---|---|---|
| committer | cah <cth@carlh.net> | 2025-07-10 22:49:00 +0200 |
| commit | 4e244c8a4b34268445123b7d6df54ff303561fa5 (patch) | |
| tree | 54b92d242ea518ee0e9d55c20265d5ab963fc7a0 /src/lib/mid_side_decoder.cc | |
| parent | a564301f86068484d98d329971f59b10c7de892e (diff) | |
Allow audio processors to pass through HI/VI/DBox etc (#3020).
Previously you couldn't map these things if you were using a processor.
Diffstat (limited to 'src/lib/mid_side_decoder.cc')
| -rw-r--r-- | src/lib/mid_side_decoder.cc | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/lib/mid_side_decoder.cc b/src/lib/mid_side_decoder.cc index 695e4cad7..719dbce92 100644 --- a/src/lib/mid_side_decoder.cc +++ b/src/lib/mid_side_decoder.cc @@ -62,7 +62,7 @@ MidSideDecoder::clone(int) const shared_ptr<AudioBuffers> -MidSideDecoder::run(shared_ptr<const AudioBuffers> in, int channels) +MidSideDecoder::do_run(shared_ptr<const AudioBuffers> in, int channels) { int const N = min(channels, 3); auto out = make_shared<AudioBuffers>(channels, in->frames()); @@ -88,9 +88,12 @@ MidSideDecoder::run(shared_ptr<const AudioBuffers> in, int channels) void MidSideDecoder::make_audio_mapping_default(AudioMapping& mapping) const { - /* Just map the first two input channels to our M/S */ - mapping.make_zero(); - for (int i = 0; i < min(2, mapping.input_channels()); ++i) { + AudioProcessor::make_audio_mapping_default(mapping); + + auto const inputs = mapping.input_channels(); + + /* Map the first two input channels to our M/S */ + for (int i = 0; i < min(2, inputs); ++i) { mapping.set(i, i, 1); } } @@ -99,8 +102,14 @@ MidSideDecoder::make_audio_mapping_default(AudioMapping& mapping) const vector<NamedChannel> MidSideDecoder::input_names() const { - return { + vector<NamedChannel> names = { NamedChannel(_("Left"), 0), NamedChannel(_("Right"), 1) }; + + for (auto name: AudioProcessor::input_names()) { + names.push_back(name); + } + + return names; } |
