From fa61fc99549264810e17fcd35abffe9e8ddab5b2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 3 Jun 2015 13:17:37 +0100 Subject: Various work on audio mapping. Fix everything up so that the audio mapping view in the audio panel reflects the processor (or lack of). --- src/lib/mid_side_decoder.cc | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'src/lib/mid_side_decoder.cc') 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 + Copyright (C) 2014-2015 Carl Hetherington 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 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 +MidSideDecoder::input_names () const +{ + vector 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; +} -- cgit v1.2.3