summaryrefslogtreecommitdiff
path: root/src/lib/mid_side_decoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/mid_side_decoder.cc')
-rw-r--r--src/lib/mid_side_decoder.cc30
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;
+}