diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-03 13:17:37 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-03 13:17:37 +0100 |
| commit | fa61fc99549264810e17fcd35abffe9e8ddab5b2 (patch) | |
| tree | 855ce952ed8b416bbab33cd6debbd0f2b7379597 /src/lib/mid_side_decoder.cc | |
| parent | 3b67c79bf4534e72a7eceaa6e566e7b7c949e4f7 (diff) | |
Various work on audio mapping.
Fix everything up so that the audio mapping view in
the audio panel reflects the processor (or lack of).
Diffstat (limited to 'src/lib/mid_side_decoder.cc')
| -rw-r--r-- | src/lib/mid_side_decoder.cc | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/lib/mid_side_decoder.cc b/src/lib/mid_side_decoder.cc index be82f6754..fe6282261 100644 --- a/src/lib/mid_side_decoder.cc +++ b/src/lib/mid_side_decoder.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington <cth@carlh.net> + Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,10 +19,13 @@ #include "mid_side_decoder.h" #include "audio_buffers.h" +#include "audio_mapping.h" #include "i18n.h" using std::string; +using std::min; +using std::vector; using boost::shared_ptr; string @@ -44,7 +47,7 @@ MidSideDecoder::in_channels () const } int -MidSideDecoder::out_channels (int) const +MidSideDecoder::out_channels () const { return 3; } @@ -70,3 +73,26 @@ MidSideDecoder::run (shared_ptr<const AudioBuffers> in) return out; } + +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) { + mapping.set (i, i, 1); + } +} + +vector<string> +MidSideDecoder::input_names () const +{ + vector<string> n; + + /// TRANSLATORS: this is the name of the `mid' channel for mid-side decoding + n.push_back (_("Mid")); + /// TRANSLATORS: this is the name of the `side' channel for mid-side decoding + n.push_back (_("Side")); + + return n; +} |
