summaryrefslogtreecommitdiff
path: root/libs/panners
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-10-04 14:51:05 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-10-04 14:51:05 -0400
commit4dc63966f0872efe768dad61eb9b8785d06b92d1 (patch)
treee54104d57d6c2da7840979181368151fd0819c96 /libs/panners
parent297e80e020da94a56984b20782584bb1dd96ea34 (diff)
globally remove all trailing whitespace from ardour code base.
Paul Davis was responsible for introducing almost all of this.
Diffstat (limited to 'libs/panners')
-rw-r--r--libs/panners/1in2out/panner_1in2out.cc26
-rw-r--r--libs/panners/2in2out/panner_2in2out.cc66
-rw-r--r--libs/panners/2in2out/panner_2in2out.h2
-rw-r--r--libs/panners/stereobalance/panner_balance.cc2
-rw-r--r--libs/panners/vbap/vbap.cc58
-rw-r--r--libs/panners/vbap/vbap.h8
-rw-r--r--libs/panners/vbap/vbap_speakers.h6
7 files changed, 84 insertions, 84 deletions
diff --git a/libs/panners/1in2out/panner_1in2out.cc b/libs/panners/1in2out/panner_1in2out.cc
index 50c058b160..30f71032f4 100644
--- a/libs/panners/1in2out/panner_1in2out.cc
+++ b/libs/panners/1in2out/panner_1in2out.cc
@@ -66,7 +66,7 @@ static PanPluginDescriptor _descriptor = {
"Mono to Stereo Panner",
"http://ardour.org/plugin/panner_1in2out",
"http://ardour.org/plugin/panner_1in2out#ui",
- 1, 2,
+ 1, 2,
10000,
Panner1in2out::factory
};
@@ -81,7 +81,7 @@ Panner1in2out::Panner1in2out (boost::shared_ptr<Pannable> p)
_pannable->pan_azimuth_control->set_value (0.5);
}
}
-
+
update ();
left = desired_left;
@@ -133,7 +133,7 @@ Panner1in2out::position_range () const
return make_pair (0, 1);
}
-double
+double
Panner1in2out::position () const
{
return _pannable->pan_azimuth_control->get_value ();
@@ -149,7 +149,7 @@ Panner1in2out::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gai
pan_t pan;
Sample* const src = srcbuf.data();
-
+
/* LEFT OUTPUT */
dst = obufs.get_audio(0).data();
@@ -200,7 +200,7 @@ Panner1in2out::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gai
/* pan is 1 so we can just copy the input samples straight in */
mix_buffers_no_gain(dst,src,nframes);
-
+
/* XXX it would be nice to mark that we wrote into the buffer */
}
}
@@ -296,10 +296,10 @@ Panner1in2out::distribute_one_automated (AudioBuffer& srcbuf, BufferSet& obufs,
/* note that are overwriting buffers, but its OK
because we're finished with their old contents
(position automation data) and are
- replacing it with panning/gain coefficients
+ replacing it with panning/gain coefficients
that we need to actually process the data.
*/
-
+
buffers[0][n] = panL * (scale * panL + 1.0f - scale);
buffers[1][n] = panR * (scale * panR + 1.0f - scale);
}
@@ -345,7 +345,7 @@ Panner1in2out::get_state ()
}
-std::set<Evoral::Parameter>
+std::set<Evoral::Parameter>
Panner1in2out::what_can_be_automated() const
{
set<Evoral::Parameter> s;
@@ -364,7 +364,7 @@ Panner1in2out::describe_parameter (Evoral::Parameter p)
}
}
-string
+string
Panner1in2out::value_as_string (boost::shared_ptr<AutomationControl> ac) const
{
/* DO NOT USE LocaleGuard HERE */
@@ -373,9 +373,9 @@ Panner1in2out::value_as_string (boost::shared_ptr<AutomationControl> ac) const
switch (ac->parameter().type()) {
case PanAzimuthAutomation:
/* We show the position of the center of the image relative to the left & right.
- This is expressed as a pair of percentage values that ranges from (100,0)
+ This is expressed as a pair of percentage values that ranges from (100,0)
(hard left) through (50,50) (hard center) to (0,100) (hard right).
-
+
This is pretty wierd, but its the way audio engineers expect it. Just remember that
the center of the USA isn't Kansas, its (50LA, 50NY) and it will all make sense.
@@ -383,10 +383,10 @@ Panner1in2out::value_as_string (boost::shared_ptr<AutomationControl> ac) const
panner GUIs can do their own version of this if they need
something less compact.
*/
-
+
return string_compose (_("L%1R%2"), (int) rint (100.0 * (1.0 - val)),
(int) rint (100.0 * val));
-
+
default:
return _("unused");
}
diff --git a/libs/panners/2in2out/panner_2in2out.cc b/libs/panners/2in2out/panner_2in2out.cc
index f18dd94f45..73d193d73b 100644
--- a/libs/panners/2in2out/panner_2in2out.cc
+++ b/libs/panners/2in2out/panner_2in2out.cc
@@ -86,17 +86,17 @@ Panner2in2out::Panner2in2out (boost::shared_ptr<Pannable> p)
set_width(w > 0 ? wrange : -wrange);
}
-
+
update ();
-
+
/* LEFT SIGNAL */
left_interp[0] = left[0] = desired_left[0];
- right_interp[0] = right[0] = desired_right[0];
-
+ right_interp[0] = right[0] = desired_right[0];
+
/* RIGHT SIGNAL */
left_interp[1] = left[1] = desired_left[1];
right_interp[1] = right[1] = desired_right[1];
-
+
_pannable->pan_azimuth_control->Changed.connect_same_thread (*this, boost::bind (&Panner2in2out::update, this));
_pannable->pan_width_control->Changed.connect_same_thread (*this, boost::bind (&Panner2in2out::update, this));
}
@@ -105,13 +105,13 @@ Panner2in2out::~Panner2in2out ()
{
}
-double
+double
Panner2in2out::position () const
{
return _pannable->pan_azimuth_control->get_value();
}
-double
+double
Panner2in2out::width () const
{
return _pannable->pan_width_control->get_value();
@@ -151,16 +151,16 @@ Panner2in2out::update ()
/* it would be very nice to split this out into a virtual function
that can be accessed from BaseStereoPanner and used in do_distribute_automated().
-
+
but the place where its used in do_distribute_automated() is a tight inner loop,
and making "nframes" virtual function calls to compute values is an absurd
overhead.
*/
-
+
/* x == 0 => hard left = 180.0 degrees
x == 1 => hard right = 0.0 degrees
*/
-
+
float pos[2];
double width = this->width ();
const double direction_as_lr_fract = position ();
@@ -178,23 +178,23 @@ Panner2in2out::update ()
pos[1] = direction_as_lr_fract + (width/2.0); // right signal lr_fract
pos[0] = direction_as_lr_fract - (width/2.0); // left signal lr_fract
}
-
+
/* compute target gain coefficients for both input signals */
-
+
float const pan_law_attenuation = -3.0f;
float const scale = 2.0f - 4.0f * powf (10.0f,pan_law_attenuation/20.0f);
float panR;
float panL;
-
+
/* left signal */
-
+
panR = pos[0];
panL = 1 - panR;
desired_left[0] = panL * (scale * panL + 1.0f - scale);
desired_right[0] = panR * (scale * panR + 1.0f - scale);
-
+
/* right signal */
-
+
panR = pos[1];
panL = 1 - panR;
desired_left[1] = panL * (scale * panL + 1.0f - scale);
@@ -245,20 +245,20 @@ Panner2in2out::clamp_stereo_pan (double& direction_as_lr_fract, double& width)
}
/* if the new left position is less than or equal to zero (hard left) and the left panner
- is already there, we're not moving the left signal.
+ is already there, we're not moving the left signal.
*/
-
+
if (l_pos < 0.0) {
return false;
}
/* if the new right position is less than or equal to 1.0 (hard right) and the right panner
- is already there, we're not moving the right signal.
+ is already there, we're not moving the right signal.
*/
-
+
if (r_pos > 1.0) {
return false;
-
+
}
return true;
@@ -274,7 +274,7 @@ Panner2in2out::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gai
pan_t pan;
Sample* const src = srcbuf.data();
-
+
/* LEFT OUTPUT */
dst = obufs.get_audio(0).data();
@@ -326,7 +326,7 @@ Panner2in2out::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gai
/* pan is 1 so we can just copy the input samples straight in */
mix_buffers_no_gain(dst,src,nframes);
-
+
/* XXX it would be nice to mark that we wrote into the buffer */
}
}
@@ -425,7 +425,7 @@ Panner2in2out::distribute_one_automated (AudioBuffer& srcbuf, BufferSet& obufs,
float panR;
- if (which == 0) {
+ if (which == 0) {
// panning left signal
panR = position[n] - (width[n]/2.0f); // center - width/2
} else {
@@ -440,10 +440,10 @@ Panner2in2out::distribute_one_automated (AudioBuffer& srcbuf, BufferSet& obufs,
/* note that are overwriting buffers, but its OK
because we're finished with their old contents
(position/width automation data) and are
- replacing it with panning/gain coefficients
+ replacing it with panning/gain coefficients
that we need to actually process the data.
*/
-
+
buffers[0][n] = panL * (scale * panL + 1.0f - scale);
buffers[1][n] = panR * (scale * panR + 1.0f - scale);
}
@@ -487,7 +487,7 @@ Panner2in2out::get_state ()
return root;
}
-std::set<Evoral::Parameter>
+std::set<Evoral::Parameter>
Panner2in2out::what_can_be_automated() const
{
set<Evoral::Parameter> s;
@@ -509,7 +509,7 @@ Panner2in2out::describe_parameter (Evoral::Parameter p)
}
}
-string
+string
Panner2in2out::value_as_string (boost::shared_ptr<AutomationControl> ac) const
{
/* DO NOT USE LocaleGuard HERE */
@@ -518,23 +518,23 @@ Panner2in2out::value_as_string (boost::shared_ptr<AutomationControl> ac) const
switch (ac->parameter().type()) {
case PanAzimuthAutomation:
/* We show the position of the center of the image relative to the left & right.
- This is expressed as a pair of percentage values that ranges from (100,0)
+ This is expressed as a pair of percentage values that ranges from (100,0)
(hard left) through (50,50) (hard center) to (0,100) (hard right).
-
+
This is pretty wierd, but its the way audio engineers expect it. Just remember that
the center of the USA isn't Kansas, its (50LA, 50NY) and it will all make sense.
-
+
This is designed to be as narrow as possible. Dedicated
panner GUIs can do their own version of this if they need
something less compact.
*/
-
+
return string_compose (_("L%1R%2"), (int) rint (100.0 * (1.0 - val)),
(int) rint (100.0 * val));
case PanWidthAutomation:
return string_compose (_("Width: %1%%"), (int) floor (100.0 * val));
-
+
default:
return _("unused");
}
diff --git a/libs/panners/2in2out/panner_2in2out.h b/libs/panners/2in2out/panner_2in2out.h
index a34556d463..9dc7826f67 100644
--- a/libs/panners/2in2out/panner_2in2out.h
+++ b/libs/panners/2in2out/panner_2in2out.h
@@ -82,7 +82,7 @@ class Panner2in2out : public Panner
private:
bool clamp_stereo_pan (double& direction_as_lr_fract, double& width);
-
+
void distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes, uint32_t which);
void distribute_one_automated (AudioBuffer& srcbuf, BufferSet& obufs,
framepos_t start, framepos_t end, pframes_t nframes,
diff --git a/libs/panners/stereobalance/panner_balance.cc b/libs/panners/stereobalance/panner_balance.cc
index 7c0d7e7ff6..d078347df3 100644
--- a/libs/panners/stereobalance/panner_balance.cc
+++ b/libs/panners/stereobalance/panner_balance.cc
@@ -71,7 +71,7 @@ static PanPluginDescriptor _descriptor = {
Pannerbalance::factory
};
-extern "C" ARDOURPANNER_API PanPluginDescriptor* panner_descriptor () { return &_descriptor; }
+extern "C" ARDOURPANNER_API PanPluginDescriptor* panner_descriptor () { return &_descriptor; }
Pannerbalance::Pannerbalance (boost::shared_ptr<Pannable> p)
: Panner (p)
diff --git a/libs/panners/vbap/vbap.cc b/libs/panners/vbap/vbap.cc
index 9276dd1256..f890b50324 100644
--- a/libs/panners/vbap/vbap.cc
+++ b/libs/panners/vbap/vbap.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012 Paul Davis
+ Copyright (C) 2012 Paul Davis
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
@@ -72,7 +72,7 @@ void
VBAPanner::Signal::resize_gains (uint32_t n)
{
gains.assign (n, 0.0);
-}
+}
VBAPanner::VBAPanner (boost::shared_ptr<Pannable> p, boost::shared_ptr<Speakers> s)
: Panner (p)
@@ -112,7 +112,7 @@ VBAPanner::configure_io (ChanCount in, ChanCount /* ignored - we use Speakers */
for (uint32_t i = 0; i < n; ++i) {
Signal* s = new Signal (_pannable->session(), *this, i, _speakers->n_speakers());
_signals.push_back (s);
-
+
}
update ();
@@ -129,7 +129,7 @@ VBAPanner::update ()
double signal_direction = 1.0 - (_pannable->pan_azimuth_control->get_value() + (w/2));
double grd_step_per_signal = w / (_signals.size() - 1);
for (vector<Signal*>::iterator s = _signals.begin(); s != _signals.end(); ++s) {
-
+
Signal* signal = *s;
int over = signal_direction;
@@ -153,8 +153,8 @@ VBAPanner::update ()
SignalPositionChanged(); /* emit */
}
-void
-VBAPanner::compute_gains (double gains[3], int speaker_ids[3], int azi, int ele)
+void
+VBAPanner::compute_gains (double gains[3], int speaker_ids[3], int azi, int ele)
{
/* calculates gain factors using loudspeaker setup and given direction */
double cartdir[3];
@@ -165,7 +165,7 @@ VBAPanner::compute_gains (double gains[3], int speaker_ids[3], int azi, int ele)
const int dimension = _speakers->dimension();
assert(dimension == 2 || dimension == 3);
- spherical_to_cartesian (azi, ele, 1.0, cartdir[0], cartdir[1], cartdir[2]);
+ spherical_to_cartesian (azi, ele, 1.0, cartdir[0], cartdir[1], cartdir[2]);
big_sm_g = -100000.0;
gains[0] = gains[1] = gains[2] = 0;
@@ -192,8 +192,8 @@ VBAPanner::compute_gains (double gains[3], int speaker_ids[3], int azi, int ele)
big_sm_g = small_g;
- gains[0] = gtmp[0];
- gains[1] = gtmp[1];
+ gains[0] = gtmp[0];
+ gains[1] = gtmp[1];
speaker_ids[0] = _speakers->speaker_for_tuple (i, 0);
speaker_ids[1] = _speakers->speaker_for_tuple (i, 1);
@@ -207,11 +207,11 @@ VBAPanner::compute_gains (double gains[3], int speaker_ids[3], int azi, int ele)
}
}
}
-
+
power = sqrt (gains[0]*gains[0] + gains[1]*gains[1] + gains[2]*gains[2]);
if (power > 0) {
- gains[0] /= power;
+ gains[0] /= power;
gains[1] /= power;
gains[2] /= power;
}
@@ -264,7 +264,7 @@ VBAPanner::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_co
assert (sz == obufs.count().n_audio());
int8_t *outputs = (int8_t*)alloca(sz); // on the stack, no malloc
-
+
/* set initial state of each output "record"
*/
@@ -282,12 +282,12 @@ VBAPanner::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_co
if (signal->outputs[o] != -1) {
/* used last time */
outputs[signal->outputs[o]] |= 1;
- }
+ }
if (signal->desired_outputs[o] != -1) {
/* used this time */
outputs[signal->desired_outputs[o]] |= 1<<1;
- }
+ }
}
/* at this point, we can test a speaker's status:
@@ -296,7 +296,7 @@ VBAPanner::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_co
(*outputs[o] & 2) <= in use this time
(*outputs[o] & 3) == 3 <= in use both times
*outputs[o] == 0 <= not in use either time
-
+
*/
for (int o = 0; o < 3; ++o) {
@@ -310,14 +310,14 @@ VBAPanner::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_co
pan = gain_coefficient * signal->desired_gains[o];
if (pan == 0.0 && signal->gains[output] == 0.0) {
-
+
/* nothing deing delivered to this output */
signal->gains[output] = 0.0;
-
+
} else if (fabs (pan - signal->gains[output]) > 0.00001) {
-
- /* signal to this output but the gain coefficient has changed, so
+
+ /* signal to this output but the gain coefficient has changed, so
interpolate between them.
*/
@@ -326,10 +326,10 @@ VBAPanner::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_co
signal->gains[output] = pan;
} else {
-
+
/* signal to this output, same gain as before so just copy with gain
*/
-
+
mix_buffers_with_gain (obufs.get_audio (output).data(),src,nframes,pan);
signal->gains[output] = pan;
}
@@ -354,9 +354,9 @@ VBAPanner::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_co
*/
}
-void
+void
VBAPanner::distribute_one_automated (AudioBuffer& /*src*/, BufferSet& /*obufs*/,
- framepos_t /*start*/, framepos_t /*end*/,
+ framepos_t /*start*/, framepos_t /*end*/,
pframes_t /*nframes*/, pan_t** /*buffers*/, uint32_t /*which*/)
{
/* XXX to be implemented */
@@ -390,7 +390,7 @@ VBAPanner::out() const
return ChanCount (DataType::AUDIO, _speakers->n_speakers());
}
-std::set<Evoral::Parameter>
+std::set<Evoral::Parameter>
VBAPanner::what_can_be_automated() const
{
set<Evoral::Parameter> s;
@@ -403,7 +403,7 @@ VBAPanner::what_can_be_automated() const
}
return s;
}
-
+
string
VBAPanner::describe_parameter (Evoral::Parameter p)
{
@@ -419,7 +419,7 @@ VBAPanner::describe_parameter (Evoral::Parameter p)
}
}
-string
+string
VBAPanner::value_as_string (boost::shared_ptr<AutomationControl> ac) const
{
/* DO NOT USE LocaleGuard HERE */
@@ -428,13 +428,13 @@ VBAPanner::value_as_string (boost::shared_ptr<AutomationControl> ac) const
switch (ac->parameter().type()) {
case PanAzimuthAutomation: /* direction */
return string_compose (_("%1\u00B0"), (int (rint (val * 360.0))+180)%360);
-
+
case PanWidthAutomation: /* diffusion */
return string_compose (_("%1%%"), (int) floor (100.0 * fabs(val)));
case PanElevationAutomation: /* elevation */
return string_compose (_("%1\u00B0"), (int) floor (90.0 * fabs(val)));
-
+
default:
return _("unused");
}
@@ -451,7 +451,7 @@ VBAPanner::signal_position (uint32_t n) const
}
boost::shared_ptr<Speakers>
-VBAPanner::get_speakers () const
+VBAPanner::get_speakers () const
{
return _speakers->parent();
}
diff --git a/libs/panners/vbap/vbap.h b/libs/panners/vbap/vbap.h
index ee9d456627..ab3c2a6fd2 100644
--- a/libs/panners/vbap/vbap.h
+++ b/libs/panners/vbap/vbap.h
@@ -34,8 +34,8 @@ namespace ARDOUR {
class Speakers;
class Pannable;
-class VBAPanner : public Panner
-{
+class VBAPanner : public Panner
+{
public:
VBAPanner (boost::shared_ptr<Pannable>, boost::shared_ptr<Speakers>);
~VBAPanner ();
@@ -81,14 +81,14 @@ private:
std::vector<Signal*> _signals;
boost::shared_ptr<VBAPSpeakers> _speakers;
-
+
void compute_gains (double g[3], int ls[3], int azi, int ele);
void update ();
void clear_signals ();
void distribute_one (AudioBuffer& src, BufferSet& obufs, gain_t gain_coeff, pframes_t nframes, uint32_t which);
void distribute_one_automated (AudioBuffer& src, BufferSet& obufs,
- framepos_t start, framepos_t end, pframes_t nframes,
+ framepos_t start, framepos_t end, pframes_t nframes,
pan_t** buffers, uint32_t which);
};
diff --git a/libs/panners/vbap/vbap_speakers.h b/libs/panners/vbap/vbap_speakers.h
index c3e90ce646..10b9e61d3a 100644
--- a/libs/panners/vbap/vbap_speakers.h
+++ b/libs/panners/vbap/vbap_speakers.h
@@ -51,7 +51,7 @@ public:
private:
static const double MIN_VOL_P_SIDE_LGTH;
- int _dimension;
+ int _dimension;
boost::shared_ptr<Speakers> _parent;
std::vector<Speaker> _speakers;
PBD::ScopedConnection speaker_connection;
@@ -69,7 +69,7 @@ private:
struct threeDmatrix : public dvector {
threeDmatrix() : dvector (9, 0.0) {}
};
-
+
struct tmatrix : public dvector {
tmatrix() : dvector (3, 0.0) {}
};
@@ -99,7 +99,7 @@ private:
void choose_speaker_pairs ();
void sort_2D_lss (int* sorted_lss);
int calc_2D_inv_tmatrix (double azi1,double azi2, double* inv_mat);
-
+
};
} /* namespace */